Start wifi network after force sleep

rith87

Start wifi network after force sleep

Postby rith87 » Thu Nov 03, 2016 11:13 am

I'm having difficulty trying to start a wifi network after a force sleep. Specifically, I'm trying the following sequence of events:

1. Sleep wifi

Code: Select all

    wifi_set_opmode(NULL_MODE);         
    wifi_fpm_set_sleep_type(MODEM_SLEEP_T);
    wifi_fpm_open();
    wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);
   

2. Wake up wifi

Code: Select all

    wifi_fpm_do_wakeup();
    wifi_fpm_close();


ESP returns:

Code: Select all

fpm wk err: pm is open
fpm close 3


3. Start wifi network

Code: Select all

    wifi_set_opmode(STATIONAP_MODE);
   


ESP returns:

Code: Select all

mode : sta(5c:cf:7f:16:59:b6) + softAP(5e:cf:7f:16:59:b6)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100


However, the callback from wifi_set_event_handler_cb() is never called. And the ESP does not host the wifi network. Also, even if I add a system_restart() between (2) and (3), the ESP still fails to host the wifi network. The ESP hosts the wifi network fine if the force sleep code is omitted on a hard reset.

Any ideas?

Who is online

Users browsing this forum: No registered users and 59 guests