Lights is my take on Geoff Johnson's Raspberry Pi mains switching tutorial. I basically add a flashier UI and RESTful data using json for use later in a mobile app.
PHP C++ JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Raspberry Pi Lights is my take on Geoff Johnson's Raspberry Pi mains switching tutorial.

Except I use Woods 13569 from amazon (mine is 'channel B'). [] I'm planning to add a flashier UI, PHP and Javascript and make a mobile application.

NOTE: The Woods 13569 uses a 315mHz transmitter unlike the 433mHz Geoff's unit has. So my antenna is 9.3(23.8cm) long. Also, protip: curl the antenna up around a screwdriver (all the antennas are like this inside of the recievers anyway)

I am also using the channel 'B' type, so if your is channel A, you will need to follow Geoffs guide on his page []

I did feel like Geoff was missing some better documentation on how to hookup the breadboard to receive codes and visualize them with Audio galaxy. Here are two pictures which might help: Breadboard 1 Breadboad closerup

All-in-all, it's was pretty easy to follow his instructions, I doubled up the bits when transcibing the code, so instead of 1000, I wrote 11000000, it worked with Geoffs sleep of 222000 in switch.cpp

In this pic, I used some dupont connectors (hard to crimp, hard to solder, but soooo much better looking than a floppy cable) Raspberry Pi showing 315mHz tranmitter installed with dupont connectors

To use: Copy the contents of the www folder you your /var/www or wherever your distro keeps web files.

Compile (as root) switch.cpp

sudo g++ switch.cpp

move switch.cpp to /usr/bin

sudo mv a.out /usr/bin/switch

set sticky bit (so it can run as root when executed by a non-root user)

sudo chmod +s /usr/bin/switch