Skip to main content

UPS Node

This is a simple I2C node that monitors the battery level of the UPS device:

upsnode.py
loading...

This node schedules the get_battery_status method to run every 30 seconds. This method reads data from the UPS I2C device and calculates the battery percentage reported by the device. This is then published by the event ups-battery-percent:

upsnode.py
loading...

This percentage is also checked against a threshold value (from configuration). If the percentage is below the threshold, an under-voltage-detected event is raised to initiate a graceful shutdown of the robot.