Dear Rui,
I’m trying to make a copy of my garage remote to play with the RC Switch library.
When I sniffed the remote, I had more weird example than what is on page 67 of your book 😉
I’m assuming that there is probably an encryption in the remote.
What would you do to send the data to the actuator. I tried to send the tri-state with the correct pulse length and also the binary with the correct pulse length without success
The “sniffed” remote data are here https://imgur.com/UH7Ki97
Best regards
Alain
Hello Alain, but did you try to send the binary codes using the send() method?
For example like this?
mySwitch.send("0000111");
Did you also set the pulse-length in the code?
Thanks for your patience!
Hello Rui, Yes I did.
Here is the code:
#include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); int button = 2; unsigned long changeTime; char* socketTristateOn="111F"; char* socketTristateOff="111F"; void setup() { // initialize timer changeTime = millis(); // here we are initializing our pins as outputs pinMode(button, INPUT); Serial.begin(9600); // Transmitter is connected to Arduino Pin #10 mySwitch.enableTransmit(10); // Optional set protocol (default is 1, will work for most outlets) mySwitch.setProtocol(6); // Optional set pulse length. mySwitch.setPulseLength(442); // Optional set number of transmission repetitions. // mySwitch.setRepeatTransmit(15); } void loop() { int state = digitalRead(button); // if the button is pressed and if it has passed 5 seconds since last button is pressed if (state == HIGH && (millis() - changeTime) > 1000) { //call the function to send command /* tri-state code */ mySwitch.sendTriState(socketTristateOn); delay(1000); mySwitch.sendTriState(socketTristateOff); delay(1000); mySwitch.send("01011011"); delay(1000); mySwitch.send("11110100"); delay(1000); changeTime = millis(); } }
If your Arduino is decoding the remote signals, it should allow you to send the values. I have a few more questions:
- Does the same button when pressed print the same information? (sometime the 2nd attempt is different, but the 3rd, 5th should always go back to value that is printed more frequently)
- Can you try with a different transmitter? Is the transmitter properly connected, can you double-check?
- Can you try different outlet channels?
- Can you uncomment that line to see if re-sending the value multiple time helps? mySwitch.setRepeatTransmit(15);
Thanks!
Hello Rui,
Thanks for your reply.
Question 1 : if you can take a look to the original message, I posted a copy of the receiver reads. This in itself is weird. As if the data were coded somehow. I think the root cause of this issue is there but I don’t see what to change to get better data. the remote and the receiver were far not more than a few centimeters.
Question 2 : I had already to purchase a second set of receiver-transmitter as in the first place the receiver was not receiving anything at all even with correct frequency. but I did not tried my first transmitter. so I will check
Question 3 : I’m not sure to understand what you mean with different outlet channels. My remote as just one button
Question 4 : I will try later.
Thanks for your advises
Alain
1. and 3. I thought that you had a remote with 4 buttons to 8 buttons. So, I think you might had different values from different button that you pressed.
2. This is very rare, but you might either have an incompatible device or bad transmitter. Can you try with a different library? https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home
- download and install the library in your Arduino IDE: https://bitbucket.org/fuzzillogic/433mhzforarduino/get/0847a6d8a917.zip
- you would use this example to decode the received values (receiver connected to Arduino digital pin 2): https://bitbucket.org/fuzzillogic/433mhzforarduino/src/default/RemoteSwitch/examples/ShowReceivedCode/ShowReceivedCode.ino
Sorry about the trouble with this project!