Replies: 4 comments 1 reply
-
What is your |
Beta Was this translation helpful? Give feedback.
-
It would be really helpful if you could share more code. Just running
Are you able to repro this specific issue on the official firmware? |
Beta Was this translation helpful? Give feedback.
-
The sys.path is ['', '/lib'] I don't have any frozen code but I presume github coder would have used some when he tweaked '1.17.0', version='v1.17 on 2021-09-02 (GNU 10.2.0 MinSizeRel) to release='1.17.0', version='v1.0-pico-deepsleep-1-gaec7edbfc-dirty on 2021-11-06 The full line the error occurs on is
When I removed the picosleep import from the program, made a new .mpy & tried to run it on the original 1.17.0 firmware I got the same NameError result for the second instance of 'from machine import WDT' so looks like whatever the .mpy problem is it's unrelated to the picosleep mods. I guess I was so used to dealing with blowback from the picosleep mods I jumped the gun & assumed this was too. |
Beta Was this translation helpful? Give feedback.
-
Unless you run a different firmware, machine.deepsleep() runs through a reset cycle. The deepsleep() code first executes machine.lightsleep() and then calls machine.reset().
|
Beta Was this translation helpful? Give feedback.
-
I've got a program on a rpi pico with 2 'from machine import WDT' lines in it. The first one at the start runs once only to provide a watchdog from the getgo & the second one, in the body loop, runs each time the program wakes up from a deepsleep (the pico resumes from where it left off after a deepsleep rather than rebooting like the esp32).
It's been working OK as a boot.py from powerup so on a whim I decided to convert it to a code.mpy & run it with a 1 line boot.py 'import code' . To my great surprise it crashed with 'NameError: name machine isnt defined' for the second 'from machine import WDT'.
I probably should just walk away from this. The micropython version I'm using was tweaked for me to give 1mA deepsleep current on the pico & has some challenging behaviours (like loosing the USB after the first wakeup & continuing to run the watchdog through deepsleeps) but I've been able to implement work arounds for all of them so now I've got gamblers lament "maybe just one more go?"
Anyway very interested to hear from anybody with some thoughts on how machine can become undefined because I got nuthin'.
Beta Was this translation helpful? Give feedback.
All reactions