Bangle.js 2 - Battery always 100% #4742
Replies: 1 comment
-
Posted at 2021-12-26 by Poolitzer Hi, Im pretty sure you and the OP in this thread have a similar underlying hardware issue. Try doing the steps there to see what the reported voltages are, I assume that could help further troubleshooting this issue: http://forum.espruino.com/conversations/370718/ Posted at 2021-12-26 by user138058 Here's what I get for a sequence of E.getBattery() and analogRead(D3) calls: E.getBattery()
Posted at 2021-12-26 by TTBangler Just thought I'd better point out that I had very similar problems until I upgraded to the latest firmware version, 2v11. After upgrading to 2v11, the battery life has been much better (and stable). The firmware upgrade can be a little problematic, however, so be sure to read the posts related to updating the firmware if you run into any issues. Posted at 2021-12-26 by user138058 I've already updated the watch firmware to 2v11 last week and unfortunately it didn't help. Posted at 2021-12-27 by myownself I think this is a different issue to the above linked one. In the linked issue, a missing connection meant the voltage readings were small negative numbers. Your voltages are higher than usual. If the entire range of voltages on your device is higher than 0.3144 you will always get 100% all the time. Were the readings above near full charge or near empty? Getting readings from both ends might be interesting, but I am not a hardware guy and have no idea what if any hardware difference your device has. There have been at least 2 other threads about different voltages. If there is a lot of variation then perhaps determining the voltage range on a per device basis is necessary. Posted at 2021-12-29 by user138058 I've done some experimenting and it looks like my watch maxes out around 0.481 on the D3 when fully charged and shuts down around 0.375. These values are about 1.5x the values used to calculate battery percentage (0.246 and 0.3144). Not sure if my watch was built with the wrong value resistors for the voltage divider that feeds D3 or if the ADC is programmed incorrectly for that input. analogRead(D3) Fully charged:
Just prior to shutdown: 0.37524414062 Posted at 2021-12-29 by myownself That's the sort of thing I was expecting based on your previous message. @gfwilliams or one of the other hardware experts might be able to have a guess based on that what the cause is. My idea as to the solution, but someone else might have a better idea, would be writing the max and min voltage to storage and reading the value on boot. Max is easy, whereas Min would probably take a few cycles to get accurate. Posted at 2021-12-30 by user138058 I've worked around it for now by editing widbatpc.wid.js on the watch, replacing E.getBattery() with a call to a custom getBattery() function:
That should tide me over until @gfwilliams returns. Posted at 2021-12-30 by andrewg_oz You can make a global change to getBattery() by following the instructions at http://www.espruino.com/Bangle.js+Modification For me, it appears my high and low D3 readings are about 0.293 and 0.230 respectively, although I'm getting a sharp dropoff at about 0.255. I'm currently running some charge/discharge tests. The results can be seen at: https://docs.google.com/spreadsheets/d/1y57CRYdBSTXJgn4zsKDiUv6glE0sOzib2GQscZfg7Qo/edit?usp=sharing Posted at 2021-12-30 by user138058 Thanks for the tip! Posted at 2021-12-30 by andrewg_oz I've decided to go with:
and saved it as "getbattery.boot.js". Adjust "hi" and "lo" as required. Posted at 2022-01-05 by @gfwilliams Hi - thanks for looking into this and dumping the voltages. It sure looks like in your case the resistors fitted for the voltage divider are wrong. I have no idea how that one could have happened! Really sorry about that, although I don't think it should affect your Bangle in other ways... I think the best fix would be as @andrewg_oz has done. Installing the 'Custom Boot Code' app and pasting in:
should properly fix the problem for you. Posted at 2022-01-17 by user138058 @gfwilliams What kind of battery is in the Bangle.js 2? I read that that analog input is supposed to read 1/4 of the battery voltage, which means that a full battery is about 1.25V. That sounds about right for a NiMH battery. A lithium battery would be quite a bit higher (3.7V?) Posted at 2022-01-18 by @gfwilliams The Bangle's got a LiPo battery (so yes, around 3.7v, 4.2v when it's just come off the charger) The value from Resistor/capacitor values are notoriously bad though. Normally you get them with 10% tolerance, but they sell the 5% tolerance (and 2, and 1) for a premium - so if you use a 10% tolerance resistor you're basically guaranteed that it isn't the resistance you ordered, but is at least 5% higher or lower. With LiPo batteries, that 5% can actually make quite a big difference in what's reported. It might make sense to add a 'calibration' to the Bangle.js firmware that allows you to charge your Bangle up and then flatten it (just by turning everything on) and use that to come up with an accurate battery usage figure. Posted at 2022-01-18 by @fanoush
I never needed the
Then I do percentage based on volts e.g. like
But it doesn't matter much. Important is that only one measured value (maximum ever) seems to be enough.
so for you Posted at 2022-01-21 by user138058 @fanoush You're right, only hi should be needed. I'm now experimenting with trying to get getBattery to be more accurate since volts/% is not linear. My daughter noted that her watch was claiming 40% remaining battery shortly before it shut down. Based on a discharge graph shown here https://learn.adafruit.com/li-ion-and-lipoly-batteries/voltages, I've come up with the following:
Posted at 2022-03-05 by user140458 Hi Gordon, Posted at 2022-03-07 by @gfwilliams Hi, sorry about that. I think based on this and the few other folks having issues recently it makes sense for me to build the adjustment into the firmware. So please hang on for a few days and I'll try and release a new firmware that has it built in. Posted at 2022-03-07 by user140458 Cheers Posted at 2022-03-08 by @gfwilliams Ok, the cutting edge builds now have this functionality in now (and better mapping of the discharge curve). So, if you:
Then your battery percentage meter should then read perfectly. I'd be interested to see how this works out. Longer term I'll probably tweak the battery widget so when the charge cable is removed, if the Bangle has been on charge for 2+ hours it'll automatically set itself up. Posted at 2022-03-09 by johan_m_o @gfwilliams I'm charging my Bangle 2 right now and will test the new algorithm this week. Posted at 2022-03-16 by johan_m_o @gfwilliams The new battery monitor algorithm is working really well. I've been using my watch as regular for the past week and haven't charged it since my message above. The battery percentage has been much more "normal" without any sudden drops, but there is one quirk. For the first 5 days there was nothing special, although I did feel that the battery was depleting slightly faster than normal. By day 5 the level was down to 9% and usually I can get a week of battery life without issue. But, then the level stayed at 9% for more than 24 hours and have since started dropping very slowly. Now, almost exactly 7 days since taking the watch of the charger, and 48-ish hours since it hit 9% the level is down to 5%. Seems like the voltage levels in the algorithm needs a bit of tweaking... Posted at 2022-03-17 by @gfwilliams Did the watch start off after a full charge showing 100% on the battery meter, or was it showing less? And did you run that code while the Bangle was on charge, or when you'd taken it off? I guess it could be that the 'start voltage' that got set for your Bangle wasn't 100% correct. This is what I get when graphing the battery voltage (blue) over time alongside the battery percent reported (red) when I've left the LCD backlight on to flatten it down. The graph stops when the Bangle runs out of battery completely You can see the change in the blue line is tiny, and at least on my device I feel like I've done pretty much the best I can to get that line linear. Attachments: Posted at 2022-03-17 by johan_m_o The watch did start off at 100% and I ran the code immediately after taking the watch off the charger. And looking at your graph, the battery percentage you've recorded pretty much exactly matches what I saw (with the plateau at 9-ish percent and then another plateau at 0). That blue line looks spot on though, so perhaps this is something we'll have to live with. Posted at 2022-03-17 by @gfwilliams Ok, it's possible you may get a slightly better fit by running the code while the watch is still on the charger? But I think probably once it gets down to 10% you need to be thinking about getting it on charge anyway. While it might last a few days longer I imagine it could turn off pretty much any time if there was a high power draw (eg GPS) Posted at 2022-03-24 by Kosi2801 I have upgraded Gadgetbridge today to 0.66 and finally the battery history just fixed there. Firmware on my Bangle2 is 2v12.93. Attachments: Posted at 2022-03-24 by BillM The charge level reflects the voltage measured by the Bangle. This voltage will vary according to the current drawn by the Bangle. The voltage of the battery, measured by the Bangle, will vary according to load on the battery. Batteries have internal resistance so the voltage seen by the Bangle will decrease as the current drawn increases, according to Ohm's Law. So, the voltage will go up and down as you turn on and off various things such as GPS. Posted at 2022-03-25 by andrewg_oz On another thread somebody suggested reporting minimum voltages while discharging and maximum voltages while charging. That would greatly reduce those fluctuations seen under different loads. It would also better match the average persons expectations that the battery should never go up while not charging and never down while charging. Posted at 2022-03-28 by @gfwilliams Yes, temperature has an effect as well as the current load (eg if screen is on or off). Yes, we could add some kind of filtering on battery level, it's just whether in the scheme of things this is that big a deal. It can cause other problems too - maybe you turn GPS on and then suddenly your battery appears to have instantly lost 5% charge - and I wonder whether we'd see threads about that too. Posted at 2022-03-28 by rigrig It might be best to just stick with
Filtering will never be perfect, and then you end up having to explain it anyway, except now complicated by the filtering. And GadgetBridge could be a bit smarter about the battery level warnings, i.e. wait for the battery level to go above 40%, or the charger to be connected, before resetting the warning. Posted at 2022-04-01 by gfric Yesterday, my watch crashed, but had the backlight on. Within 90 minutes (the old time was frozen on the display), the battery was fom 60 to 10%. Posted at 2022-04-01 by @gfwilliams @gfric if it happens again, as a first port of call I'd switch to using the default set of apps. Since you're doing quite a lot of development work by the look of it, there could be a bug in some of the code on the Bangle. I guess the obvious one would be a memory leak... Posted at 2022-04-19 by gfric I set gadgetbridge to notify me when the battery drops below 30%. Howver, the watch reports non monotonious values like 32..29..31..28, so GB notifies me like mad. Posted at 2022-04-19 by johan_m_o @gfric You can turn off the low battery notification in the Android notification settings for Gadgetbridge. So you won't have to turn off Bluetooth... That suggestion sounds like a good idea though, but it might be on the radar already since I'm pretty sure I've seen this brought up before. Or maybe I'm misremembering. Posted at 2022-04-20 by @gfwilliams Yes, there was some discussion about this before, but it was decided that actually messing with the reported battery value might cause more problems (like "why did my battery drop by 5% when I enabled GPS and then not move for 6 hours"). I'd be totally up for adding this filtering to either Gadgetbridge, or to the 'Android Integration' app though? Posted at 2022-04-20 by gfric Yes. Just report it filtered to gadgetbridge. Apps must be able to query the true value. Posted at 2022-05-23 by @gfwilliams I've just added calibration to Settings so in a day or so you'll be able to go to Posted at 2022-05-23 by user140458 Hi Gordon, Posted at 2022-05-23 by @gfwilliams @user140458 if you're on version 2v13, install the latest settings from the development app loader at https://espruino.github.io/BangleApps/, put the Bangle on charge for a few ours so you're very sure it's full, then do The functionality's been available for a while but I only just added an easy option to the default settings app Posted at 2022-05-23 by user140458 Cheers, charging up now and will try it out tonight Posted at 2022-05-24 by user140458 Hi Gordon, Posted at 2022-05-25 by @gfwilliams Great, glad that solved it for you! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-12-26 by user138058
I received my Bangle.js 2 a couple weeks ago. I was giving it as a Christmas present, so I didn't do much with it other than charge it fully and install the latest software/apps including the newest firmware update. Since yesterday, it has mysteriously shut down several times and would not power back up until connected to the charger. Once on the charger, it will immediately boot up and the battery shows as 100% charged. At that point, if you disconnect it from the charger, it will run for a few minutes and then shut down again. I finally figured out that the indicated battery level always shows as 100% even when it's almost discharged. I charged it for a couple of hours and it has run overnight without shutting down (but the battery still shows 100%). Has anyone else seen this behavior?
Beta Was this translation helpful? Give feedback.
All reactions