Struggling to get stable WiFi connection on ESP32

Palatsch
Posts: 2
Joined: Fri Apr 29, 2022 9:13 am

Struggling to get stable WiFi connection on ESP32

Postby Palatsch » Fri Apr 29, 2022 10:15 am

Dear ESP community,

Began trying to convert to ESP32 from Arm M4 some days ago mainly because of i wanted to have WiFi capabilities.
I have a really old Wemos Lolin D32 and a brand new ESP32S3 Feather from Adafruit.

My project is battery powered so basically the logic of my program is:
Connecting to Blynk, reading an analog pin, sending the value to Blynk and enter deep sleep for 1 minute with a timer wake source.

I came up with a working code quite easily, however the Lolin D32 board just hangs after only 1-2 hours. The Adafruit ESP32S3 board is somewhat better it regularly works for about 6-8 hours, but also that board hangs regularly. Did my search i find many other people complaining on unreliable WiFi on ESP32. Digged through some coding tips they provide, have put some counter to blocking parts and let the board restart if the counter reaches a limit (i.e. while not connected counter++ if counter>100 restart), also call WiFi.disconnect(true,true) before going to sleep mode... but nothing seems to prevent hang ups.

Being new on ESPs i most probably miss things, am happy to get some info on:
- Where all this might have its roots? In Blynk code or in the Arduino core for ESP32?
- Shall i rather prefer ESP-IDF instead of Arduino core for ESP32? Would IDF work more reliably with WiFi?
- How could i get detailed debug info on this issue?

Any info/idea is much appreciated!

ESP_Sprite
Posts: 9723
Joined: Thu Nov 26, 2015 4:08 am

Re: Struggling to get stable WiFi connection on ESP32

Postby ESP_Sprite » Fri Apr 29, 2022 12:02 pm

That is very hard to say from the info you've given. Do you have more info on the 'hangs' part, as in, can you leave a serial connection connected to check what the ESP outputs at that time?

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: Struggling to get stable WiFi connection on ESP32

Postby alanesq » Wed May 11, 2022 7:15 am

I have experienced problems with the wifi timing out if not used for a while,
I fixed this with the command: WiFi.setSleep(false);

Who is online

Users browsing this forum: No registered users and 48 guests