Closed gaurav0190 closed 4 years ago
I also have same issue when i dump the simple WiFi server code example to esp32 but it stuck to connect to the mobile hotspot. when i scan wifi network via the board , it shows the mobile wifi. please help me
same here
1) Add WiFi.disconnect()
at the beginning of setup()
2) Run python esptool.py erase_flash
from the command line. This will wipe all code from the device (including the nvs partition).
3) Follow the instructions for posting an issue at ISSUE_TEMPLATE
please try latest master. I just pushed a possible fix. please report if all is good
I solved (independently of any master fix) it was a router problem solved rebooting it (while most of other devices were connecting to it with no problems I noticed one laptop was also not able to connect anymore hence I suspected the router)
Guys, Thanks for keeping it open. It looks like I am facing same issue with some access points
Where does this happen?
Here is the test scenario and how to reproduct
Here are the logs:
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 4
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - **STA_GOT_IP**
[D][WiFiGeneric.cpp:385] _eventCallback(): STA IP: 192.168.43.40, MASK: 255.255.255.0, GW: 192.168.43.233
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 7
[D][Test_Wifi.cpp:109] WiFiEvent(): WiFi connected. IP address: 192.168.43.40
�x␌␎␃���[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
[W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 2 - AUTH_EXPIRE
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 5
[D][Test_Wifi.cpp:113] WiFiEvent(): WiFi lost connection
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
[W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 2 - AUTH_EXPIRE
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 5
[D][Test_Wifi.cpp:113] WiFiEvent(): WiFi lost connection
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
[W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 2 - AUTH_EXPIRE
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 5
[D][Test_Wifi.cpp:113] WiFiEvent(): WiFi lost connection
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
[W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 4 - ASSOC_EXPIRE
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 5
[D][Test_Wifi.cpp:113] WiFiEvent(): WiFi lost connection
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 5 - STA_DISCONNECTED
[W][WiFiGeneric.cpp:357] _eventCallback(): Reason: 201 - NO_AP_FOUND
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 5
[D][Test_Wifi.cpp:113] WiFiEvent(): WiFi lost connection
[I][Test_Wifi.cpp:134] connectToStoredAP(): Connecting to stored credentials ***********
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 2
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 0
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 4
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:385] _eventCallback(): STA IP: 192.168.43.40, MASK: 255.255.255.0, GW: 192.168.43.180
[D][Test_Wifi.cpp:106] WiFiEvent(): [WiFi-event] event: 7
[D][Test_Wifi.cpp:109] WiFiEvent(): WiFi connected. IP address: 192.168.43.40
Also I have gone through pretty much all issues ASSOC_EXPIRE and AUTH_EXPIRE. None help this https://github.com/espressif/arduino-esp32/issues/653 https://github.com/espressif/esp-idf/issues/738
I have exactly the same issue as @thehellmaker describes. It does not connect to some hotspots, with infinite auth expire loop. And exactly the same thing, if I restart the hotspot - all of the sudden it connects. Actually, it happened to completely different wifi networks similar way. I need a solution ASAP.
@me-no-dev did you say you made some fixes that could be downloaded? Is it a new version of WiFi.h module? Where is it and how to update it? I am willing to test and report if it works. Thank you!
I had the same symptoms at a friend's place. Turns out his router default DHCP settings permitted only 10 devices at the same time.
I've this problems after some time, lease time i think is problem, you can test with static address
I have the same problem. I can scan the ssid, but cant connect. I have to get closer to the AP to connect...
I had a similar issue. What helped: I updated the Arduino's ESP32 in board manager to version 1.0.2 and it fixed the WiFi module behavior! It appears like there was a bug in the previous one. The second thing that helped in my case was a good quality USB cable. It first sounds crazy that USB cable can affect something like that, but indeed it does! In bad quality USB cables, the voltage drop is very high due to high resistance. This can cause the voltage to be too low for ESP32 and its power-hungry WiFi module to function. In such case, it would generate "Brownout detector triggered" warnings in the serial monitor and WiFi may be unable to connect. Replacing it with good quality USB cable immediately resolves this. It is not only about the length (even though typically the shorter the better), but primarily about quality, I had even 3-meter quality cables behave better than 0.5-meter bad quality one. I hope this information helps!
Still this same problem of AUTH_EXPIRE loop . I don't find a reliable way to face it :(. Even with no password router ... :/
This issue is showed from many users also in some our devices not all , 5% on all. But I can't find any solution or bug alert on ESP , @me-no-dev
there are some updates in the 3.2 branch of IDF. I will merge them and rerelease the libs.
My issue:
Solution: ESP32 Arduino 1.0.3 Pre-Release Thank you very much @me-no-dev
Hey :D it fixed something. Could you all please test 1.0.3-rc1 from the development package manager link?
I test with 2 different ESP32:
Yes also us seems some connection problems it resolves (sometimes with reboot), but we ve noticed about range is few with some AP, it's strange thing
@me-no-dev There is a new release in ESP-IDF (v3.0.8), could you please build for this version? I will test it and report if this new version fix this issue or not.
Thank you, YM Kuo
arduino-esp32 is currently on esp-idf 3.2. When either 3.2.1 or 3.3 is released, the idf will be updated.
hey @lbernstone @kuoyaoming93 3.2.2 is released.
I compiled the IDF v3.2.2 by myself and also the ESP-IDF Pre-release v3.3-rc. But this bug in wifi's range stil exists.
Is there any update about this bug?
I experienced same. Have 2 esp32 modules and sometimes after flash one or other cannot connect ot wifi (I have WiFi.disconnect(true) and beginning of setup()). Is there some other workaround which can improve this @me-no-dev ? Thanks.
I'm getting the same problem on Netgear CG3100D-2 router and an older Apple AirPort Express.
I have tried flashing my current ESP32, bought a new device and got same problem straight away, etc.
Any help on this? It's really holding up a project I wanted to release end of last month.
Here is the end of the logs when trying to get ESP32 to connect to my wireless network
10:52:55.630 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 2 - AUTH_EXPIRE 10:52:57.719 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:52:57.719 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 201 - NO_AP_FOUND 10:52:59.629 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:52:59.629 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 201 - NO_AP_FOUND 10:53:01.743 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:53:01.743 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 201 - NO_AP_FOUND 10:53:03.821 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:53:03.856 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 201 - NO_AP_FOUND 10:53:06.794 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:53:06.794 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 2 - AUTH_EXPIRE 10:53:07.611 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 5 - STA_DISCONNECTED 10:53:07.644 -> [W][WiFiGeneric.cpp:353] _eventCallback(): Reason: 202 - AUTH_FAIL 10:53:26.574 -> [D][WiFiGeneric.cpp:337] _eventCallback(): Event: 17 - AP_STAIPASSIGNED
Is there any more debug info I can add?
None of that stuff worked. I searched for so long across so many resources.
I ended up digging around in the ESP code base and happened upon this little nugget
ESP_ERROR_CHECK(nvs_flash_erase()); nvs_flash_init();
This seems to have cleared my "AUTH_EXPIRE" credentials and got my WiFi working again. One caution is that it clears everything in flash. So if you are using preferences library, etc, it all gets wiped.
Hello,
I'm sorry, i do not understand your last message. Can you explain a little further please? Thanks
I was experiencing the AUTH_EXPIRE problem when trying to re-connect to my WiFi. Nothing had changed, the ESP had been working for a month or so. All of a sudden, it refused to re-connect to the same WiFi. I don't really know what was causing the AUTH_EXPIRE exception, but perhaps an expired DHCP lease not being released, or something along those lines.
I tried erasing the device as per instructions, but that did not work. I tried calling disconnect on the WiFi connection but it was never connected in the first place so couldn't disconnect, the AutoConnect library has no way to wipe all memorised WiFi networks. Or the std WiFi library
I found the code snippet above which did exactly what I wanted: erased the flash memory where the WiFi details were saved by the AutoConnect library. Basically all the WiFi management libraries all save their config in flash.
I forgot to mention above that you will also the the below include:
Thank you for your response.
Unfortunately that did not work for me:
[WiFi-event] event: 5 Disconnected from WiFi access point WiFi lost connection. Reason: 2
Too sad!
Maybe try a
ESP.restart();
after the flash erase statement
Hello, I can't erase flash because other configuration settings exist. Do you have any workaround?
No, I dont. :(
I spent so long trying to find out a way wipe WiFi details from flash, directly read details from flash, etc.
The only solution I found was to wipe the entire flash area.
Hopefully someone else has a suggestion. There must be a way, I don't know what it is though.
WiFi.disconnect(false,true)
will delete the saved WiFi connection info.
Does that work if you aren't connected to the WiFi network?
I didn't try with the true, false parameters, but WiFi.disconnect(); did nothing to help with my problem
WiFi.disconnect(false,true)
will delete the saved WiFi connection info.
Hi. This doesn't work. But I just updated esp32 platform version to 1.11.0 .Now it doesn't go into infinite loops. It does AUTH_EXPIRE for sometime and then AUTH_FAIL s and then connects. I had this issue until 1.9.0
I've only started ESP32 development, so forgive me if this is a simple question.
I can only see 1.0.4 as the latest version for the ESP32 development board option in Arduino IDE, and can see 1.0.4 as the latest release on the espressif GitHub page https://github.com/espressif/arduino-esp32/releases
Where are you getting version 1.11.0 from?
I assume you are not using the Arduino IDE, and there is some other platform you are using?
Platform.io v1.11.0
Does this issue be related to the ADC2 channel? Because Wifi drivers use ADC2 pins
Update: the issue with hotspot was resolved with 1.11.0 platform io version. But I still have issues with with tp link TL WA 850 RE and goes into infinite AUTH_EXPIRE loop. After about 75 time of AUTH_EXPIRE it automatically reconnected.
I have this problem too.
I founded that this problem occurred when I use "Serial Monitor" of Arduino IDE 1.8.5. on Ubuntu. 16.04 LTS
My (temporary) solution is - - - - > use PuTTY instead Serial Monitor of Arduino IDE
Or
Compile program and upload to ESP32 Board with Arduino IDE
Close Arduino IDE
Waiting my ESP32 Board Connect to WiFi Completed. (notify me with Built-ins LED)
Open Arduino IDE
Use Serial Monitor (of Arduino IDE) connect to my ESP32 Board
yep! that work, using putty no problem for me
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
I faced this issue with CH340+ESP32 board (Wemos D1 R32), when USB-UART connection is OFF (RTS=H, DTR=H). I/F level of CH340 is 5V. When RTS=H & DTR=H, IO0 is 4.1V, EN is 4.1V. https://github.com/sohtamei/docs/blob/master/images/WenosD1R32_.jpg
When IO0 is 4.1V, the connection error which was reported on this thread occurs. I don't know why IO0=4.1V causes connection error.
Applying 4.1V power to your esp32 can permanently damage the device.
Hi lbernstone, Thanks !
When using "Wenos D1 R32" and "ESPDUINO32", there is a following workaround: Add 330 ohm to 3V3-RST and 3V3-IO0.
Hi, sohtamei and everybody - I stumbled upon the above solution after being at near wit's end on how to solve my ESP32 (its a Wemos D1 R32 dev board) WIFI issue. I am inexperienced in electronics, and would like to ask 2 questions:
Thanks so much!
Hi dtmix,
can I still make use of the 3V3 pin?
Yes, you can use 3V3 pin but you have to keep the register during wifi connection. To do it, you have to connect both the register and your device to one 3V3 pin.
(I am trying to deploy my solution to a pilot environment and would prefer to avoid having resistors stick out like this, if possible to avoid)
I also want it strongly, but I could not..
Could you try following solution ?
Dear sohtamei,
THANK YOU so much for the prompt response!! Yes, I see your point! I ended up with similar idea of bending the resistor to the side eventually (but its not pretty) :-) I do wish there can be a firmware upgrade for this issue, but I guess not .. Nvm, will conceal this inside the box for final display.
Just to share info also, I think offloading sensor power requests to a breadboard with independent power supply can also make D1 R32 more stable ...
Again thanks and have a good day!!
[D][WiFiGeneric.cpp:345] _eventCallback(): Event: 5 - STA_DISCONNECTED [W][WiFiGeneric.cpp:360] _eventCallback(): Reason: 2 - AUTH_EXPIRE [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 0 - WIFI_READY [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 5 - STA_DISCONNECTED [W][WiFiGeneric.cpp:360] _eventCallback(): Reason: 2 - AUTH_EXPIRE [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 0 - WIFI_READY [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 5 - STA_DISCONNECTED [W][WiFiGeneric.cpp:360] _eventCallback(): Reason: 2 - AUTH_EXPIRE [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 0 - WIFI_READY [D][WiFiGeneric.cpp:345] _eventCallback(): Event: 2 - STA_START
Originally posted by @panther1 in https://github.com/espressif/arduino-esp32/issues/1829#issuecomment-417990979