Closed wavesailor closed 2 years ago
I tested this using both CP 7.0.0 and 7.1.0; monitoring with a USB power monitor. In both cases, once the script goes into deep sleep I see about 200uA of current draw. I was not able to test using a battery.
I also tested the program above, using 7.0.0 and 7.1.0, and got about 230uA during sleeping. I then also tested using an extremely simple deep sleep example, from https://learn.adafruit.com/deep-sleep-with-circuitpython/alarms-and-sleep#timealarm-deep-sleep-3078700-7. Again, the sleep current was about 230uA. This value is typical, and is what we first saw when deep sleep was first introduced in CircuitPython, in 6.2.0.
I am testing with a Nordic PPK2 power monitor, which simulates a battery. When I am testing, there is nothing plugged in to the USB port.
I am not sure why you are seeing increased battery consumption. @wavesailor Are you powering this through the battery connector, with nothing plugged in to the USB port, or are you using the USB port for power?
This is strange now - I went back and reloaded the code from the Weather App in code.py and reset it. It seems to run fine now with the original code from the Weather App.
I have my own version where I added and changed a few things which is where I first discovered the problem. So I'm loading my code into code.py and testing it out. I'll give feedback over the next few days.
PS. What do you use to measure the current draw?
PS. What do you use to measure the current draw?
I am using this :https://www.adafruit.com/product/5048. That's what I used for measurements and the screenshots in https://learn.adafruit.com/deep-sleep-with-circuitpython/power-consumption.
I did some testing with a MagTag project using CircuitPython 7.1.1 and did not see this problem. I put an Extech 380942 clamp ammeter on the positive battery wire and saw current draw bounce around 80 - 120 mA while running, and then drop to about 2 mA while in deep sleep. I ran through several sleep/wake cycles and it never varied.
I am going to close this for now. @wavesailor If you can reproduce, please let us know and reopen.
@patja Thank you for testing!
@wavesailor I noticed your code shows a different method of going into deep sleep than I had seen documented. Is there a reason you are not using the alarm module as suggested here: https://learn.adafruit.com/deep-sleep-with-circuitpython/alarms-and-sleep
Just a suggestion, but maybe try using the alarm module and see if the behavior changes.
magtag.exit_and_deep_sleep()
is a convenience routine that ultimately calls the alarm
module exit_and_deep_sleep()
. I just reviewed the library code and it looks OK.
I redid Circuit python and libraries from scratch. This seemed to have solved my issue. Thanks
CircuitPython version
Code/REPL
Behavior
The code works BUT it does not seem to go into deep sleep so it does not take long for the battery to run flat.
I'm using the standard code from the Weather example: https://learn.adafruit.com/magtag-weather/
This all worked perfectly before I upgraded to the latest version of CircuitPython 7.1.0 and associated new libraries
Description
No response
Additional information
These are the libraries I have installed on the MagTag