Manage to emit a 433MHz signal previously sniffed, but nothing happens :/

Hi guys!

I'm trying to operate RF power socket from my arduino Uno.
Thanks to the receiver and the switch library I managed to sniff the remote signal and figured out each button is sending sequently 4 different 24-bits codes. Each time you press the button, the code changes.

So I sniffed all of them for 4 buttons : A_ON, A_OFF, B_ON, B_OFF.

Originaly I wanted to stock them into tabs to so it's more convenient to emit them calling tab in a for loop, but I didn't managed to do it yet.
So I decided to right the whole sentence as an argument of the send() function.
The sentences get emitted. I'm even able to catch them!
However, nothing happen on the socket and i've got blank...
Would you have an idea of where I should have a look to unlock the situation?
Here is the code :
#include <RCSwitch.h>
RCSwitch myReceiver = RCSwitch();
RCSwitch myEmitter = RCSwitch();
int Delay = 200;
void Send_A_On(){

  • myEmitter.send("11110001100010001011100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11110101110011010101100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11111110111000101101100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11110011101110000011100");*
  • Receive();*
  • Serial.print("A Powered On \n");*
  • delay(Delay);*
  • }*

void Send_B_On(){

  • myEmitter.send("111101110100000011110101");*
  • Receive();*
  • delay(Delay); *
  • myEmitter.send("11100100000101011100101");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11100001111001000000101");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11111100011111000110101");*
  • Receive();*
  • Serial.print("B Powered On \n");*
  • delay(Delay);*
  • }*

void Send_A_Off(){

  • myEmitter.send("11100010110111101111100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11101010010010100101100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11101101010101110001100");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11111000001001110111100");*
  • Receive();*
  • Serial.print("A Powered Off \n");*
  • delay(Delay);*
  • }*

void Send_B_Off(){

  • myEmitter.send("11100111011110110010101");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11110111000100111010101");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11101000101011101000101");*
  • Receive();*
  • delay(Delay);*
  • myEmitter.send("11111011001100011000101");*
  • Receive();*
  • Serial.print("B Powered Off \n");*
  • delay(Delay);*
  • }*
    void Receive(){
  • if (myReceiver.available()) {*
  • int value = myReceiver.getReceivedValue();*
  • if (value == 0) {*
  • Serial.print("Unknown encoding");*
  • } else {*
  • Serial.print("Received ");*
  • //Serial.print( myReceiver.getReceivedValue() );*
  • Serial.println( myReceiver.getReceivedValue(),2);*
  • Serial.print(" \n ");*
  • //Serial.print( myReceiver.getReceivedBitlength() );*
  • //Serial.print("bit ");*
  • //Serial.print("Protocol: ");*
  • //Serial.println( myReceiver.getReceivedProtocol() );*
  • }*
  • myReceiver.resetAvailable();*
  • }*
  • }*
    void setup() {
  • Serial.begin(9600);*
  • myReceiver.enableReceive(0); // Receiver on interrupt 0 => that is pin #2*
  • myEmitter.enableTransmit(4);*
    }
    void loop() {
    Send_A_On();
    delay(Delay);
    Send_A_Off();
    delay(Delay);
    Send_B_On();
    delay(Delay);
    Send_B_Off();
    }
    Cheers,
    Nico

Hi Guys,

Problem solved : I had to initiate pulse speed and protocol values to 102us and 3.

// Optional set pulse length.
mySwitch.setPulseLength(REPLACE_WITH_YOUR_PULSE_LENGTH);

// Optional set protocol (default is 1, will work for most outlets)
mySwitch.setProtocol(REPLACE_WITH_YOUR_PROTOCOL);

Cheers,

Nico