apt-get install python wiringpi python-pip
pip install wiringpi
https://blog.petrockblock.com/powerblock-raspberry-pi-power-switch/
** NOTE ** Powerblock software modified to use BCM 27 (pin 13) instead of BCM 18 (pin 12) for the S2 signal. This was done to keep the PCM channel on BCM 18 free for future use.
http://referencedesigner.com/blog/introducing-piserialixed/6528/