Since I am running a Pico W from battery, I would like to lower the power usage by enabling sleep mode (not dormant).
I tried a few examples, like these:
https://ghubcoder.github.io/posts/awaking-the-pico/
viewtopic.php?p=2046237&hilit=sleep_hms#p2046237
Basically, what my program does is:
* connect to wifi netowrk
Loop:
* read some sensors (ADC, one-wire, cpu temp, battery voltage)
* blink led
* send measurements via wifi
* sleep_ms
This is working fine but not really lowering the power usage during sleep_ms.
I would like to replace that with the sleep mode to reduce power and also disable wifi during sleep.
When I trigger the sleep_goto_sleep_until, the code stops running and output over serial port (USB) stops printing. the led also stops blinking.
After the expected sleep time, de Pico does not recover. Led blinking does not resume, no wifi http requests, no outut on serial port.
I tried to exclude a few things like disabling stdio
pico_enable_stdio_uart(main 0)
pico_enable_stdio_usb(main 0)
or not using the wifi and just read sensors and print values.
But all my attempts so far resulted in the same thing, Pico goes to sleep and never wakes up.
I have not yet measured if the power usage actually goes down at this moment.
I'm guessing that something is not properly reinitialized after waking up resulting in a crash when resuming the activities, but not sure how to debug this.
Is there somewhere a more advances example that uses wifi, stdio and sleep mode?
Is there something that the referenced article/forum thread missed that is needed when combined with wifi?
I tried a few examples, like these:
https://ghubcoder.github.io/posts/awaking-the-pico/
viewtopic.php?p=2046237&hilit=sleep_hms#p2046237
Basically, what my program does is:
* connect to wifi netowrk
Loop:
* read some sensors (ADC, one-wire, cpu temp, battery voltage)
* blink led
* send measurements via wifi
* sleep_ms
This is working fine but not really lowering the power usage during sleep_ms.
I would like to replace that with the sleep mode to reduce power and also disable wifi during sleep.
When I trigger the sleep_goto_sleep_until, the code stops running and output over serial port (USB) stops printing. the led also stops blinking.
After the expected sleep time, de Pico does not recover. Led blinking does not resume, no wifi http requests, no outut on serial port.
I tried to exclude a few things like disabling stdio
pico_enable_stdio_uart(main 0)
pico_enable_stdio_usb(main 0)
or not using the wifi and just read sensors and print values.
But all my attempts so far resulted in the same thing, Pico goes to sleep and never wakes up.
I have not yet measured if the power usage actually goes down at this moment.
I'm guessing that something is not properly reinitialized after waking up resulting in a crash when resuming the activities, but not sure how to debug this.
Is there somewhere a more advances example that uses wifi, stdio and sleep mode?
Is there something that the referenced article/forum thread missed that is needed when combined with wifi?
Statistics: Posted by Darkness — Thu May 23, 2024 9:30 pm — Replies 0 — Views 32