If I call esp_deep_sleep_start() to put the ESP32-C6 to sleep the wifi won't reconnect after the processor wakes up again.
connect wifi
connect to cloud
wait
disconnect cloud
stop wifi
esp_sleep_enable_timer_wakeup(...)
esp_deep_sleep_start()
chip restarts after wake up
try to connect wifi fails
check wake reason, if equal 4 => try esp_restart()
connecting to wifi still fails
If I reset the chip by starting Monitor the chip connects to wifi again. (My com port is just connected to USB_DN and USB_DP so not connected to EN pin.)
ESP32-C6: Not able to connect to wifi after deep sleep
-
- Posts: 3
- Joined: Tue Nov 28, 2023 9:06 am
ESP32-C6: Not able to connect to wifi after deep sleep
- Attachments
-
- wifi_not_reconnecting.txt
- wifi log
- (29.56 KiB) Downloaded 163 times
-
- Posts: 3
- Joined: Tue Nov 28, 2023 9:06 am
Re: ESP32-C6: Not able to connect to wifi after deep sleep
No one has any experience with this?
Re: ESP32-C6: Not able to connect to wifi after deep sleep
I don't have experience of the issue you are having, and I'm very new to all of this (c and esp32c6's)... however the sntp_example has code very similar to yours where it logs on to wifi, gets the ntp, sets the initial time, puts the device in a timed deep sleep using esp_deep_sleep(1000000LL * deep_sleep_sec), wakes up and re-logs on to the wifi, gets the ntp, slews the time... and so on.
I've noticed a couple of possible bugs in that 1) the RTC_SLOW_ATTR static int boot_count = 0; (global varable) doesn't increment and that 2) there is massive clock drift of the RTC (seconds of drift for a 30 min sleep) which may be valid but feels "wrong" or could be down to chip revision or the dev board (ESP32-C6-DEVKITC-1-N4) or any multitude of things.
But despite those issues it seems to work as expected so it my be worth looking at that example and seeing what your program does differently. I should note also that I'm using the master branch (I'm only a hobbyist, so don't mind the moving target).
I've noticed a couple of possible bugs in that 1) the RTC_SLOW_ATTR static int boot_count = 0; (global varable) doesn't increment and that 2) there is massive clock drift of the RTC (seconds of drift for a 30 min sleep) which may be valid but feels "wrong" or could be down to chip revision or the dev board (ESP32-C6-DEVKITC-1-N4) or any multitude of things.
But despite those issues it seems to work as expected so it my be worth looking at that example and seeing what your program does differently. I should note also that I'm using the master branch (I'm only a hobbyist, so don't mind the moving target).
-
- Posts: 3
- Joined: Tue Nov 28, 2023 9:06 am
Re: ESP32-C6: Not able to connect to wifi after deep sleep
Thanks, Jon. ![😊](//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f60a.png)
I'll take a look at that.
![😊](http://cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f60a.png)
I'll take a look at that.
Who is online
Users browsing this forum: No registered users and 118 guests