Connecting my SenseCAP to Wi-Fi was a nightmare
A small ESP32-S3 display could see my FRITZ!Box network but would not join it, even with the confirmed password and a strong signal.
I wanted a small Wi-Fi display. I was setting up a SenseCAP Indicator D1 to show a German word clock, and it needed a connection to my home network.
The SenseCAP found my FRITZ!Box network. I entered the password, waited, and got a connection failure. Trying again and moving the device closer to the router did not change anything.
Before I could get on with the display, I had to work out why it would not join Wi-Fi.
The logs gave me a clue: reason 204, HANDSHAKE_TIMEOUT. That pointed to the security exchange during connection, but it did not prove the password was wrong. Espressif lists that code under both password-related and low-signal problems. [1]
I checked the intended network and confirmed the current key directly from the router configuration. The connection still failed. To rule out the rest of my application, I replaced it temporarily with a minimal program whose only job was to connect using those credentials.
Even that program failed. I tried disabling power saving, restricting Wi-Fi to 802.11b/g, and disabling protected management frames. Neither those changes nor tests with ESP-IDF 5.1.6 and 5.1.7 got it connected.
Then I tried the hotspot on my Mac mini. The same minimal program connected and obtained an IP address. Back on the FRITZ!Box, it still failed.
I returned to the failing network and changed the ESP32-S3's maximum transmit-power setting. The driver reported 80, corresponding to a ceiling of 20 dBm. I lowered it to 28, corresponding to 7 dBm, and verified the readback. These are configured maximums, not measurements of what the antenna actually radiates. [2]
This time, the SenseCAP joined my home network and obtained an IP address.
I wanted to know whether the setting had made the difference or whether another retry had happened to work. Putting the ceiling back to 80 produced the handshake timeout again; lowering it to 28 restored the connection. The key, station address, SDK version, router, and other test settings stayed the same.
In the normal firmware, a recovery path that restarts Wi-Fi before applying the lower ceiling and retrying got it connected too. I rebooted the SenseCAP, and it connected again with the saved credentials. The working fix required no change to the router's security or radio settings.
I watched each boot for 20 seconds after it acquired an IP address, with no further disconnect. Longer runs are still needed, and I do not yet know why the lower ceiling matters on this device and router. But I could finally move on from getting the display onto Wi-Fi.
References
- ESP-IDF 5.1.1 Wi-Fi driver guide: handshake timeout reason 204.
- ESP-IDF 5.1.1 transmit-power API: configured power limits, units, and supported levels.