a) I use this function to enter deep sleep:
Code: Select all
static void ICACHE_FLASH_ATTR gotoSleep(void) {
TESTP("Sleep %dS\n", sysCfg.updates);
system_deep_sleep_set_option(RF_DISABLED); // 4
system_deep_sleep(sysCfg.updates * 1000 * 1000);
os_delay_us(100);
}
However WiFi (and RF) still are enabled when the unit restarts. E.g. dhcp & ip address etc are reported. I'd have thought that with RF disabled WiFI wouldn't have been started.
b) I lieu of this I'm using modem sleep to minimise the current while doing the work. I use this code to enter modem sleep mode:
Code: Select all
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE);
wifi_fpm_open();
wifi_fpm_set_sleep_type(MODEM_SLEEP_T);
wifi_fpm_open();
wifi_fpm_set_wakeup_cb(fpm_wakup_cb);
wifi_fpm_do_sleep(0xFFFFFFF);
This works most of the time but every so often I get an exception when restarting:
scandone
del if0
usl
mode : null
fpm open,type:2 0
force slp enable,type: 2
reconnect
Fatal exception 28(LoadProhibitedCause):
epc1=0x4000df2f, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000033, depc=0x00000000
ÿ
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 28496, room 16
tail 0
chksum 0x39
load 0x3ffe8000, len 2113, room 8
tail 9
chksum 0x9b
ho 0 tail 9 room 7
load 0x3ffe8850, len 5884, room 15
tail 13
chksum 0x98
csum 0x98
Nb 0x4000df2f is in the memcmp routine
What am I missing? Any ideas please?