Struggling to get stable WiFi connection on ESP32
Posted: 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!
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!