Closed
Description
I've followed the steps in the ESP8266 Non-OS SDK API Reference manual (v2.0.0,2016) page 97 (just checked no change in v3.0.1 of the manual)
Running on SDK 2.2.1, Core 2.5.2
Board ESP-12E
Serial.println("going to sleep");
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE); // set WiFi mode to null mode.
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T); // light sleep
wifi_fpm_open(); // enable force sleep
wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1); // Set wakeup callback
wifi_fpm_do_sleep(50*1000000);
delay(1000);
Serial.println("Awake")
What I see is the awake message 1 second after the going to sleep message. (I've tried with delays of 1,2,5 or 10s just incase it was taking time to sleep)
- The current consumed is 14mA.
- The callback function is never triggered.
- The wifi_fpm_do_sleep() returns a status of 0, indicating success.
- I have no timers enabled.
- If I set the _do_sleep time as 0xFFFFFFF then the current does drop to < 1mA
- If I add delays of 500ms between all the steps (to allow each instruction such as serial print to complete), then it still doesn't work
- if the delay(1000) function is made longer than the wakeup time, then the callback function is triggered (but the current doesn't drop below 14mA)
Deep sleep works, the current drops to almost 0.
Modem sleep works.
I can't make force Light sleep work at all. The RF should be off, the CPU unclocked.
Does force light sleep work with any time other than 0xFFFFFFF? am I doing something daft?