The 433send program allows you to control wireless switches by Elro using a 433.92 MHz transmitter such as this one.
Connecting the transmitter to the Raspberry Pi GPIO header:
‘VCC’ pin to 3V3 (pin #1)
‘Data’ pin to GPIO0 (pin #3)
‘GND’ to GND (pin #6)
First, download and install WiringPi. WiringPi allows you to easily control the Raspberry Pi’s GPIO pins:
https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/
Then, download 433send.cpp and put in (for example) the WiringPi example directory (~/wiringPi/examples)
Change the key[] variable according to the dipswitches on your Elro switches.
Compile it:
g++ -o 433send 433send.cpp –I/usr/local/include -L/usr/local/lib -lwiringPi
Usage:
Execute as root!
sudo ./433send -d <device number> -s 1|0
-d: device number.
-s: 1 = on, 0 = off.
Devices:
A = 1
B = 2
C = 4
D = 8
E = 16
Example: sudo ./433send -d 4 -s 1 (turn on device C)
Credits:
Original source written for Arduino by Piepersnijder: http://gathering.tweakers.net/forum/view_message/34919677
Great work! I did a rewrite to Python + RPi.GPIO which can be found here:
http://pastebin.com/aRipYrZ6
Thank you very much for this extremely helpful post!!!!!!!!!!!!!!!
Thank you!! You helped me out
Thank you for this post.
how can i set the key as an parameter?
Thanks in advance
Do you also control them through a website?
( if so, how?)
Sounds cool! Gonna try it!
Hi, pretty cool, exact what i am looking for… which kind of transmitter can or should i use? (your link to ebay is not valid any more) and i can connect this transmitter directly to the RPi?
Great tool.
I have updated you code to be more flexible on the key.
string mykey2 (“10101″);
int key_std = 0;
while((opt = getopt(argc, argv, “k:d:s:”)) != -1)
{
switch(opt)
{
case ‘k':
// mykey.assign(optarg); — char mykey[20] does not work
mykey2.assign(optarg);
key_std = 1;
break;
…..
if(key_std == 1)
{
for (int kx=0; kx<5; kx++) // read key from argv into array
{
key[kx]=mykey2[kx]-48; // string mykey2 ("10101");
}
}
// printf("key: %d-%d-%d-%d-%d %d %d\n",key[0],key[1],key[2],key[3],key[4],ab,onoff);
There is on strange behavior, which you may be able to help on.
My power plug is switching the state regardless of the command.
I.e. if I just send '-s 1' multiple times it goes on / off / on / off / … etc.
I would have expected that the power plug once being on, would not change if I am sending again a on command.