ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-03T11:13:12+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2994 2016-11-03T11:13:12+08:00 2016-11-03T11:13:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2994&p=10394#p10394 <![CDATA[Start wifi network after force sleep]]>
1. Sleep wifi

Code:

    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:

    wifi_fpm_do_wakeup();
    wifi_fpm_close();


ESP returns:

Code:

fpm wk err: pm is open
fpm close 3


3. Start wifi network

Code:

    wifi_set_opmode(STATIONAP_MODE);
   


ESP returns:

Code:

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?

Statistics: Posted by Guest — Thu Nov 03, 2016 11:13 am


]]>