Deep sleep mode reset the board?
-
Hi everyone,
It's a simple question:
- Does the deep sleep mode reset the board? I' m asking this because I' m not sure if I have to store the variables into a SD card or not, because I understand that if the deep sleep reset the board, then the variables will be clean, isn't it?
Thanks.
-
Hi...i am a new user here. As per my knowledge Pin states can be remembered through deepsleep using pin.hold([hold]). Also you can do this in boot it start same as removing power ,you start from clear point.
-
Pin states can be remembered through deepsleep using
pin.hold([hold])
. That might be handy?
-
@papasmurph
You can do this in boot - it start same as removing power - you start from clear point.
Look below conversation -boot.py
andmain.py
are run again after wake up from deepsleep
-
@livius So that means that serial port bit rate, WiFi access etc must be set in main?
-
@papasmurph
No, at now it start from clear point
-
@RobTuDelft I guess a fair question is, will the hardware and system software "remember" whatever was set in boot.py?
-
@livius Okay, thanks for testing. It was my understanding, but it seems incorrect.
That also means the docs on this matter should be clearified:
Execution is resumed from the main script
That should say resumed from boot script in this case.
-
@RobTuDelft
i tested this and it is not true.
boot.py
is run after deepsleep>>> machine.deepsleep(500) I (2279094) wifi: state: run -> init (0) I (2279094) wifi: n:9 2, o:9 2, ap:9 2, sta:9 2, prof:9 I (2279095) wifi: station: 7c:dd:90:4c:b5:9f leave, AID = 1 I (2279097) wifi: n:9 0, o:9 2, ap:9 2, sta:9 2, prof:9 I (1499) wifi: wifi firmware version: 90b1b8b I (1500) wifi: config NVS flash: disabled I (1500) wifi: config nano formating: disabled I (1516) wifi: Init dynamic tx buffer num: 32 I (1516) wifi: wifi driver task: 3ffd5690, prio:23, stack:3584 I (1516) wifi: Init static rx buffer num: 10 I (1518) wifi: Init dynamic rx buffer num: 0 I (1522) wifi: Init rx ampdu len mblock:7 I (1526) wifi: Init lldesc rx ampdu entry mblock:4 I (1531) wifi: wifi power manager task: 0x3ffdaa4c prio: 21 stack: 2560 I (1537) wifi: sleep disable I (2526) wifi: wifi timer task: 3ffdbac8, prio:22, stack:3584 I (2529) wifi: Init ampdu: 0 I (2529) wifi: mode : softAP (24:0a:c4:00:6e:c3) boot 29.73803 100170.1 286.3341 main
-
@RobTuDelft
Then question is why? If it run onlymain.py
withoutboot.py
this would suggest that something initialized in boot.py is remembered - and I do not suppose that was the case but ..
-
It will start at main.py, so boot.py will be skipped. In that way it is different than a hard reset or power cycle, since that also runs boot.py.
-
@amartinez
Yes, it work like a reset