Situation
Currently the firmware assumes a battery to be lithium polymer with a working range of 3-4.2v.
Other chemistries that may be more suitable to remote nodes operate at different voltages. We could just use an INA board the get the voltage and/or current and expose it on another telemetry channel, however this is a bit clunky if your primary battery is not lithium as the UI in companions or the various client apps will show 0v.
Another related issue is that battery percentage is derived from the assumption that we have between 3 and 4.2v. Some of this may be happening in the companion apps (mobile/web), but the firmware can only return the millivolts for the battery which does not reflect the actual remaining capacity for any chemistry beyond lithium.
Proposal
There are at least two important things to change, one is the addition of battery percentage as well as voltage. Another being basic battery curves. Even as crude as lipo being 1.2v range, subtracting 3 from the mv reading then dividing by 1200 to get a percentage. Better still would be something like a map/dict with voltage:percentage relationships.
Things to do
If we go this route, we would need to cover the following:
First 3 tasks complete in #413
Situation
Currently the firmware assumes a battery to be lithium polymer with a working range of 3-4.2v.
Other chemistries that may be more suitable to remote nodes operate at different voltages. We could just use an INA board the get the voltage and/or current and expose it on another telemetry channel, however this is a bit clunky if your primary battery is not lithium as the UI in companions or the various client apps will show 0v.
Another related issue is that battery percentage is derived from the assumption that we have between 3 and 4.2v. Some of this may be happening in the companion apps (mobile/web), but the firmware can only return the millivolts for the battery which does not reflect the actual remaining capacity for any chemistry beyond lithium.
Proposal
There are at least two important things to change, one is the addition of battery percentage as well as voltage. Another being basic battery curves. Even as crude as lipo being 1.2v range, subtracting 3 from the mv reading then dividing by 1200 to get a percentage. Better still would be something like a map/dict with voltage:percentage relationships.
Things to do
If we go this route, we would need to cover the following:
getBattPercentageFirst 3 tasks complete in #413