petterreinholdtsen / battery-status Goto Github PK
View Code? Open in Web Editor NEWSystem to regularly collect battery status on Debian based systems.
License: GNU General Public License v2.0
System to regularly collect battery status on Debian based systems.
License: GNU General Public License v2.0
the python script i wrote is still in the package, but not the default and worse, it's actually broken now:
$ battery-log | ./src/battery-stats-graph
loading CSV file <open file '<stdin>', mode 'r' at 0x7f11f0fe10c0> with builtin CSV module
building data array
guessing expiry
Traceback (most recent call last):
File "./src/battery-stats-graph", line 190, in <module>
death = guess_expiry(data[full], data['timestamp'], zero)
File "./src/battery-stats-graph", line 162, in guess_expiry
fit = np.polyfit(data[full], data['timestamp'], 1)
File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 581, in polyfit
c, resids, rank, s = lstsq(lhs, rhs, rcond)
File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 1867, in lstsq
0, work, lwork, iwork, 0)
ValueError: On entry to DLASCL parameter number 4 had an illegal value
my guess is that it wasn't adapted to the new CSV structure, or not correctly. it fails at guessing the death of the battery, above...
/usr/share/battery-stats/collect-csv prints errors when no batteries are connected, resulting in cron mail clutter like
-----8<------
Subject: Cron root@localhost if [ -x /usr/share/battery-stats/collect-csv ]; then /usr/share/battery-stats/collect-csv ; fi (failed)
/usr/share/battery-stats/collect-csv: line 86: cd: BAT*: No such file or directory
-----8<------
battery-status-collect will collect statistics for all batteries that are present on the system, however battery-status-graph assumes that there is only one battery in the log file.
It would be great if battery-status-graph was able to generate separate graphs for each different battery.
for some reason, this software cannot read the files created from the older "battery-status" version. i get this error:
$ /usr/share/battery-stats/battery-stats-graph /var/log/hjemmenett-battery-status.log
loading CSV file <open file '/var/log/hjemmenett-battery-status.log', mode 'r' at 0x7fba9dc6e420> with builtin CSV module
Traceback (most recent call last):
File "/usr/share/battery-stats/battery-stats-graph", line 171, in <module>
data = parse_csv()
File "/usr/share/battery-stats/battery-stats-graph", line 74, in parse_csv_builtin
if '' == row[f]:
KeyError: 'charge_now'
is there a way to convert the files over? my original python version still works:
$ ~/src/battery-status/battery-status-graph.py /var/log/hjemmenett-battery-status.log
loading CSV file <open file '/var/log/hjemmenett-battery-status.log', mode 'r' at 0x7fe9238b6420> with builtin CSV module
building data array
guessing expiry
this battery will reach end of life (5%) in 904 days, 23:22:16.832222, on 2018-09-15 16:08:27.770046
building graph
drawing on tty
... and crap, it looks like my battery is already at 80% effective capacity!
for some reason, suspend/resume hooks don't run here and the data doesn't get collected then.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.