• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

RC Switch Remote decoding

Q&A Forum › Category: ESP8266 › RC Switch Remote decoding
0 Vote Up Vote Down
Alain asked 6 years ago

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

5 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

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!

0 Vote Up Vote Down
Alain answered 6 years ago

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();
}
}
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

If your Arduino is decoding the remote signals, it should allow you to send the values. I have a few more questions:

  1. 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)
  2. Can you try with a different transmitter? Is the transmitter properly connected, can you double-check?
  3. Can you try different outlet channels?
  4. Can you uncomment that line to see if re-sending the value multiple time helps? mySwitch.setRepeatTransmit(15);

Thanks!

0 Vote Up Vote Down
Alain answered 6 years ago

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

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

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!

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.