Joe-houghton / lightwaverf-pi

a port of the arduino lightwaverf library to the raspberry pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lightwaverf-pi

This code is a port of the excellent lightwaverf arduino library written by Lawrie Griffiths to the Raspberry Pi. It utilises the WiringPi library to do most of the GPIO work.

To use this library you will need a 433 Mhz transmitter and/or receiver attached to your Pi. The default is to pin 1 and 0 respectivly (wiring pi pin numbers not the actual processor numbers, see [http://wiringpi.com/pins/]). If you want to use different pin numbers these can be set in the call to lw_setup().

To compile the code you will need wiring pi installed. Instructions can be found here.

To install lightwaverf-pi:

1. Install WiringPi by following the instructions [here](http://wiringpi.com/download-and-install/). 2. Browse to your users home directory, e.g. `cd /home/pi/` 3. Clone the lightwaverf-pi project by using `git clone https://github.com/leachj/lightwaverf-pi.git` this will then put the files in `/home/pi/lightwaverf-pi` 4. Go to the created directory `cd /home/pi/lightwaverf-pi` 5. Run `make` followed by `sudo make install` this will build the library and two example programs: send and receive.

To setup a new device:

When a lightwaverf unit is in pairing mode, the next code (id and unit) it receives will become it's new code. An id is a group code and a unit is the number within the group. 1. Browse to the directory where the lightwaverf-pi project is installed `cd /home/pi/lightwaverf-pi` 2. Put the LightWaveRF unit into pairing mode (normally hold a blue button or hold both buttons on a wall dimmer). 3. If you have only one unit on your network using the `./send 1` command. This will assign the LightWaveRF device the ID "F296D1" unit 2. 4. If you have multiple units or want to specify the device ID, use the command `./send F296C0 3 1` * Where F296C0 is the ID that you want to assign. You can make this code up yourself, it requires 6 hex (0 to F) characters * Where 3 is the unit, this would equate to button 2 if you use a lightwave handheld remote control * Where 1 is the signal for on, this could be 0 for setting up purposes

Usage

`send <0,1>` will send either a off or on signal to device F296D1 unit 2.

send F296C0 3 <0,1> will send either off or on to device F296C0 unit 3.

receive will print out all of the code it receives.

These command will also make the library available for other programs to use with the .so files in /usr/local/lib and the lightwaverf.h file into /usr/local/include

About

a port of the arduino lightwaverf library to the raspberry pi

License:Other


Languages

Language:C 92.8%Language:Makefile 7.2%