Skip to content

Instantly share code, notes, and snippets.

@GAS85
Last active October 16, 2018 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GAS85/a1b0773f7da23f0e79b5ff5ad5f1df72 to your computer and use it in GitHub Desktop.
Save GAS85/a1b0773f7da23f0e79b5ff5ad5f1df72 to your computer and use it in GitHub Desktop.
Cubietruck + Battery + Armbian - shutdown server if critical battery level reached. Just added it to /etc/cron.hourly

MOVED TO https://github.com/GAS85/cubietruck

I create a script that will try to send Warning Email and and shutdown the system as soon as it goes below 10%.

I put it in cron hourly and script should automatically check and do loop if battery discharging and below e.g. 80%.

E-Mail is needed because last time I did not know that my power supply died and I did not know why sever stopped. This version is also producing logs that could be checked after cubietruck fails. That helps for trouble shooting, e.g. to find out that power supply could not produce enough current to charge battery.

Log output example:

Tue Oct 16 10:01:03 CEST 2018 - Ok. Battery Full - 100% left. AC is online with current 0.222 A. Battery health is Good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment