I'm trying to use ESP32 to learn IoT. But I'm stuck at connecting ESP32 to my home Wifi.
First, I used Arduino 1.8.19 and Wifi Scan to scan my home network, it scanned my home network but cannot connect (I was sure ssid and password were correct). I changed ssid to my phone hotspot, it connected fine, I changed to my office network, it connected fine.
Next, I decide to use ESP-IDF with VSCode. I chose to use the ESP-IDF 5.1.1. I use wifi_station template. Same thing happened, I could connect to many 2.4 Ghz Wifi networks I knew except my home Wifi.
I knew my router was dual channel, so I turn off 5Ghz mode. Still no connection.
Worst thing was, my router could connect to other 2.4Ghz devices (old phones and computers) just fine.
I don't know why my router hate ESP32 so much
Please give me some idea on how to debug this. With current code (I'm using wifi_station as template), there isn't much information to diagnose. And throwing the router away is not a good option right now.
The code and the log are in the attachments.
ESP32 can connect to some Wifi 2.4Ghz networks except my home Wifi 2.4Ghz
-
- Posts: 3
- Joined: Wed Apr 13, 2022 5:57 am
Re: ESP32 can connect to some Wifi 2.4Ghz networks except my home Wifi 2.4Ghz
What are the differences between the AP configuration for your office network as compared to your home AP? For example, are the configured for the same encryption?
I would also suggest, in ESP-IDF, turn on the debug level logging. There are also some debug flags for wifi in particular, I think, in the sdkconfig. This may provide detail showing the specific reason for failure. I am not familiar with the wifi station template, but if it has implemented the wifi event handler, then in the handler, on disconnect, you can find the reason code in the data passed to the event handler and log that information. The reason codes are defined in one of the header files.
I would also suggest, in ESP-IDF, turn on the debug level logging. There are also some debug flags for wifi in particular, I think, in the sdkconfig. This may provide detail showing the specific reason for failure. I am not familiar with the wifi station template, but if it has implemented the wifi event handler, then in the handler, on disconnect, you can find the reason code in the data passed to the event handler and log that information. The reason codes are defined in one of the header files.
Who is online
Users browsing this forum: Bing [Bot] and 174 guests