What happened after my last reply 1 month ago? Did it turn out just to be a dead battery?
What worries me is there's a pretty regular dip on battery voltage (twice a day?) that makes it seem like some code is running that's using up the battery. Of course it could just be the temperature of the cell affecting it, but if so you'd expect it to repeat once a day, not twice.
The overall shape of the graph is what you'd expect - the percentage from getBatteryPercentage is pretty crude and is based off the battery voltage. It varies depending on manufacturer so it's not accurate, but when the battery gets mostly flat the voltage tends to drop off a cliff (google images for 'cr2032 discharge curve') and Puck.js doesn't take account of that in the calculations.
Is it possible that you have some PC or phone that is attempting to connect to the device? if you have no code on there then that is one option - having a connection open wakes the device up ~25 times a second which really hurts the power consumption, and can run it down in a matter of days.
But if it's not responding at all - given the troubles so far - I'd suggest trying another battery. Maybe the batch of replacement batteries you got are a bit dodgy. Doing the 5 blink reset will erase flash which uses a lot of battery power, so if it was low on battery than that could have pushed it over the edge.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
What happened after my last reply 1 month ago? Did it turn out just to be a dead battery?
What worries me is there's a pretty regular dip on battery voltage (twice a day?) that makes it seem like some code is running that's using up the battery. Of course it could just be the temperature of the cell affecting it, but if so you'd expect it to repeat once a day, not twice.
The overall shape of the graph is what you'd expect - the percentage from
getBatteryPercentage
is pretty crude and is based off the battery voltage. It varies depending on manufacturer so it's not accurate, but when the battery gets mostly flat the voltage tends to drop off a cliff (google images for 'cr2032 discharge curve') and Puck.js doesn't take account of that in the calculations.Is it possible that you have some PC or phone that is attempting to connect to the device? if you have no code on there then that is one option - having a connection open wakes the device up ~25 times a second which really hurts the power consumption, and can run it down in a matter of days.
There's some info on stopping unwanted connections here: http://www.espruino.com/Puck.js+Security
But if it's not responding at all - given the troubles so far - I'd suggest trying another battery. Maybe the batch of replacement batteries you got are a bit dodgy. Doing the 5 blink reset will erase flash which uses a lot of battery power, so if it was low on battery than that could have pushed it over the edge.