Tuesday, January 1, 2013

Pi Power Control Notes



A Raspberry Pi Remote Mains Switcher, to switch these
with one of these
using the awesome reverse engineering detailed here

Installation

Requires WiringPi-Python
git clone https://github.com/WiringPi/WiringPi-Python.git cd WiringPi-Python/ git submodule update --init sudo apt-get install python2.7-dev sudo apt-get install python-setuptools sudo python setup.py install 

Running

Needs to be run as root -
sudo python raspwitch.py --channel 1 --button 3 --gpio 8 on 
When compiling today’s code form git repository gcc has problem finding wiringPi.h on my Raspbian wheezy:
CODE: SELECT ALL
WiringPi/wiringPi/piNes.c:25:22: fatal error: wiringPi.h: No such file or directory
You just need to edit piNes.c and change first include line into:
CODE: SELECT ALL
#include "wiringPi.h"
That fixes the problem.

No comments: