Remote Control Lights using a Raspberry Pi
I got fed up with using my Arduino to interface with hardware. It’s really easy to use and wire things up, but actually transferring data between it and a PC (and possibly a server of some sort) is pretty painful. It usually requires using serial communications and some data serialisation method. So I thought I’d use a Raspberry Pi for a change!
I already had a 433 MHz transmitter/receiver pair working with the Arduino. I was trying out both the lawrie/LightwaveRF and roberttidey/LightwaveRF libraries to get my ceiling light and wall plug lights switching on and off remotely and it was awesome. But again, the Arduino brought pain when interfacing with a server.
I plugged the 433 MHz transmitter into the Raspberry Pi’s GPIO’s, grabbed lawrie’s library, converted it to be Raspberry Pi friendly using wiringPi and created a simple C++ main function to spew out some messages every couple of seconds. This was really easy using wiringPi!
Then I created this video.
The system seemed to work great! But it now needed the ability to receive messages too, for some unknown reason. So I attempted to use lawrie’s library again but it really failed for reasons that I forget… So I switched to using roberttidey’s library for RX, made it Raspberry Pi friendly and it worked!
I uploaded the code to GitHub at jimjibone/LightwaveRF so feel free to clone, fork or whatever.
I would ideally prefer to switch to use entirely roberttidey’s library, converted to use the Raspberry Pi, but initial attempts failed when trying to get TX working. I have also recently used this library with the Spark Core and it works really well, so enabling the library to work on the Pi would be awesome.