Python3 script to show info about APC UPSes on a e-Paper display and a RPi Zero W.
- Raspberry Pi Zero W with Raspberry Pi OS installed (former name was Raspbian)
- Waveshare e-Paper 2.13inch Display
Before you start, make sure you have the SPI interface enabled on your Raspberry
sudo raspi-config
Choose Interfacing Options > SPI > Yes to enable SPI interface
sudo reboot
- Status
- Load
- Charge
- Time left
- Voltage
- Firmware
- Serial
- Model
-
Install the required packages to build BCM libraries:
sudo apt-get install gcc make libc-dev
-
Download and install BCM2835 libraries:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz tar zxvf bcm2835-1.60.tar.gz cd bcm2835-1.60/ sudo ./configure sudo make sudo make install
-
Install python3 and the required libraries and modules:
apt-get install python3 python3-pip python3-pil python3-numpy python3-rpi.gpio python3-smbus wiringpi python3 -m pip install spidev python3 -m pip install RPi.GPIO python3 -m pip install setuptools python3 -m pip install apcaccess
-
Now you can clone this repository, open the file upsdisplay.py and modify "YOUR_RASPI_IP" with the IP address of your Raspberry Pi.
-
To run the script in background execute:
python3 upsdisplay.py&
- Apcaccess python library
- e-paper Display library
- Tested with an APC Back-UPS XS 700U and a Pi Zero W Rev1.1
This project has been realized for personal use. I am not a developer, it is the first application I write in Python and it may not be optimized or formally correct.