Communicating with the UPiS UPS from RasPlex

Standard

As part of my recent media centre build, I wanted to have a Raspberry Pi running RasPlex power down gracefully when power was removed. The UPiS Advanced UPS to the rescue! Despite the terrible name, this UPiS comes complete with a battery and UART so that the power status can be monitored from the Raspberry Pi.

The script is straightforward enough — it queries the UPiS every few seconds. If it detects that power is removed, it shuts itself down and triggers the “file sfe shutdown” on the UPiS. After 30 seconds or so, with everything safely shut down, the UPiS cuts power.

The script is in Python and requires PySerial. However, RasPlex is very bare-bones, python libraries can’t be compiled and nothing can be installed (there is no package manager). It turns out, however, that this doesn’t matter — PySerial can be installed to a local folder and run from source.

The (small) code and instructions for running are on my GitHub repository. PySerial is included.

 

2 thoughts on “Communicating with the UPiS UPS from RasPlex

  1. I see you share interesting stuff here, you can earn some additional cash,
    your blog has huge potential, for the monetizing method, just type in google
    - K2 advices how to monetize a website

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>