0

Background I bought some cheapo 433 wireless plug sockets (https://www.lidl.co.uk/en/p/christmas-countdown/silvercrest-wireless-socket-set/p36995) and obviously I can't help but want to control them through the RPI. I had a sender and a reciever module laying around so I went about sniffing the codes. Long story short too much noise, bought a new set which arrived today. I've managed to sniff the codes from the remote which seems to use a repeating set of 4 or 5 codes, always the same protocol and the same pulselength. I have been using this script (https://content.instructables.com/ORIG/F3N/KBEX/J76GIPWM/F3NKBEXJ76GIPWM.py / https://www.instructables.com/RF-433-MHZ-Raspberry-Pi/ - code at the end of the page) to receive the 433 signals.

Using the same tutorial I have used the send script to send my code back to the plug socket to no avail. I plugged the receiver back in and and as you can see from the attached screenshot I transmit one code but receive a handful of different codes on the receiver. I have noticed that I can transmit a code (3625900) on protocol 3 with pulselength of 100 and it is detected as the same code (sometimes a few digits out) but on protocol 5 with a pulselength around 500 +/- 20 or so, could this be a limitation of how quickly the GPIO pins can switch high/low? Or possibly attenuation even over a distance of 1.5in? The plug has activated once out of several dozen repeated attempts.

Where do I go from here? The modules I am using do not currently have additional antennas but they will arrive tomorrow. I doubt that will change the situation as the transmitter is approx 1.5inches from the receiver so I don't see attenuation being the issue. Similarly I have moved the plug socket from 2ft to 2in from the transmitter and again no activity on the plug when I transmit any of the codes aside from one lucky shot. Screenshot below for clarity. EDIT: Added screencap showing codes received when holding down the A On button on the remote while holding the remote right behind the receiver.

Next steps? Send on left, receive on right. Receiver is almost silent unless I am actively sending a code with the remote or the python script.

Screencap of holding down the "A On" button right behind the receiver

0

I suggest you try using my pigpio library.

It will give far more accurate timings.

Sample Python code

433MHz Keyfob RX/TX

Classes to send and receive 433MHz wireless keyfob codes.
These keyfobs are widely used for remote control of devices.

http://abyz.me.uk/rpi/pigpio/examples.html#Python__433_py

The class contains a test __main__ program (having a test __main__ is quite common for Python classes).

Edit the __main__ part TX and RX values to reflect the Broadcom number GPIO connected to the 433 MHz transmitter and/or receiver. Then to receive just run ./_433.py for receive or ./_433.py code1 code2 ... to send code1, code2, etc. and then receive.

The example instantiates the transmitter with

tx=_433.tx(pi, gpio=TX)

You can add optional parameters

  • repeats (default 6)
  • bits (default 24)
  • gap (default 9000)
  • t0 (default 300)
  • t1 (default 900)

E.g.

tx=_433.tx(pi, gpio=TX, gap=2285 t0=389 t1=1112)
4
  • I'm no doubt being a noob but can you provide an example of how to use that library? I have no idea what the parameter "pi" is meant to be nor "gpio". Thanks – Chris D Nov 16 '20 at 13:14
  • Thanks! I have your script working, I have confirmed the codes from the remote using your script and another so I know the number is correct however when I transmit the code I can sniff it and the code itself is received as expected but no activity on the plug. I see the T0, T1 and GAP values when sending are not the same as those sniffed from the remote. Can I specify the values when sending to replicate the codes detected when I press the remote control? sniffed data is code=3864252 bits=24 (gap=2285 t0=389 t1=1112) tx script output is code=3864252 bits=24 (gap=9000 t0=301 t1=898) – Chris D Nov 17 '20 at 16:14
  • @ChrisD added example – joan Nov 17 '20 at 16:30
  • Absolute legend. Got it working now, at least for one button out of 4! Thanks for the script and the effort you've put in. For googlers ending up here steps I've needed to take are: Connect the 433 receiver as per the diagrams (note mine says "5v" but works under 3 volts which is safer for the RPI GPIO pins) Edit the script as per Joan's instructions making sure to use the correct GPIO pin number. Hold the remote control so it's touching the receiver to eliminate range as an issue, record the buttons. Edit the script as per Joans instructions again to add correct timings and bingo. – Chris D Nov 17 '20 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.