How to check condition of ESP32-S3 wifi hardware?

karunt
Posts: 111
Joined: Sat Apr 03, 2021 7:58 am

How to check condition of ESP32-S3 wifi hardware?

Postby karunt » Thu Sep 25, 2025 9:46 pm

I have a wifi provisioning code which allows esp32-s3 to connect to a wifi ssid successfully. But shortly thereafter, it disconnects from the wifi network. This problem began suddenly after working perfectly fine for several days with the same code. The same code works perfectly fine on a second esp32-s3 chip, which stays connected to the network following a successful connection. Is there anyway to check the status or condition of the WiFi hardware on the esp32-s3 to see why it suddenly started to disconnect from the wifi network after first connecting successfully to it? The error messages I’m getting aren’t really helpful in investigating the issue.

Here's the error log that goes in an endless loop (and believe me, the host is not unreachable):
E (7814636) esp-tls: [sock=54] connect() error: Host is unreachable
E (7814636) transport_base: Failed to open a new connection: 32772
E (7814646) mqtt_client: Error transport connect

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: How to check condition of ESP32-S3 wifi hardware?

Postby ahsrabrifat » Fri Sep 26, 2025 2:43 pm

Try a different power supply. Weak 3.3 V rails can cause WiFi TX spikes to brown out the radio, leading to disconnects.

Try a different WiFi channel or AP. (Some ESP chips are more sensitive to noisy environments.)

Update to the latest ESP-IDF / Arduino-ESP32 core, in case of driver fixes.

karunt
Posts: 111
Joined: Sat Apr 03, 2021 7:58 am

Re: How to check condition of ESP32-S3 wifi hardware?

Postby karunt » Tue Sep 30, 2025 5:12 pm

Both ESP32-S3 boards I'm using are connected to the same network and get their power from the same USB hub. Why one of the boards works perfectly well, while the other keeps on disconnecting/reconnecting (after a long long time) is mind boggling. Is there something in the driver code that I can invoke, or in the menuconfig setting that I can change, which will cause the chip to attempt to reconnect immediately if wifi connection is dropped? Since I can't control what kind of a power supply another user utilizes, nor the wifi channel to which another user connects the board, I need to make sure I bolster my code with adequate safety mechanisms so the board continues to work effectively irrespective of a user's external environment.

I'm stuck at esp_transport_connect in transport.c - it calls another function _connect, but not sure where to find that to continue to debug the issue. Any direction is appreciated. Changing the log level in menuconfig to Debug doesn't give me anymore information to go off to debug this issue.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: How to check condition of ESP32-S3 wifi hardware?

Postby MicroController » Tue Sep 30, 2025 6:13 pm

You can listen for the WIFI_EVENT_,STA_DISCONNECTED event and start re-connecting immediately.
You probably also want to handle the "got IP" and "lost IP" events to start/stop any services which may require IP connectivity or be using sockets invalidated by the loss of the IP address.

Who is online

Users browsing this forum: meta-externalagent, Qwantbot, Semrush [Bot], YisouSpider and 5 guests