Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add voltage command #1

Open
scottleibrand opened this issue Oct 15, 2017 · 2 comments
Open

Add voltage command #1

scottleibrand opened this issue Oct 15, 2017 · 2 comments

Comments

@scottleibrand
Copy link
Contributor

In order to integrate with OpenAPS and allow us to safely shut down the Pi when voltage drops too low, it would be good to have a command-line tool that works like the voltage command from https://github.com/cjo20/EdisonVoltage, specifically in outputting json like:

root@edison-eb3 ~/myopenaps # ~/src/EdisonVoltage/voltage json batteryVoltage battery
{"batteryVoltage":3815, "battery":64}

It looks like this should be doable using the voltage library that's already used by openaps-menu (https://github.com/openaps/openaps-menu/tree/master/lib/voltage).

@bnielsen1965
Copy link
Collaborator

I just pushed a commit that adds in a unix socket that will be used to execute commands such as reading the battery voltage.

The commit also includes the read_voltage command and a bash script that will produce a backward compatible battery voltage response.

I.E.
root@raspberrypi:/home/pi/openaps-menu/scripts # ./getvoltage.sh
{"batteryVoltage":4080,"battery":96}

Try it out when you have a chance and if it works as expected the next step is to develop accurate battery percent readings.

@bnielsen1965
Copy link
Collaborator

The battery code now includes a configuration file to define the discharge curve and will show percentage of battery remaining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants