sui77 / rc-switch

Arduino lib to operate 433/315Mhz devices like power outlet sockets.
1.91k stars 659 forks source link

Libary example stays quiet bit reciever is bitbanging. #318

Open Stephan3 opened 4 years ago

Stephan3 commented 4 years ago

Hello!

I tested the ReceiveDemo advanced and simple. Both staying silent on serial.

mySwitch.available()

never triggers. I use theese receivers https://www.amazon.de/gp/product/B071J2Z3YK/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1

If i connect a Logic analyzer to the receiver module its bitbanging. If i push a button on the remote i try to capture the bitbanging sequences are changing. After releasing a button all is 1 for a while. Is there a special Setup or receiver i have to use with this library?

Thanks Stephan

1technophile commented 4 years ago

Hi,

these receivers are OK, but did you connected them to a PIN with an interrupt ?

Stephan3 commented 4 years ago

Thanks for your quick reply. I think i did it right, Here are some details:

Its a Arduino nano . The receiver DATA is connected to D2 of Nano. 5V and GND is connected to Arduino 5V and GND. Nano is supplied by usb of a laptop,

With this sketch i can see that the device is bitbanging. If i push a button on the remote i can see a lot of data passing by.

#include "RCSwitch.h"
#include <stdlib.h>
#include <stdio.h>
RCSwitch mySwitch = RCSwitch();

int j = 0;

void setup() {
 Serial.begin(115200);
 mySwitch.enableReceive(0);
 Serial.println( "bin da" );
}

void loop() {

 j=j+1;

 Serial.print( digitalRead(2) );

 if(j==31){
  Serial.println("");
  j=0;
 }
}

If i push no button, there seems to be a lot of noise. The remote is the following.

https://www.jalousiescout.de/Funktechnik-/-Funksteuerung/Auswahl-nach-Hersteller/Jarolift/Jarolift-Funkwandsender-Timer-4-Kanal-TDRCT-04W.html?gclid=CjwKCAiAu9vwBRAEEiwAzvjq-8xxRRxmkeXgqW3PDcI_NeJmBlZwznAOiiHEJlN7_hctUDLmnIJM1RoCRmAQAvD_BwE

I really apreciate your help. My plan is to sniff each button and send it with a transmitter on a esp32 using alexa.

EDIT:

No Button Press:

22:19:26.304 -> 1110111101100100001001011111001
22:19:26.304 -> 1110011110000110000100100011001
22:19:26.304 -> 0000001001101001000000000110111
22:19:26.304 -> 0010000011110000001110101100001
22:19:26.304 -> 1000011011110000000111111011111
22:19:26.304 -> 0011110000110000100000101100000
22:19:26.304 -> 0011011111110000000001111111000
22:19:26.304 -> 0000000000000010000010000000000
22:19:26.304 -> 1100100000000000001111001010000
22:19:26.304 -> 0010000010000000000000000100100
22:19:26.304 -> 0100000000000000000000000001000
22:19:26.304 -> 0000000000000010000010000000000
22:19:26.304 -> 0000100000100000100000000000000
22:19:26.304 -> 1000000000000011011000000000000
22:19:26.304 -> 0010010000110110000100110100000
22:19:26.304 -> 0100000100001101001101000001000
22:19:26.304 -> 1000000001011110000000011000010
22:19:26.304 -> 0010110000110100000100100111111
22:19:26.304 -> 1000001011111111110010011111110
22:19:26.304 -> 0100000011111001011000000000000
22:19:26.304 -> 0000000111100000000000000000000
22:19:26.304 -> 0001101100000001000000001000010
22:19:26.304 -> 0010010000010000010000010010000
22:19:26.304 -> 0000100000000100100000000000000

While buttom press:

2:20:41.711 -> 1111111111111111100000000000111
22:20:41.711 -> 1111111111111100000000000011111
22:20:41.711 -> 1111111111110000000000011111111
22:20:41.711 -> 1111111110000000000011111111000
22:20:41.711 -> 0000000000000000011111111100000
22:20:41.711 -> 0000000000000011111111111111111
22:20:41.711 -> 0000000000011111111100000000000
22:20:41.711 -> 0000000011111111100000000000000
22:20:41.711 -> 0000001111111111111111110000000
22:20:41.711 -> 0000111111111111111111000000000
22:20:41.711 -> 0111111111111111111000000000000
22:20:41.711 -> 1111110000000000000000000000111
22:20:41.711 -> 1111111111111100000000000111111
22:20:41.711 -> 1111111111100000000000111111111
22:20:41.711 -> 1111111100000000000111111111111
22:20:41.711 -> 1111100000000000111111111111111
22:20:41.711 -> 1100000000000011111111100000000
22:20:41.711 -> 0000000000011111111111111111110
22:20:41.711 -> 0000000011111111100000000000000
22:20:41.711 -> 0000001111111111111111110000000
22:20:41.711 -> 0001111111111111111110000000000
22:20:41.711 -> 1111111100000000000000000000001
22:20:41.711 -> 1111111111111111000000000001111
22:20:41.711 -> 1111111111111000000000000111111
22:20:41.711 -> 1111111111100000000000111111111
22:20:41.711 -> 1111111100000000000111111111111
22:20:41.711 -> 1111100000000000111111111111111
22:20:41.711 -> 1100000000000111111111111111111
22:20:41.711 -> 0000000000011111111000000000000
22:20:41.711 -> 0000000011111111111111111100000
22:20:41.711 -> 0000011111111111111111100000000
1technophile commented 4 years ago

If i push a button on the remote i can see a lot of data passing by.

An hypotesis could be that your remote is not recognised by rcswitch.

To verify that your setup is working you could try to set another uC with an emitter, load into it the senddemo example and see if you receive something with the receiver one.

At final could you detail what you would like to achieve ?

Stephan3 commented 4 years ago

Thanks meanwhile i realized that the device is using Keeloq. Therefore rc-switch is not the right tool. (correct me if i am wrong)

1technophile commented 4 years ago

Maybe try this version that I have not yet merged: https://github.com/1technophile/rc-switch