Statistics: Posted by tve — Wed Sep 23, 2015 11:46 pm
Code:
void wifi_fpm_set_wakeup_cb(void (*fpm_wakeup_cb_func)(void));
Code:
//sleep over.
void fpm_wakup_cb_func1(void)
{
wifi_fpm_close(); //disable sleep function
wifi_set_opmode(STATION_MODE); //set wifi mode to station mode
wifi_station_connect(); //connect ap
}
void user_func(...)
{
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE); //set wifi mode to null mode.
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T); //set force sleep type, clsoe rf&cpu
wifi_fpm_open(); //enable force sleep fucntion
wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1); //Set fpm wakeup callback function
wifi_fpm_do_sleep(10*1000); // do sleep
...
}
Statistics: Posted by ESP_Faye — Wed Sep 23, 2015 3:45 pm
Code:
wifi_station_disconnect();
wifi_set_opmode_current(NULL_MODE);
os_delay_us(1000);
os_printf("Sleep!\n");
os_delay_us(600);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
wifi_fpm_open();
int8_t err = wifi_fpm_do_sleep(100*1000);
if (err != 0) os_printf("Sleep error: %d\n", err);
os_printf("Back!\n");
wifi_set_opmode(STATION_MODE);
wifi_station_connect();
Code:
ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
fpm close 3
pm open phy_2,type:1 0 0
Sleep!
force slp enable,type: 1
pm close 7 0 2131886/3837583
fpm open,type:1 0
Sleep error: 0
Back!
fpm wk err: pm is open
fpm wk err: pm is open
fpm wk err: pm is open
f r0, fpm wk err: pm is open
fpm wk err: pm is open
fpm wk err: pm is open
fpm wk err: pm is open
scandone
state: 5 -> 0 (0)
fpm wk err: pm is open
fpm wk err: pm is open
fpm wk err: pm is open
rm 0
fpm wk err: pm is open
fpm wk err: pm is open
del if0
usl
mode : null
Wifi disconnected from ssid tv▒ 뫫 ▒WV▒▒▒
R֮▒k▒ū+▒W$%NJC▒▒LC▒▒pm,w1
wifi status=255
Statistics: Posted by tve — Wed Sep 23, 2015 12:33 pm
Code:
force slp enable,type: 1
fpm open,type:1 0
Code:
Wifi connected to ssid tve-home, ch 1
ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
fpm close 3
pm open phy_2,type:1 0 0
Code:
state: 5 -> 0 (0)
rm 0
pm close 7 0 1381340/2756243
del if0
usl
mode : null
Sleep!
force slp enable,type: 1
Sleep error: -2
Back!
mode : sta(18:fe:34:a6:e8:8f)
add if0
Code:
ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
Wifi got ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
pm open phy_2,type:1 0 0
Sleep!
force slp enable,type: 1
pm2 684
▒@▒rjrA(▒
Code:
os_printf("Sleep!\n");
os_delay_us(600);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
int8_t err = wifi_fpm_do_sleep(100*1000);
Statistics: Posted by tve — Wed Sep 23, 2015 12:26 pm
Code:
// before entering light sleep we have to turn off wifi
wifi_station_disconnect();
wifi_set_opmode_current(NULL_MODE);
os_delay_us(1000);
// print a message and sleep enough for the uart to send the characters out
os_printf("Sleep!\n");
os_delay_us(600);
// enter sleep mode
int8_t err = wifi_fpm_do_sleep(10*1000);
if (err != 0) os_printf("Sleep error: %d\n", err);
// and here we're back?
os_printf("Back!\n");
wifi_set_opmode(STATION_MODE);
wifi_station_connect();
Statistics: Posted by tve — Wed Sep 23, 2015 11:58 am
Code:
Wifi got ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
14094> wifi status=5 tick=0
fpm close 3
pm open phy_2,type:1 0 0
18094> wifi status=5 tick=2
Sleep!
pm2 684
Code:
ip:192.168.1.113,mask:255.255.255.0,gw:192.168.1.1
state: 5 -> 0 (0)
Code:
wifi_station_disconnect();
wifi_set_opmode_current(NULL_MODE);
wifi_fpm_set_sleep_type(XXX);
wifi_fpm_open();
Statistics: Posted by ESP_Faye — Wed Sep 23, 2015 11:41 am
Code:
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 80MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
r▒9l▒▒^!!!▒
** esp-pico master - 2015-09-21 23:01:49 - development
sleep enable,type: 1
force slp enable,type: 1
fpm open,type:1 0
Reset cause: 3=soft wdt
exccause=4 epc1=0x4021aace epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0
Flash map 4MB:512/512, manuf 0xEF chip 0x4016
** esp-pico ready
mode : sta(18:fe:34:a6:e8:8f)
add if0
f r-1, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
2094> wifi status=1 tick=0
4094> wifi status=1 tick=0
6094> wifi status=1 tick=0
state: 5 -> 2 (fa0)
rm 0
Wifi disconnected from ssid tve-home, reason group_key_update_timeout (15)
reconnect
state: 2 -> 0 (0)
f r-1, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
8094> wifi status=2 tick=0
connected with tve-home, channel 1
dhcp client start...
Wifi connected to ssid tve-home, ch 1
10094> wifi status=2 tick=0
12094> wifi status=2 tick=0
ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
Wifi got ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
14094> wifi status=5 tick=0
16094> wifi status=5 tick=1
fpm close 3
pm open phy_2,type:1 0 0
18094> wifi status=5 tick=2
20094> wifi status=5 tick=3
22094> wifi status=5 tick=4
Sleep!
pm2 684
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 80MHz
SPI Mode : QIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
r▒9l▒▒^!!!▒
** esp-pico master - 2015-09-21 23:01:49 - development
sleep enable,type: 1
force slp enable,type: 1
fpm open,type:1 0
Reset cause: 3=soft wdt
exccause=4 epc1=0x4021aace epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0
Flash map 4MB:512/512, manuf 0xEF chip 0x4016
Statistics: Posted by tve — Tue Sep 22, 2015 2:30 pm
Statistics: Posted by ESP_Faye — Mon Sep 21, 2015 3:28 pm
Code:
wifi_station_disconnect();
wifi_set_opmode_current(NULL_MODE);
Statistics: Posted by tve — Mon Sep 21, 2015 3:19 pm
Code:
static void ICACHE_FLASH_ATTR prSleepTimerCb(void *arg) {
os_printf("Sleep!\n");
os_delay_us(600); // time for "Sleep!" to be printed at 115200 baud
int8_t err = wifi_fpm_do_sleep(1000*1000);
if (err != 0) os_printf("Sleep error: %d\n", err);
os_printf("Back!\n");
}
void user_init(void) {
...
os_timer_disarm(&prHeapTimer);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
wifi_fpm_open();
os_timer_disarm(&prHeapTimer);
os_timer_setfn(&prHeapTimer, prSleepTimerCb, NULL);
os_timer_arm(&prHeapTimer, 20000, 0);
...
}
Code:
141> force slp enable,type: 1
141> fpm open,type:1 0
...
8831> connected with tve-home, channel 1
8831> dhcp client start...
11605> ip:192.168.0.114,mask:255.255.255.0,gw:192.168.0.1
15125> Wifi check: mode=STA status=5
17948> fpm close 3
17948> pm open phy_2,type:2 0 0
20141> Sleep!
20142> pm2 684
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
Code:
40221aa8 <fpm_do_sleep>:
fpm_do_sleep():
40221aa8: f0c112 addi a1, a1, -16
40221aab: 006122 s32i a2, a1, 0
40221aae: 016102 s32i a0, a1, 4
40221ab1: ff3485 call0 40220dfc <pm_is_open>
40221ab4: 011216 beqz a2, 40221ac9 <fpm_do_sleep+0x21>
40221ab7: fe7721 l32r a2, 40221494 <fpm_attach+0x1e4>
40221aba: fe7731 l32r a3, 40221498 <fpm_attach+0x1e8>
40221abd: aca242 movi a4, 0x2ac
40221ac0: 7d5901 l32r a0, 40201024 <_irom0_text_start+0x14>
40221ac3: 0000c0 callx0 a0
40221ac6: ffff06 j 40221ac6 <fpm_do_sleep+0x1e>
40221ac9: fd7941 l32r a4, 402210b0 <pm_get_idle_wait_time+0x44>
40221acc: 4408 l32i.n a0, a4, 16
40221ace: e27c movi.n a2, -2
40221ad0: 02e0d7 bbsi a0, 13, 40221ad6 <fpm_do_sleep+0x2e>
40221ad3: 0001c6 j 40221ade <fpm_do_sleep+0x36>
...
Statistics: Posted by tve — Mon Sep 21, 2015 3:06 pm