Wifi Internal Error on ESP32C3 #10524
Replies: 22 comments 55 replies
-
Try this, first part of my connect(): def connect():
sta_if.active(True)
# seems more reliable to start with a fresh connect()
if sta_if.isconnected():
sta_if.disconnect()
print (f'started in the connected state, but now disconnected')
else:
print (f'started in the disconnected state')
utime.sleep(0.1) |
Beta Was this translation helpful? Give feedback.
-
This is what I am seeing in the network side. |
Beta Was this translation helpful? Give feedback.
-
The PCB layout is here: |
Beta Was this translation helpful? Give feedback.
-
Very interesting... your code ran fine first time... and then:
ont he next run fine again:
Im going to try using your network functions and see how it goes |
Beta Was this translation helpful? Give feedback.
-
Hey folks, Attached is a 4 minute Wireshark capture of all traffic to and from one of the boards running the connect code below:
the log:
I am seeing a lot of malformed packets sent by the ESP32: There is some sort of bug int he stack, and I need to figure out who/how to fix. Attached is a pcap (I am using a test network so passwords in this stuff dont matter): ESP32-C3-Micropython-Capture.pcap.zip The ESP and the access point are about 7 feet apart. |
Beta Was this translation helpful? Give feedback.
-
Here is an updated video showing the unit flashed, and how the basic out-the-box code does not allow it to connect: |
Beta Was this translation helpful? Give feedback.
-
Works like a dream on an RPi board.. :(
|
Beta Was this translation helpful? Give feedback.
-
Hey Jeremy, I have the same problem with Adafruis QT PY ESP32C3 as you described. It seems to be related to strength and quality of wi-fi connection. In my case OSError: Wifi Internal Error occurs every time I move the board more than 2 meters away from my router. Then the script always fails. Other devices, like phone and PC, have no issues with wi-fi connection. Also, using the same code, there are absolutely no such problems with Pico W, regardless from the distance from the router (within a rather small flat). Simple code snippet used:
I don't really know what range should I expect, but for now it's a disappointment. Maybe it's due to power source (USB from PC), some wi-fi configuration? I haven't dived into the subject yet. |
Beta Was this translation helpful? Give feedback.
-
Try to add : ` |
Beta Was this translation helpful? Give feedback.
-
Recently I have been having problems with WiFi on the esp32-xx. One way to improve connectivity is to disable power management. import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.config(pm=wlan.PM_NONE) # disable power management The default after boot is 1, setting it to 0 will disable power management. |
Beta Was this translation helpful? Give feedback.
-
What version of esp's idf are you using? I started running into a very similar exception ( |
Beta Was this translation helpful? Give feedback.
-
I ended up here because I have the same problem (OSError: Wifi Internal Error). I don't have a solution or specific question at this point but maybe this info could help. Board: Xiao ESP32-S3 Sense with camera I downloaded this firmware linked on this page: https://wiki.seeedstudio.com/XIAO_ESP32S3_Micropython/ So I visited: https://github.com/shariltumin
esptool gives me this message when trying to flash the firmware: Abou the wifi problem, it seems hard to reproduce / irregular. But from my experience it happens after some/several socket errors or camera capture errors. Sorry if this doesn't add anything useful, just sharing |
Beta Was this translation helpful? Give feedback.
-
Any news here? |
Beta Was this translation helpful? Give feedback.
-
From the earlier comments it looks like a hardware issue (power drops on that board) and/or a bug in the IDF. |
Beta Was this translation helpful? Give feedback.
-
I have same problem, the problem is fixed if the USB not connected. I suspect the problem is due to interference from USB3 as the ping TTL is fairly stable around 1ms, if I plug in the board I get packet loss and TTL all over the place (>100ms). Sometimes it completely drops out. Update: It is very inconsistent.
All of the above tests had intermittent results (connect), sometimes the thing would refuse to connect no matter what. UPDATE2: Somehow different version of IDFs can mask the issue. |
Beta Was this translation helpful? Give feedback.
-
The problem is not USB is being affected but WiFi is being affected by having USB plugged in. So the dummy load test is not relevant. I do not have required RF equipment to test, so I am resorting to trial and error. If I blow the RF section, it is fine, in current state these modules are junk, and I have whole bunch of them to go through (idiot me bought more without testing the wifi). Of course that piece of wire is not 50 Ohm, but I am running with assumption that the whole CLC+Ceramic antenna setup is not 50 Ohms either. The USB/no USB affected the badly tuned system just enough to push it over the threshold of not connecting. The fact that RSSI dropped from -56 to -20 with a mismatched 61mm long wire, suggest that the RF section is junk. There is no can on the SoC either so that can also affect a lot of thing. I will scour my junk pile of old Wifi routers and see if I can an usable "50Ohm" antenna off them. EDIT: Here is a relevant doc on the RF tuning for C3 : https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32c3/schematic-checklist.html#fig-rf-tuning Looking at the actual board there is only 1 capacitor in series with the the ceramic antenna, as well as the antenna is floating (other end is not grounded). There is nothing else coming from pin 1 on the SoC. The whole thing seems to be botched up and amazingly it works at all (although terribly). EDIT2: I did further inspection on the boards I have and all of them are missing CLC filter and instead the L part is replaced with a single 9.6nF capacitor and two other caps are left unpopulated. The value of the capacitor is confirmed by measuring in circuit with LCR so might not be 9.6nF (it measured 9.670nF by LCR meter DE-5000, so fairly accurate).
This doesn't match the schematic found on the internet when searched for ESP32-C3 Supermini. I am tempted to restore the CLC filter with reference component values form the Espressif documentation and see if there is any improvement. I suspect the accountants had a go at the board and further reduced the cost by saving 10c on the components. I will give my thoughts to the seller about the situation. At least I have only bought 7 of the things, given the cost of these things not a great loss, except of the huge waste of time. Given the issue with the RF and not the power section, it is beyond my skill/experience/tooling. I have no means to confirm the center frequency, Q factor, or even impedance of the RF section. The hardest part of sourcing/building a 2.4-3.0nH inductor, given my LCR meter has resolution of around 0.001μH. Experimenting with a piece of wire it seems that inductor is pretty much a 3-4mm long jumper, so I suspect a 0Ohm resistor would the job. |
Beta Was this translation helpful? Give feedback.
-
Yet another update. I have managed to salvage a 3nH inductor (maybe the value is not exactly 3nH) in correct form factor from really old Linksys ADSL router (funnily enough labelled as C5 on the silkscreen). After that modification I get rssi around -30 (-50 or worse in the original configuration), and connection on first try. Unfortunately the ICMP is still over the place, but changing txpower now has no effect. I might order bunch of inductors (2.2nH, 3.6nH and 3.9nH) and experiment. This is a somewhat success, the mod improved connectivity but reduced signal quality (perhaps the inductor is not of the right value). |
Beta Was this translation helpful? Give feedback.
-
https://www.reddit.com/r/esp32/comments/18umlz7/esp32_c3_supermini_wifi_not_working/ There seem to be a few. |
Beta Was this translation helpful? Give feedback.
-
What I noticed: on the very newest (November 2024) firmware WLED 0.15beta7 works without major issues, ESP Home firmware does not see WiFi at all. It means there must be some software update which renders these boards useful. |
Beta Was this translation helpful? Give feedback.
-
I found the answer on reddit, turns out
|
Beta Was this translation helpful? Give feedback.
-
This feels like some of the problems I was having: Solved by:
and also only issue |
Beta Was this translation helpful? Give feedback.
-
Hi! I have a similar problem with the ESP32-C3 supermini (china version). sta_if.isconnected() never gets True. It seems the RF is disturbing the rest of the board. Putting a piece of shield between the chip-antenna and the ESP-chip makes the situation a lot better. I used aluminium foil insulated with tape and played with various tx-power values around 20. can anybody confirm this? |
Beta Was this translation helpful? Give feedback.
-
I have a bunch of Adafruis QT PY ESP32C3 boards flashed with the latest 1.19.1 code and I am having trouble with them consistently connecting to WiFi:
How can I consistently get connected as opposed to getting these internal errors. (Which on some boards happens for a few attempts if I try: except: and then connects)
returns:
Beta Was this translation helpful? Give feedback.
All reactions