Lexenstar
Posts: 5
Joined: Wed Oct 16, 2013 3:31 am

Remote controlled power outlets 433Mhz

Wed Oct 16, 2013 10:11 pm

Hey,
I am relatively new to using the Raspberry Pi's GPIO features. I am using the Raspberry Pi model B rev. 1 (the one with 256MB RAM).
I bought this transmitter and receiver: These
And 5 BH9936 remote controlled outlets from DBTech: These

What I want to do is I obviously want to control the outlets from the Pi. Using this tutorial I have now read out my remotes' codes (they're like 3232771 and so on).

My problem now is transmitting these codes: I tried using "./codesend 3232771" of 433Utils (described in the tutorial), it returned "sending code[3232771]" but nothing happened. I connected the transmitter according to this picture and also tried switching between the 5V and 3.3V power as well as I checked whether I am using the right GPIO and checked the "codesend" file for the right GPIO port before compiling it.

What am I doing wrong? Anyone got suggestions?

Thank you very much,
Lexenstar

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Remote controlled power outlets 433Mhz

Thu Oct 17, 2013 10:22 am

Could be any number of reasons for mismatch from encoding to the transmitter/receiver pair you got are AM (Amplitude Modulation) and the remotes might use FM (Frequency Modulation) or other forms so you may receive a code. The code may be the best decode that can be made of that transmission but wrong.

When sending you are then sending something the other end does not understand.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Remote controlled power outlets 433Mhz

Thu Oct 17, 2013 11:11 am

The DB-Tech wireless remote switches look very similar to my Status remote switches (the remote control certainly does) so it's likely to be of similar technology.
There already exists a program for the Pi that can control these kind of remote switches using a program call pihat - http://www.raspberrypi.org/phpBB3/viewtopic.php?t=26485
It uses the same dirty hack as the poorman's Pi FM (square wave modulated) transmitter although as I understand you can also connect the TX board to the same GPIO pin as well.

As for ninjablocks webpage he appears to have omitted the fact that the GPIO input pins are 3.3v tolerant and yet has connected his RX board directly to the GPIO.
This in my opinion is a serious flaw in his design because these RX boards are powered by 5v and provide 0v / 5v TTL levels which could potentially damage the GPIO input pin.

The data transmitted from these types of devices use simple OOK (on off keying) the length of the pulse usually represents binary 0 and binary 1.
Since there's no agreed standard for representing binary data the timing can be different from brand to brand.
Fortunately pihat source code is easy to modify to adjust the pulse lengths although it does mean you'll need to sample the original remote control signal to try to faithfully recreate this on the Pi.

Richard S.

Lexenstar
Posts: 5
Joined: Wed Oct 16, 2013 3:31 am

Re: Remote controlled power outlets 433Mhz

Thu Oct 17, 2013 5:20 pm

Hey,
thanks for the responses.

I figured out the GPIO input is for 3.3v - thats why I plugged the receiver in to 3.3v and it worked fine even though it is made for 5v.

I downloaded PiHAT and tried figuring it out a little but according to the tutorial and the arguments the program takes it only works with Nexa remote switches. I can not seem to find an option to put in those codes I received earlier either.

Is there a way I could modify the 433Utils' codesend for that? (in terms of pulse length if that might be the problem).
In codesend.ccp it says

Code: Select all

 - The provided rc_switch 'send' command uses the form systemCode, unitCode, command
   which is not suitable for our purposes.  Instead, we call 
   send(code, length); // where length is always 24 and code is simply the code
   we find using the RF_sniffer.ino Arduino sketch.
which is exactly what I am doing.

Thanks,
Lexenstar


EDIT: I figured out how to change the pulse length of codesend. But how do I now find the right pulse length?

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: Remote controlled power outlets 433Mhz

Sat Oct 19, 2013 6:18 pm

Have a look at http://www.hoagieshouse.com/RaspberryPi ... CPlug.html - see how he looks at received rf waveforms, Connect receiver to pc mic input, run Audacity (or mac or Linux with similar software). Check original against supposed copy.

