⚡ New Power Usage Estimation feature! #36
gfwilliams
announced in
News
Replies: 2 comments
-
Posted at 2024-04-25 by @thyttan A Bangle.js app that inform about lasting high energy draw could certainly be useful. I recently left GPS on unwittingly for example. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Posted at 2024-04-26 by @gfwilliams There is already https://banglejs.com/apps/?id=powermanager which actually does a very similar thing (just using JS) - it's got various warnings you can enable - I'm not sure if one is for high power usage over a long time but I guess it could be added. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2024-04-25 by @gfwilliams
It's been a common issue that especially on battery powered devices like Puck.js and Bangle.js it's very difficult to know how long your device is going to last on a battery, or if you've got your device into a state where it's draining the battery fast. With Puck.js it is at least possible to attach a current meter to measure power consumption, but with Bangle.js you can't even do that.
I've added a function called
E.getPowerUsage()
to the latest Cutting Edge that should go a long way towards helping with this (when 2v22 is released it'll be in there too). It's most useful on the Official Bluetooth Espruino devices.When called, it returns an object with a field called
total
which is the total estimated power usage in microamps. There's also an object calleddevice
which lists all devices Espruino thinks are drawing power:On Bangle.js and Puck.js where the battery is about 200mAh (or 200,000uAh) you can do
200000/E.getPowerUsage().total
to get the expected battery life in hours.Bear in mind this is very much an estimate - we are able to check average CPU usage and get a reasonably accurate figure, as well as for Bluetooth, but other sensors (GPS, accelerometer, etc) are estimated based on the current state... If you turn on GPS for a minute every hour and only check
E.getPowerUsage()
during that hour when the GPS is off, it will return 0 for GPS power usage.Even so, hopefully this will be a handy tool for Espruino users!
Beta Was this translation helpful? Give feedback.
All reactions