I have this RF learning relay enter image description here

https://www.youtube.com/watch?v=QuFzDcIiDxQ this is how relay learns codes.

However I don't have remote and want to control it using Pi. I've tried sending various codes using 433Utils with no luck.

Clicking learn button 8 times seem to correctly clear codes, at least LED flashing indicates it. But after this LED is flashing with any code I send to it and to my understanding it should ignore everything after code wipe.

Either I'm doing something completely wrong or receiver might be broken. Hopefully someone has dealt with these and gonna know how to troubleshoot it.

Process (click = single press of code learning button on relay):

  • 8 clicks to clear codes
  • LED flashes to indicate codes cleared
  • 2 clicks to enter toggle learning mode (after each click LED blinks once)
  • LED turns solid and waits for RF signal to learn
  • send 11111 using 433Utils (signal is definitely sent, tested by listening with pilight)
  • LED flashes and turns off

Expected: learning is complete, sending 11111 should blink LED once and toggle relay, sending other codes should do nothing

Outcome: sending any code including 11111 is making LED flash and not toggling relay

  • It may be a timing repeatability problem. Try my abyz.me.uk/rpi/pigpio/examples.html#Python__433_py (sudo pigpiod first) which will send accurately timed signals. – joan Feb 6 at 11:13
  • Thanks. I'll try that this evening. I've spent hours on google, but everyone just use remotes with these relays, not codes generated with Pi. And I need to use relay for now until micro-controller development kit arrives. – goodevil Feb 6 at 12:39
  • @joan Hi. I have specific question. Does your python library works with Manchester code? I have Arduino sending code using github.com/mchr3k/arduino-libs-manchester/blob/master/… but receive nothing on Pi. I've connected cable directly between Arduino sending pin and Pi receiving pin to eliminate transceiver. This setup does work with Arduino using github.com/sui77/rc-switch/blob/master/RCSwitch.cpp instead of Manchester. Thanks in advance – goodevil Feb 21 at 21:00
  • I believe the examples use Manchester encoding. – joan Feb 21 at 21:42
up vote 0 down vote accepted

joan was correct and it was timing issue. I've used suggested class and it worked.

Followed pigpio installation instructions:

rm master.zip
sudo rm -rf pigpio-master
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
  • Copied _433.py to my raspberry
  • Updated RX and TX values at the end of the file to the GPIO I'm using for receiver and transmitter
  • Executed python _433.py 8246180 while relay being in learning mode
  • Everything works as expected.

My hat's off to you sir! Still need to learn a lot about RF, but hopefully this post will help others using same learning relay.

Relay is know as: 1 Channel 12V 433MHZ Receiver Wireless Relay RF, KR1201A

EDIT: You actually not required to build pigpio from source and actually I had to switch to repo version to run it on boot. Here's code:

sudo apt-get update
sudo apt-get install pigpio python-pigpio python3-pigpio
sudo systemctl enable pigpiod.service

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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