dinogeek
Posts: 1
Joined: Wed Nov 20, 2013 2:52 pm

Re: Remote controlled power outlets 433Mhz

Wed Nov 20, 2013 2:56 pm

Hi
I want to try to command the same plug.
I' m wondering if finally you arrived to do it with your Rasp?
Thinks

TKPi
Posts: 12
Joined: Tue Jan 15, 2013 5:41 am

Re: Remote controlled power outlets 433Mhz

Thu Nov 21, 2013 4:04 pm

Might be something as simple as distance between transmitter and receiver. I had that issue while working with my RF modules. How far is your receiver from your transmitter? Does your transmitter have an additional antenna to increase its range?

thienson30
Posts: 26
Joined: Mon Jul 08, 2013 7:53 am

Re: Remote controlled power outlets 433Mhz

Fri Nov 22, 2013 11:06 pm

1 RF Transmitter and 1 Raspi control up to 1000 Power Outlet/RF Relay Receiver/Channels(Garage/Fan/Gate/Sprinkler...etc). This PI is running on 2TB Hard drive.
http://www.youtube.com/watch?v=5dmvT6vTV2w
Last edited by thienson30 on Sat Jan 18, 2014 7:22 am, edited 1 time in total.

Lexenstar
Posts: 5
Joined: Wed Oct 16, 2013 3:31 am

Re: Remote controlled power outlets 433Mhz

Tue Dec 10, 2013 4:48 pm

Hey, thanks for the answers. No, I have not got it to work yet :( I kind of gave up for a while but I might give it a try with the software mentioned in the video.

Another issue is whenever I plug in both - transmitter and receiver (and check for the receiver to work by using the remote) - and I transmit a signal, no matter what, it is never being received. So either I'm doing something completely wrong or I have a faulty transmitter. I have looked at dozens of pictures of how to plug in the cables but I have never received anything from my transmitter.

Anyone else got any success on this model?

Distance is not the factor, I have put them right next to each other.

TKPi
Posts: 12
Joined: Tue Jan 15, 2013 5:41 am

Re: Remote controlled power outlets 433Mhz

Tue Dec 24, 2013 7:07 pm

I have the same remote and I tied the audacity route but could not decode the signals due to bad waveforms. So I just hacked the remote instead to enable internet controlled outlet switches. See my blog post here:
http://tkmaker.blogspot.com/2013/12/ras ... ation.html

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: Remote controlled power outlets 433Mhz

Wed Jan 01, 2014 3:15 pm

Hi

I am sorry to hear you had problems with the" Audacity method" - it can be rather fiddly and the results are obviously not as good as using proper kit but in general can be usable. The two pix attached show the on and off signals for the same Maplin RSL386T remote, one using attenuator-soundcard-Audacity and the other a logic analyser. Both are as received by the same 0£75 (approx 1 USD) eBay generic 433 receiver.
Attachments
RSL836_1_1_on.jpg
RSL836_1_1_on.jpg (19.38 KiB) Viewed 13994 times
1_1_Off.jpg
1_1_Off.jpg (8.87 KiB) Viewed 13994 times

TKPi
Posts: 12
Joined: Tue Jan 15, 2013 5:41 am

Re: Remote controlled power outlets 433Mhz

Thu Jan 16, 2014 6:00 pm

Lexenstar,
I was able to solve the issue on my end. I have the same RF remote from DBTech and I originally tried to send the code that I received using the RCswitch library for Raspberry Pi. Nothing seemed to work initially but when I tried the advanced receive demo sketch on my Arduino, I noticed that the pulse length was 207. The data seemed to match what I had on my Raspberry Pi. So I modified the send.cpp for the Raspberry pi and added this before sending the code.

mySwitch.setPulseLength(207);
Details are here:
http://tkmaker.blogspot.com/2014/01/ras ... emote.html

After this change, I was able to control the RF remote outlets using a simple,cheap 433 MHz RF transmitter (the one from ebay).
Hope this helps.

Return to “Automation, sensing and robotics”