So, I’m following the native ESP8266 SDK to use Light Sleep on Mongoose OS but I’m not managing to make it works in a specific time. The function enter_light_sleep() is at the end.
If LIGHT_SLEEP_TIME is 0xFFFFFFF (maximum from SDK), it enters on Light Sleep consuming 1.8 mA but won’t call wake_cb and not wake up unless I use a GPIO.
If LIGHT_SLEEP_TIME is 10s (10 *1000* 1000), it will wake up after 10s and call my wake_cb function but it will consume 16~18 mA while sleeping.
Any ideas?
static void enter_light_sleep(void *arg)
{
mgos_uart_printf(UART_NO, "Enter_light_sleep \r\n");
wifi_set_opmode(NULL_MODE);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
wifi_fpm_open();
wifi_fpm_set_wakeup_cb(wake_cb);
wifi_fpm_do_sleep(LIGHT_SLEEP_TIME);
(void)arg;
}