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.
How to build an on-wall media centre from scratch…
Because what else are you going to do in the shower?
The T100 is a nice little convertible tablet/netbook.
My aim is to get a “perfect” Ubuntu installation on the T100, such that it can be used successfully as a daily machine in both netbook and tablet modes.
GLXGears in tablet mode
If you keep getting this spamming your PHP error log, it is likely because PHP xcache was installed previously and then uninstalled, but its configuration files were not cleared out. This could have happened at an upgrade or when you chose a different cache system.
You can check if you have xcache installed by doing
sudo dpkg -s php5-xcache | grep Status. If the status shows as "deinstalled" but with config files left, you can simply purge it with
sudo apt-get remove --purge php5-xcache .
Then restart Apache:
sudo service apache2 restart. Your error log should now be spam free.