Monitor for the x728 Pi UPS. This will perform a safe shutdown after a specified timeout once the external is cut. This is tested,and developed using Raspbian on a Raspberry Pi 4. Currently it also works on a Raspberry Pi 3b+. However this support will not be guaranteed.
Steps:
- Enable the ds1307 overlay, and i2c in the /boot/config.txt
- add ds1307 to the dtoverlay line
- dtoverlay=vc4-fkms-v3d,ds1307
- Add/uncomment dtparam=i2c_arm=on.
- reboot
- Run sudo ./setup.sh
- run with sudo ./x728-monitor.py or sudo ython3 x728-monitor.py
- Optional, To start as a servive. Stop any running instance, and run sudo systectl start x728Monitor.service or sudo service x728Monitor.service start
To disable the service to prevent starting at boot, run sudo systemctl disable x728Monitor.service or sudo service x728Monitor.service disable
- Config file support.
- Allowing setting of board version.
- Configurable shutdown time.