Bangle.js2 E.getBattery() never reaches 100 %

Posted on
  • Hi,
    I have an app user complaining about not being able 'to charge the Bangle.js 2 to 100%'.
    After some testing with 3 Bangles, I must conclude he's right : the 3 parts report 93..95 % after one day of charging.

    One of those units outputs values as follows :

    >process.version
    ="2v10.89"
    >E.getBattery()
    =94
    >NRF.getBattery()
    =3.28623046874
    > 
    

    (I studied Espruino's 'jswrap_bangle.c', but there I see low and high values of 0.246V and 0.32V, which I don't understand.)

    So my question : is there a better way to detect the 'end-of-charge' condition ?

    (I know I can cheat and introduce a correction factor for the 'E.getBattery' result, but...)

  • Ahh, thanks! That's interesting - it looks like the 'full charge' voltage condition isn't quite right.

    If you run analogRead(D3) you can see what the actual value returned is (this is 0..1, so it's more like ~1v). I'll try with a unit here, but right now I see 0.3181 with it on charge (although it wasn't quite a full charge before).

    I think there's a distinct possibility I rounded 0.3181(ish) to 0.32, without really considering that it wouldn't quite hit 100%.

    is there a better way to detect the 'end-of-charge' condition ?

    Not really. You may be able to detect when the 'charging' status changes (I can't recall if that works on Bangle.js 2 or not) but you can't tell if that's because it was full or it was unplugged.

    I think the best thing for me to do is to update the firmware, but obviously that's not ideal for the devices you have in the field right now. You could do this in JS in the mean time:

    if (process.version=="2v10.89") {
      E.getBattery = (oldGetBattery=>()=>Math.min(oldGetBatte­ry()*105,100))(E.getBattery);
    }
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js2 E.getBattery() never reaches 100 %

Posted by Avatar for jgw @jgw

Actions