Page 1 of 1

problem with wifi connection with my router

Posted: Fri Sep 29, 2023 4:17 pm
by MRamone
hi,
my diy board with ESP32-C3 doesn't want to connect via wifi to my router. Whatever i try (the examples in Arduino IDE or other code i find in the internet...) i get the following:

eventCallback(): Reason: 2 - AUTH_EXPIRE

however, it does connect to my smartphone hotspot without any issues and works fine.

Other commercial ESP32-C3 boards and WROVER boards i have don't show this problem.
I have seen many people reporting similar issues, but have not found a reason nor a solution.

Any ideas? thanks!

Re: problem with wifi connection with my router

Posted: Fri Sep 29, 2023 6:36 pm
by lbernstone
Enable "Erase All Flash Before Sketch Upload" and see if there is an invalid lease stuck in your flash.
Turn on verbose debugging and post the whole transaction.
What is the brand/model of the router?

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 2:44 pm
by MRamone
thanks for your answer.
Did as you said, this is what comes out (in a loop) when running the SimpleWIFIServer:

[ 42597][W][WiFiGeneric.cpp:1057] _eventCallback(): Reason: 2 - AUTH_EXPIRE
[ 42604][D][WiFiGeneric.cpp:1081] _eventCallback(): WiFi AutoReconnect Running
[ 42620][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
...[ 44282][V][WiFiGeneric.cpp:362] _arduino_event_cb(): STA Disconnected: SSID: Luxembourg Online CPM, BSSID: xx:xx:xx:xx:xx:xx, Reason: 2
[ 44283][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
[ 44290][W][WiFiGeneric.cpp:1057] _eventCallback(): Reason: 2 - AUTH_EXPIRE

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 2:47 pm
by MRamone
my router is a fritzbox 5490

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 6:12 pm
by lbernstone
Fritzbox routers have always been an issue for esp32. Try putting WiFi.disconnect(false,true); before you call WiFi.begin

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 7:09 pm
by MRamone
no luck i am afraid :-/

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 7:44 pm
by lbernstone
I don't have one, so I can only point you to discussion about it.
https://github.com/espressif/arduino-esp32/issues/2501

Re: problem with wifi connection with my router

Posted: Sat Sep 30, 2023 8:21 pm
by MRamone
thanks, i appreciate your help!