sui77 / rc-switch

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

Not receiving anything #194

Closed pkishino closed 3 years ago

pkishino commented 6 years ago

Hello, nice looking library. I have been trying all evening to get the simple receiver to work with my arduino nano and adafruit feather huzzah together with the https://www.kjell.com/se/sortiment/el-verktyg/elektronik/fjarrstyrning/sandar-och-mottagarmodul-433-mhz-p88905 one that is listed under RF devices and as remote I am using the nexa neyct-705 remote as well as a generic 4 button 433 remote. The nexa can talk and program all my plugs. But the receiver never shows anything :( I have wired it to 5v from arduino and d2 Have tried two receiver modules, both the same, labeled MX-RM-5V any idea?

kuchod commented 6 years ago

Your remote may be using a protocol not recognized by this library. Try this one:

https://github.com/Martin-Laclaustra/rc-switch

and use this sketch:

https://github.com/Martin-Laclaustra/rc-switch/blob/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino

it scans unknown protocols and outputs raw data. Then you can plot it with

test.sui.li/oszi/

pkishino commented 6 years ago

Thanks, I'll try that

On Thu, 18 Jan 2018, 07:53 kuchod, notifications@github.com wrote:

Your remote may be using a protocol not recognized by this library. Try this one:

https://github.com/Martin-Laclaustra/rc-switch

and use this sketch:

https://github.com/Martin-Laclaustra/rc-switch/blob/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino

it scans unknown protocols and outputs raw data. Then you can plot it with

test.sui.li/oszi/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sui77/rc-switch/issues/194#issuecomment-358554819, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7i4vlx9D4-RBMJjN-u4XsLb0s9Gv4uks5tLupqgaJpZM4RiG-J .

kuchod commented 6 years ago

Also check issue #112, it is about decoding a nexa signal.

kuchod commented 6 years ago

and this page: http://dephiox.blogspot.com.es/2013/01/decoding-new-nexa-protocol.html

kuchod commented 6 years ago

Also try this sketch

https://github.com/sui77/SimpleRcScanner/blob/master/htdocs/Sketchbook/SimpleRcScanner.ino

in fact, may be the one I was using at home to get the unsupported data.

chamithchathuka commented 6 years ago

It works with Martin-Laclaustra protocol receiver branch

finity69x2 commented 6 years ago

I already have hex codes generated by a Broadlink RM Pro for a remote that apparently isn't supported by RC-Switch. Can those codes be used to define a protocol/code to be used in RC-Switch?

chamithchathuka commented 6 years ago

I have less Idea with RM Pro, but as @kuchod mentioned,

try using the

https://github.com/Martin-Laclaustra/rc-switch

and use this sketch:

https://github.com/Martin-Laclaustra/rc-switch/blob/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino

Then include the purposed protocol in the RCSwitch library and send the signal received.

Hope you get an idea. If you need more information let us know.

finity69x2 commented 6 years ago

I downloaded the rc-switch protocolless repository as directed above. I uploaded the sketch from above onto a NodeMCU.

Now when I try to run the code and watch the serial monitor for signs of life I don't see any response to the button push on the remote.

Actually, after lots of trial and error (almost all error unfortunately) I think I've narrowed it down to my hardware setup. I can't figure out which pin to use on the nodeMCU for the receiver interrupt.

The sketch says to use interrupt 0 (pin #2) for an arduino (which I'm pretty sure corresponds to D4 on the nodeMCU).

I'm pretty sure the nodeMCU is never receiving the interrupt from the output of the receiver board. I put a simple serial print at the very beginning of the loop (print "working") and that is running continuously on the screen but when I push a button on the remote nothing happens.

I've tried changing the code to use pins D2, D3 & D4 (GPIO4, GPIO0 & GPIO2 respectively). I also am pretty sure the receiver is actually putting out data because the built-in LED is connected to D4 (GPIO0) and it flickers with the receiver data pin connected to it and when I push the button on the remote the LED goes solid for a split second.

Anyone have any ideas on what might be wrong?

finity69x2 commented 6 years ago

Ok... So here is the next bits of data.

I loaded a sketch of senddemo.ino onto my NodeMCu baord with a TX unit data pin attached to the SD3 pin on the NodeMCU. After loading it I could scan the output of the TX using a rtl-sdr and saw the frequency was transmitting at 433.81mhz. So I know it is working.

now on to the RX end:

I loaded simplrcscanner.ino onto the NodeMCU without modification. I got nothing at all on the serial monitor. And since I have the senddemo.ino running on the TX I should be receiving something.

looking at the code I notice that there are two pins defined an interrupt pin on GPIO0 & a receive pin on GPIO2. From what I have read the esp8266 (nodeMCU) doesn't handle interrupts the same as the ardiuno. So I was looking around for info on how to connect the interrupt and receiver pins to be used with the SimpleRcScanner sketch and found where someone recommended to use GPIO13 (D7 pin on NodeMCU) as the receive pin ( myswitch.enableReceive(13) ) in the RCSwitch receive demo sketches.

I tried that by modifying Martin-Laclaustra's ProtocolAnalyzeDemo sketch to set the receive pin to 13 and suddenly I now see the signal received by the TX in the serial monitor of the RX. Success!! Kind of...

Now when I press a button on the remote I still see no response on the serial monitor.

I am now very confident that all my hardware is working. I can see the remote signal on my rtl-sdr @ 433.910mhz. every time i push the button it sends out a series of four bursts.

My question now becomes, how do I modify the simplrcscanner.ino to be compatible with the nodemcu board? Or how should I hook up the RX board to the NodeMCU to get the interrupt pin to be seen to execute the receive function? Or am I completely off base on how the simplercscanner works?

Or should I just give up on that and put the sketch onto a raspberry pi and see if that will work?

If there is any other information that I can provide to (hopefully) get this to work please (PLEASE!) let me know.

chamithchathuka commented 6 years ago

I am not clear what did you received? Is that a signal you sent by your self?

But you want to receive the signal sent by the remote. am I correct?

finity69x2 commented 6 years ago

I'm sorry for the confusion. Let me try to clarify.

I have two NodeMCU boards. On one board I wired in a transmitter. On the other I wired in a receiver.

On the one with the transmitter I loaded the sendDemo.ino sketch. It sends 8 pulses at around 1 per second, pauses for around 10 seconds, then sends 8 more pulses. It repeats to infinity.

On the other board I installed the protocolAnalyzerDemo.ino from @martin-laclaustra. I eventually figured out that I had to modity it to define the receive pin to GPIO13 (D7 on NodeMCU) before I could actually get it to receive the signal that was being continuously sent from the transmitter and display the data on the serial monitor of the receiver board. Now I know I have good, working hardware.

Then when I try to send a signal from my remote I don't see the signal being received and/or displayed on the serial monitor using the protocolanalyzerdemo sketch.

I know the remote is physically working. It operates my fan and when I use my RTL-SDR dongle I see the signal on the display being sent at 434.910mhz.

The remote sends a series of 4 bursts. each burst consists of 12 bits, then a pause (as a preamble?) then it sends 64 more bits of data for (what I think is...) the actual action command, then there is a final bit (to signal the end of the string?). It then sends 3 more bursts in the same format but the 64 data bits might be different. On the "off" button I captured the first 2 bursts were exactly the same and the second two bursts were exactly the same but the two sets of bursts were different from each other (like x x y y).

What I want to do is to be able to use the SimpleRcScanner.ino to capture the raw data to see if that will help me in determining the required protocol but, from my limited understanding, the NodeMCU board handles interrupts differently than the arduino.

The SimpleRcScanner.ino uses two pins to control the operation of the program; a receive pin and an interrupt pin. Since the skecthes that RCSwitch uses doesn't use any defined interrupt pin (only a receive pin) I was hoping that I could modify simplercscanner to operate like protocolanalyzerdemo to also use only the receive pin on GPIO13 and eliminate the need for the interrupt pin. I'm not sure what I would need to do to accomplish that.

That is my first question.

Secondly, after all that being said, is it possible to just hook up the Data pin from the RX board to both the defined receiver and interrupt pins at the same time; thereby using the data pin to both activate the interrupt and send data?

Or should I load the simplercscanner code, unchanged, onto a raspberry pi to see if it will capture anything?

Thank you for the help.

Martin-Laclaustra commented 6 years ago

Forget: https://github.com/sui77/SimpleRcScanner/blob/55eb073a85689619b59398251d6b9bb4098eb363/htdocs/Sketchbook/SimpleRcScanner.ino#L9 That value is automatically calculated for your Rx pin (just one pin) in line: https://github.com/sui77/SimpleRcScanner/blob/55eb073a85689619b59398251d6b9bb4098eb363/htdocs/Sketchbook/SimpleRcScanner.ino#L12 Just define the correct pin as "D1" - "D16" In your case write: static int receiverPin = D7;

Note: please delete the double post you added in the other issue 3 days ago.

finity69x2 commented 6 years ago

Ok thanks I see now.

SebastianGrans commented 6 years ago

@kuchod: I love you!

I spent the whole of Saturday pulling my hair as to why I couldn't get the arduino to trigger my RF outlets. Using that fork and that sketch solved it for me!

For anyone wondering I bought a set of sockets from Kjell & Co (Sweden): Luxorparts Mini remote sockets kit Art. 50987 Link

(I cracked one of the outlets open and found that they use a BQ31081 chip for the 433MHz modulation.)

omersiar commented 6 years ago

Hello,

I also have unsupported transmitter, with these tools and audacity, i captured the raw data the transmitter sends.

https://github.com/Martin-Laclaustra/rc-switch https://github.com/Martin-Laclaustra/rc-switch/blob/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino

This is the image representation of raw data. 5b25f1

This is the sound representation:

2018-03-10-201218_1280x1024_scrot

This is the text:

84,128,60,12,8,416,208,16,208,68,300,168,360,8,500,32,10968,12,796,20,112,40,396,36,84,16,184,80,132,32,32,116,20,148,72,48,92,116,228,48,28,396,68,192,80,136,44,24,76,280,12,172,52,40,12,972,16,40,60,128,36,136,64,500,24,764,28,84,40,160,52,220,80,312,12,28,64,80,100,12,168,16,20,92,40,36,60,212,40,12,60,32,48,72,96,68,80,76,16,20,208,132,176,20,3316,64,172,388,64,188,16,76,40,20,40,20,60,68,28,16,64,416,32,140,12,176,12,100,72,284,40,52,24,368,44,164,56,208,72,1244,36,12304,12,16,84,276,28,108,8,100,52,76,68,48,152,216,40,16,48,92,96,76,112,40,72,36,296,132,108,12,724,24,8,44,92,52,108,48,640,64,76,52,368,8,164,60,72,72,44,176,48,76,48,80,48,176,100,4764,1508,332,720,336,724,332,720,692,368,688,368,688,372,328,728,684,376,328,724,328,736,324,732,328,724,328,732,684,372,324,728,688,376,328,728,324,732,684,372,324,732,684,372,324,732,684,372,684,376,328,736,324,728,328,732,680,376,320,732,324,732,324,732,684,380,324,728,328,728,324,732,684,372,324,732,324,732,324,732,684,12404,4740,1512,324,728,328,728,324,732,684,372,684,372,684,376,324,732,680,380,324,732,324,728,328,728,324,732,324,732,688,372,328,732,680,380,324,728,328,732,680,376,324,732,680,376,324,728,684,376,684,376,324,732,324,732,324,732,684,376,320,736,324,732,324,736,680,380,324,732,320,736,320,732,684,372,324,732,324,732,320,732,684,12404,4736,1516,324,728,324,740,324,728,684,372,684,376,680,376,324,732,680,380,324,732,324,732,324,728,324,732,324,732,684,376,320,732,684,376,324,732,328,732,684,376,320,736,680,372,324,732,684,372,684,380,324,732,324,732,320,736,680,376,320,732,324,732,324,732,680,384,320,740,324,732,320,736,680,372,328,728,324,732,324,732,684,24332,28,456,36,104,44,244,8,80,12,72,80,80,20,56,52,52,20,52,48,92,64,60,80,72,20,12,20,104,24,44,8,40,72,80,72,88,44,56,32,16,12,84,112,12,172,36,32,68,40,36,88,48,360,92,16,64,12,
Reset your Arduino to scan again...

This is the working arduino skecth that i figured out: Actually opens my garage door, is this can be implementet by this library?

The remote's PCB labeled as DC184 v1.1 and shell label is DC115B


#define RF_DATA_PIN 2
#define lowdelay 360
#define highdelay 690 

void setup() {
  pinMode(RF_DATA_PIN, OUTPUT);
}

void loop() {
  sendSokak();
}

void sendSokak() {
  //SYNC
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(12404);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(4730);

  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(1490);

  //loop 1 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //loop 2 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //SYNC 2 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 3 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 3 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //SYNC 5 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(lowdelay);

  //loop 4 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(lowdelay);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(highdelay);

  //SYNC 6 ------------------------
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(highdelay);
  digitalWrite(RF_DATA_PIN, LOW);
}
Martin-Laclaustra commented 6 years ago

@omersiar have a look at: https://github.com/sui77/rc-switch/issues/146 https://github.com/sui77/rc-switch/issues/163

minusdavid commented 6 years ago

I cloned https://github.com/Martin-Laclaustra/rc-switch and checked out the protocollessreceiver branch and uploaded that into the Arduino IDE, and tried https://github.com/Martin-Laclaustra/rc-switch/blob/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino, but I'm getting compilation errors:

/home/david/sketchbook/libraries/RCSwitch/RCSwitch.cpp: In member function ‘void RCSwitch::enableReceive(int)’: /home/david/sketchbook/libraries/RCSwitch/RCSwitch.cpp:550:32: error: ‘digitalPinToInterrupt’ was not declared in this scope if (digitalPinToInterrupt(i) == interrupt) {

Going to investigate further but recording it here...

minusdavid commented 6 years ago

The funny thing is that I had the regular rc-switch working for like... 10 minutes with my wireless doorbell button and then it just stopped working, even with the transmitter right on top of the receiver...

minusdavid commented 6 years ago

Maybe I need to update my IDE...

Edit: Looks like I'm using the arduino and arduino-core packages in Debian Jessie...

Edit2: Looks like the version is 2:1.0.5+dfsg2-4

minusdavid commented 6 years ago

Yeah according to https://github.com/arduino/Arduino/issues/3929 it looks like maybe just an ancient IDE courtesy of the Debian distro :/

minusdavid commented 6 years ago

Didn't want to uninstall the Debian packages and didn't want to clutter up my desktop, so I took inspiration from Jessie Frazelle (https://blog.jessfraz.com/post/docker-containers-on-the-desktop/) and found a Dockerfile from Maël Auzias (https://stackoverflow.com/questions/34017038/running-gui-in-docker-no-ssh-no-vnc) that let me run up the latest version of the Arduino IDE inside a Docker container.

I updated Auzias's Dockerfile to use the latest Arduino IDE code and added the user to the dialout group and used --device /dev/ttyACM0, and it worked perfectly. I got my Arduino IDE 1.8.5 running on my Debian host (from a Ubuntu 14.04 based container) over a X11 unix socket connection.

I was able to compile the code from https://raw.githubusercontent.com/Martin-Laclaustra/rc-switch/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino and uploaded it to my Arduino UNO, and the results are fantastic!

With rc-switch, I was getting absolutely nothing on the serial monitor 99.99% of the time. With @Martin-Laclaustra's fork, I get output every time I click my doorbell button.

Now to try plotting it using http://test.sui.li/oszi/ like @kuchod suggested.

Thanks so much for the useful information, people!

Hopefully this comment will help anyone working with an old IDE... Docker doesn't have to just be for work or servers...

Martin-Laclaustra commented 6 years ago

You probably can skip the plotting chapter. Just read the output of the ProtocolAnalyzeDemo.ino and use/test the protocol proposed in it.

minusdavid commented 6 years ago

Thanks, @Martin-Laclaustra. This is my first time working with RF hardware, so I've been reviewing the rc-switch source code to see what the protocol even signifies. I think that I've nearly worked it all out, so I plan to test the data received from the doorbell button on the RF receiver with a transmission from a RF transmitter to the doorbell receiver. It was neat plotting out the data to see how it mapped to a binary format.

I was wondering... do you have a pull request open with rc-switch to incorporate your changes? They seem really useful. I'm trying to work out exactly what it is about your changes (as distinct from the vanilla rc-switch) that make it work for me.

This is the typical output of ProtocolAnanlyzeDemo.ino:

`Received 2817 / 12bit Protocol: 6 data bits of pulse train duration: 12532 proposed protocol: { 348, { 15, 2 }, { 1, 2 }, { 2, 1 }, true }

first level down 5324 664 764 300 416 612 796 232 904 148 468 600 424 612 428 616 396 668 348 688 348 692 348 692 720 31`

That proposed protocol does seem pretty close to Protocol 6 (I haven't worked out whether it's actually in the thresholds but I'm guessing maybe it is if I'm getting that output).

I'm getting about 5-6 repetitions. Anyway, I shouldn't use this space for that...

I guess I'm just concerned about using your fork in the long-term because it hasn't been updated since May 2017 while the upstream rc-switch was updated in November 2017. I suppose the latter is still a while ago so I imagine it's pretty stable...

minusdavid commented 6 years ago

The data received using the code in https://raw.githubusercontent.com/Martin-Laclaustra/rc-switch/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino is definitely correct. I was just able to spoof the purchased doorbell button and get the purchased doorbell receiver to activate.

Set the protocol to 6, changed the pulse length to 350, and set the repeat transmit to 6.

Anyway, I'll stop spamming everyone. I'm just so excited that this worked.

hycday commented 5 years ago

trying to decode a signal from a Flamingo, model SF-500S, but i am not even receiving anything...any help is welcomed :)

minusdavid commented 5 years ago

I'd suggest reading the comments above.

Play with https://raw.githubusercontent.com/Martin-Laclaustra/rc-switch/protocollessreceiver/examples/ProtocolAnalyzeDemo/ProtocolAnalyzeDemo.ino instead and you'll probably have better luck.

hycday commented 5 years ago

this is what I did, but nothing appears on the serial monitor.... using another brand/remote, it works. As if my Flamingo SF-500S is not detected.

minusdavid commented 5 years ago

Your Flamingo SF-500S looks like it's 433.92 which is the same as my doorbell.

But I'm no expert on RF and I haven't looked at the code for a while.

If it were me, I'd start fiddling with the library. Adding extra diagnostics at the earliest steps.

But hopefully one of the people who know more about RF and this library will comment.

hycday commented 5 years ago

yes it's 433.92 MHz. using the above code, I get mySwitch.available() = false with the SF-500S. I know the code is good because using anoter brand/remote, i get a signal.

So I believe the available() function is "too restrictive" or not detecting anything from the SF-500S. How would I need to modify the library to allow it to detect further signals then ?

EDIT: ok, some improvements ! I followed the steps from https://github.com/sui77/rc-switch/wiki/Add_New_Remote_Part_1 and was actually able to understand a bit more. I was able to capture some stuff, which I guess are usable.

without pressing any button (hence.."noise") i get :

25,111,8,106,21,129,28,165,47,203,18,90,23,65,31,124,275,388,22,142,35,107,26,235,18,284,23,207,25,248,40,102,77,230,26,157,26,108,77,140,25,409,27,208,599,124,159,156,316,128,19,285,83,183,36,256,26,149,17,453,26,96,28,115,25,192,22,312,24,195,28,87,51,104,295,212,26,142,26,122,34,137,38,201,23,195,31,177,41,114,482,219,29,145,25,107,471,150,31,288,20,82,447,85,49,97,28,135,49,88,67,110,23,107,24,248,57,207,35,127,31,141,29,177,42,178,27,196,28,181,20,188,26,100,28,169,19,319,214,94,130,284,34,199,31,112,452,249,23,122,31,132,70,135,24,116,18,189,24,284,26,129,430,105,190,149,26,97,41,81,327,94,34,91,25,225,25,187,27,103,29,105,31,185,97,138,24,119,38,130,282,470,405,365,26,136,323,91,25,95,33,123,30,96,52,137,591,106,26,131,9,204,29,76,14,105,34,128,132,126,23,237,373,98,36,224,4,253,34,139,457,137,8,270,25,152,408,141,34,174,653,106,27,280,33,137,23,134,53,121,31,170,26,280,31,191,25,91,236,192,27,130,655,156,18,179,40,84,33,163,337,122,31,220,27,148,27,98,30,111,172,236,45,210,21,193,23,213,11,255,73,92,27,111,51,105,333,108,26,270,29,106,422,187,128,127,38,132,30,121,278,184,23,147,27,139,100,96,79,105,27,174,34,93,27,148,28,89,98,73,33,70,208,89,17,106,54,126,33,116,48,73,339,124,27,72,53,75,46,129,478,195,34,118,28,152,470,135,35,300,25,153,24,205,34,242,26,198,623,141,23,225,610,196,25,146,24,123,480,158,11,245,23,85,29,178,274,150,27,252,31,97,34,105,309,148,118,100,18,103,488,168,30,83,19,137,50,104,34,162,40,111,23,224,15,265,557,205,24,154,27,135,46,119,27,157,51,242,23,225,26,97,114,78,35,337,23,260,24,106,465,185,94,131,595,204,26,168,25,112,25,124,315,155,29,216,26,108,36,139,26,81,31,93,51,132,28,107,13,142,28,87,106,73,37,88,162,170,26,186,33,163,24,131,31,90,30,267,136,85,34,110,29,114,34,130,35,256,30,90,

A-ON : (3 captures)

305,240,1317,245,297,249,1317,243,308,238,1313,248,301,244,1319,242,301,245,1317,241,303,246,1318,243,304,242,1314,245,302,245,1320,241,1307,248,306,246,307,238,1317,244,306,241,1317,243,315,232,1320,241,1308,245,308,244,10770,249,2579,248,1313,246,301,251,1308,246,302,251,1318,238,307,244,300,246,1315,246,1306,249,307,246,297,250,1311,248,1308,247,301,252,300,244,1319,242,301,245,1319,243,1311,243,314,239,1312,243,306,247,1306,248,306,244,1314,244,306,247,303,243,1313,246,305,241,1322,239,1308,248,307,244,307,240,1313,247,302,245,1316,245,302,242,1313,246,309,239,1319,242,320,225,1311,251,305,240,1314,246,300,246,1312,248,313,231,1315,247,304,242,1315,245,303,244,1316,243,303,243,1312,249,1315,240,312,239,305,242,1318,243,300,246,1323,237,302,245,1312,246,1312,245,306,244,10841,242,2584,247,1319,236,311,241,1306,247,308,247,1312,243,305,248,300,246,1316,243,1307,248,302,251,298,248,1319,243,1312,242,312,240,300,247,1314,246,298,248,1311,247,1315,241,303,250,1309,247,301,252,1305,248,315,240,1308,247,309,243,305,241,1317,244,304,241,1311,249,1318,237,305,248,299,247,1315,246,305,239,1315,246,302,245,1312,248,299,247,1313,247,306,237,1329,235,301,245,1322,239,305,241,1315,244,304,243,1319,240,307,240,1313,245,303,246,1313,246,300,247,1311,249,1313,243,305,246,301,245,1312,249,303,243,1320,240,300,246,1318,243,1311,244,305,246,10777,240,2582,251,1305,247,305,250,1305,249,306,247,1308,247,305,246,301,246,1312,244,1312,247,306,246,301,245,1313,249,1310,244,307,247,301,244,1311,248,302,243,1316,247,1312,241,305,249,1309,246,304,248,1319,236,306,247,1308,247,309,243,308,238,1313,248,301,246,1312,247,1311,244,311,241,305,243,1313,247,301,246,1316,243,304,243,1322,238,305,241,1313,246,302,243,1321,241,305,242,1317,242,301,245,1314,246,303,244,1312,249,300,246,1315,244,303,243,1318,243,306,240,1320,241,1309,243,307,248,303,243,1314,247,305,241,1312,247,306,241,1313,247,1312,244,304,243,10782,237,2584,250,1309,245,304,250,1308,246,306,247,1315,240,305,248,300,246,1313,244,1314,244,304,249,303,243,1311,250,1310,245,307,246,301,245,1319,239,303,244,1315,247,1311,243,307,247,1310,245,307,244,1313,244,304,249,

303,246,1316,245,300,245,1312,250,1316,241,308,243,1317,241,306,250,1311,244,309,244,1307,249,306,248,309,237,1314,248,302,245,1311,251,1313,242,305,249,305,241,1322,238,308,241,1314,245,302,247,1318,242,300,247,1312,249,302,247,1313,248,301,241,1324,241,303,244,1318,244,302,245,1322,239,302,244,1314,248,302,246,1313,244,306,246,1317,244,1311,244,305,247,305,244,1317,244,305,241,1315,247,302,243,1321,243,1317,239,309,243,10773,249,2581,252,1309,245,305,250,1308,248,304,249,1316,237,313,243,305,242,1314,249,1311,245,314,240,301,245,1311,250,1308,249,308,242,310,239,1320,241,304,244,1318,243,1311,246,305,249,1317,238,305,249,1312,243,315,240,1310,248,306,246,303,243,1316,245,305,242,1317,245,1319,238,305,248,310,237,1316,245,308,239,1319,243,311,233,1317,245,302,246,1314,249,312,234,1316,247,306,240,1316,246,307,239,1317,240,305,246,1314,247,302,246,1312,249,301,245,1320,243,303,243,1323,239,1308,244,315,242,302,245,1332,230,302,245,1316,245,307,239,1314,250,1320,235,309,240,10782,239,2584,253,1310,245,306,248,1308,249,301,252,1310,246,311,243,300,246,1312,247,1317,241,313,241,299,248,1311,251,1311,244,305,250,300,246,1321,240,307,238,1316,247,1312,244,307,247,1308,248,307,245,1310,248,309,246,1313,243,306,245,301,246,1314,249,298,247,1323,241,1307,248,309,244,303,244,1314,248,300,246,1316,246,303,243,1316,245,309,239,1321,239,302,246,1317,244,304,243,1315,248,300,246,1315,246,302,244,1330,233,302,241,1322,243,309,237,1322,241,310,236,1313,249,1312,244,312,240,305,243,1318,240,310,242,1313,247,307,239,1322,240,1313,244,307,244,10777,247,2580,252,1311,244,305,246,1315,244,305,249,1307,251,304,247,307,240,1318,244,1311,247,305,247,302,243,1321,243,1315,241,308,245,307,240,1315,246,305,242,1312,250,1312,244,309,243,1317,241,311,243,1314,242,312,242,1313,243,306,248,301,245,1322,239,308,239,1320,242,1308,249,307,245,302,245,1323,239,300,247,1318,243,303,244,1313,248,307,240,1316,245,303,245,1311,251,302,241,1323,241,303,244,1322,241,304,243,1313,247,300,247,1320,241,304,243,1314,244,314,237,1313,248,1310,246,306,248,301,245,1313,248,304,244,1315,245,303,242,1323,241,1310,247,309,242,10837,251,2581,252,

1310,250,1306,250,306,246,301,244,1320,243,304,243,1312,249,303,245,1313,246,302,246,1313,246,307,242,1314,244,303,246,1317,244,312,235,1317,244,305,240,1317,246,303,243,1317,244,310,237,1316,245,301,245,1321,242,1311,243,320,233,304,244,1322,239,301,246,1319,242,302,245,1311,251,1313,242,306,246,10772,249,2584,249,1311,245,303,251,1307,247,307,247,1309,248,301,253,296,249,1312,251,1305,250,317,236,299,247,1314,248,1314,240,306,249,298,248,1312,247,303,246,1312,247,1310,249,300,252,1310,246,301,253,1305,251,303,249,1310,246,307,246,298,246,1315,249,303,245,1310,250,1309,246,310,243,302,245,1314,247,298,249,1320,239,302,247,1314,246,302,245,1323,238,298,248,1314,248,306,240,1317,245,298,248,1313,248,301,247,1318,242,310,237,1310,248,304,246,1314,246,308,238,1315,249,1309,245,311,242,308,239,1310,251,305,239,1317,247,302,245,1314,248,1311,244,311,240,10771,251,2586,248,1312,243,301,253,1311,241,312,245,1323,232,306,249,296,250,1312,248,1314,243,308,244,300,248,1312,246,1311,248,304,249,301,245,1318,244,300,246,1318,243,1314,241,306,248,1311,243,306,250,1310,246,310,243,1312,244,309,244,301,246,1312,248,315,233,1333,227,1312,246,303,249,301,245,1315,248,300,244,1326,235,303,245,1312,249,303,248,1309,249,302,244,1315,245,302,246,1312,245,311,240,1311,249,301,247,1315,245,307,240,1329,233,300,246,1317,244,303,241,1321,242,1315,241,304,250,310,236,1315,247,307,239,1314,248,301,245,1312,248,1319,239,309,241,10775,250,2580,252,1314,240,316,239,1315,240,307,247,1311,244,306,245,307,243,1314,247,1316,239,308,246,299,246,1320,245,1304,250,303,250,311,234,1322,240,301,247,1321,241,1314,241,303,250,1311,244,305,249,1312,244,316,238,1310,246,307,246,306,241,1317,243,307,238,1313,251,1308,248,312,242,303,243,1315,246,302,245,1312,249,308,239,1312,246,314,236,1315,245,309,239,1313,248,313,233,1316,246,308,239,1312,248,307,237,1318,247,304,242,1325,236,301,247,1316,245,303,243,1321,241,1312,243,307,245,305,245,1310,249,306,241,1322,241,299,247,1312,249,1311,246,308,244,10774,250,2584,246,1310,247,309,246,1311,245,312,242,1318,237,308,245,303,244,1328,234,1312,241,310,245,299,248,1312,249,1316,240,304,248,318,229,

A-OFF : (3 captures)

308,237,1324,234,307,239,1315,243,304,242,1318,242,311,233,1320,238,310,236,1315,243,303,241,1318,241,304,242,1315,244,304,242,1318,240,306,240,1312,246,307,239,1320,238,305,241,1322,236,305,241,1315,243,307,239,1315,241,309,238,1320,239,1315,238,315,235,10767,242,2584,245,1313,240,316,236,1310,242,315,238,1313,240,305,247,304,242,1311,247,1312,241,310,242,305,241,1313,245,1309,243,308,245,301,245,1310,247,308,238,1315,243,1311,242,308,245,1311,243,308,243,1311,242,314,239,1311,242,306,246,302,244,1316,241,304,242,1320,239,1321,231,317,233,305,243,1321,237,302,244,1316,242,302,244,1314,243,309,237,1314,245,302,244,1313,244,303,243,1313,245,305,241,1317,240,307,238,1318,241,309,237,1313,245,309,236,1314,245,304,242,1315,243,311,235,1322,235,303,243,1321,237,303,243,1319,239,309,234,1320,241,1317,236,306,244,10774,234,2584,245,1312,242,306,245,1309,244,309,244,1314,238,305,247,301,246,1316,242,1312,241,308,243,310,236,1316,243,1306,247,310,242,303,242,1317,242,304,241,1313,246,1317,234,308,246,1308,246,316,236,1312,241,313,239,1312,241,311,242,303,242,1314,245,300,245,1315,244,1309,244,311,241,306,240,1333,223,307,241,1316,242,310,236,1318,240,310,236,1322,236,306,240,1311,247,311,238,1313,242,312,234,1319,239,305,241,1317,239,311,237,1317,241,308,238,1322,236,305,241,1319,239,305,241,1320,238,305,241,1315,243,306,240,1325,233,306,240,1311,248,1311,240,311,240,10768,242,2588,240,1310,243,309,244,1313,239,314,239,1312,241,307,243,303,244,1314,245,1315,238,315,237,313,233,1318,240,1316,237,308,244,309,237,1315,243,307,239,1314,245,1308,244,307,246,1317,234,308,246,1315,239,308,244,1310,242,312,240,307,239,1313,246,312,233,1317,242,1313,240,315,237,307,239,1322,236,305,238,1323,237,305,241,1313,245,304,242,1316,242,303,243,1319,239,301,246,1322,235,303,243,1317,242,306,239,1317,241,305,241,1315,242,313,234,1315,243,310,236,1323,235,309,237,1323,235,310,236,1315,243,308,238,1319,239,310,236,1323,235,1314,240,312,236,10767,243,2588,241,1314,239,308,245,1312,241,314,238,1314,239,307,245,305,241,1315,242,1313,242,307,244,303,244,1314,244,1320,233,307,245,304,242,1311,247,308,239,1319,238,1311,242,310,243,

312,243,312,233,1310,249,299,247,1319,239,1306,246,305,247,1309,244,310,242,1318,235,303,249,1310,243,306,246,301,244,1320,237,301,246,1313,245,1310,243,306,245,311,235,1313,245,300,247,1316,241,308,238,1308,250,303,242,1311,247,302,243,1314,242,308,240,1313,245,303,242,1314,244,304,242,1313,245,304,243,1311,245,305,241,1320,238,301,244,1320,238,305,241,1316,241,304,241,1333,226,301,245,1316,242,305,240,1313,245,1309,244,304,246,10762,248,2584,243,1312,243,305,248,1309,244,308,243,1311,242,303,248,302,244,1311,248,1307,246,310,241,303,243,1315,243,1312,241,304,248,303,241,1311,249,301,245,1314,243,1313,240,304,249,1307,245,309,244,1309,244,311,241,1311,242,306,246,302,244,1317,240,304,239,1316,246,1305,247,306,247,303,242,1312,246,308,238,1312,245,302,244,1310,248,303,243,1323,235,305,240,1320,238,301,245,1317,239,309,239,1311,247,302,244,1310,247,305,241,1311,247,301,245,1311,246,303,244,1315,243,308,237,1312,246,308,237,1314,243,313,235,1314,244,305,240,1316,242,1309,245,306,245,10765,244,2581,249,1323,229,304,247,1309,245,309,243,1307,246,308,244,312,232,1315,244,1307,247,306,245,303,243,1308,251,1310,243,305,247,298,247,1313,242,305,244,1314,244,1308,246,303,248,1305,248,309,243,1309,244,306,247,1304,248,311,241,300,247,1311,245,298,248,1317,242,1310,241,308,246,307,238,1313,246,305,240,1311,247,298,248,1309,249,308,237,1313,246,299,246,1314,244,301,245,1313,244,303,240,1313,248,307,238,1313,246,306,240,1316,242,304,241,1313,245,301,245,1311,246,308,239,1311,246,302,244,1316,242,303,242,1326,230,307,241,1313,245,1311,242,305,245,10767,245,2578,250,1310,244,306,246,1307,243,322,232,1309,245,304,248,300,246,1310,248,1307,245,305,246,299,248,1314,245,1317,235,304,248,303,243,1312,246,298,247,1312,245,1324,230,306,247,1306,247,307,245,1310,243,305,248,1315,238,305,247,305,245,1306,247,303,243,1309,250,1313,240,307,241,309,240,1314,244,301,244,1311,247,305,241,1311,247,303,243,1309,249,308,238,1312,245,300,246,1320,238,303,243,1314,244,301,243,1317,242,303,243,1311,248,304,241,1310,248,303,243,1312,246,302,244,1321,236,303,243,1314,244,301,245,1316,242,305,238,1317,244,1307,246,306,244,10762,249,

1315,242,302,243,1315,244,299,246,1313,242,307,242,1314,244,306,239,1313,245,1312,242,302,247,10764,247,2579,251,1311,240,306,250,1307,245,304,247,1310,243,318,235,298,243,1316,247,1309,242,306,246,302,244,1312,247,1310,243,303,248,308,239,1311,245,302,246,1306,253,1302,249,308,245,1314,237,309,245,1311,241,314,240,1310,244,299,251,307,239,1312,245,300,246,1311,245,1310,246,302,250,302,244,1307,251,307,239,1316,241,306,240,1308,250,299,247,1313,244,299,248,1313,244,305,241,1308,250,303,240,1312,250,301,244,1310,248,307,238,1314,244,300,247,1311,247,303,242,1312,248,301,244,1315,243,302,243,1309,249,305,239,1316,244,304,242,1311,246,1319,235,310,240,10775,237,2575,254,1304,249,303,250,1312,239,304,249,1313,240,305,247,297,249,1317,237,1310,247,308,243,301,246,1313,245,1304,249,304,247,307,239,1315,243,302,243,1314,245,1310,243,314,239,1305,248,309,243,1308,244,306,248,1306,247,306,246,308,237,1312,247,304,241,1312,247,1309,244,307,241,303,247,1316,241,300,247,1311,246,302,242,1318,242,304,240,1317,241,301,247,1310,247,301,244,1315,245,307,237,1313,242,313,236,1310,248,303,243,1315,242,306,241,1310,247,304,242,1314,244,305,241,1324,234,305,241,1311,248,302,243,1318,238,307,238,1318,242,1312,241,305,246,10766,246,2586,242,1308,246,309,243,1304,248,305,246,1307,249,304,247,297,248,1310,249,1307,246,320,231,308,238,1314,244,1310,244,304,247,301,244,1310,248,299,248,1308,250,1307,244,310,244,1315,237,303,250,1305,247,308,246,1305,247,304,248,309,237,1318,243,304,239,1314,245,1304,248,305,247,300,243,1316,245,300,246,1315,243,303,242,1318,241,304,242,1314,245,301,245,1309,248,303,242,1313,245,302,245,1317,240,307,240,1314,242,309,238,1316,242,302,243,1320,240,301,243,1314,246,310,235,1309,251,303,242,1312,245,309,237,1315,243,305,241,1310,245,1313,243,306,245,10772,241,2580,248,1307,246,309,243,1308,246,303,249,1312,240,303,247,301,247,1310,249,1307,246,302,251,300,242,1312,250,1310,241,308,246,305,240,1315,243,313,232,1320,240,1306,246,318,230,1312,246,307,246,1308,245,306,247,1303,250,302,250,299,246,1317,240,302,244,1324,234,1309,245,310,242,304,243,1317,241,303,240,1316,245,308,237,1312,247,301,

B-ON : (3 captures)

1316,244,1307,246,317,235,304,242,1316,242,305,242,1312,246,302,244,1315,245,301,244,1319,240,306,239,1314,245,301,243,1316,245,305,241,1313,245,302,244,1316,243,309,236,1313,247,303,242,1316,243,312,234,1316,243,1327,226,306,247,305,241,1318,238,312,237,1315,244,1312,241,309,244,300,245,1319,238,10773,244,2580,251,1313,238,309,246,1307,247,312,240,1314,239,310,243,301,244,1312,248,1311,242,310,242,309,237,1318,240,1310,245,309,242,312,235,1316,240,302,246,1314,245,1312,242,309,243,1312,242,304,249,1323,230,313,239,1313,239,311,243,300,247,1312,246,304,241,1311,248,1310,245,306,246,300,246,1318,240,303,243,1324,235,301,245,1313,246,301,242,1315,246,307,239,1313,246,301,244,1311,248,308,238,1310,249,306,241,1311,247,305,241,1311,248,301,244,1321,238,300,246,1319,238,1315,241,311,241,303,243,1315,243,309,238,1317,242,1308,245,311,241,309,237,1310,246,10769,249,2579,251,1305,249,305,247,1313,240,308,245,1306,247,308,245,298,247,1313,247,1304,249,303,249,298,248,1310,247,1309,246,308,244,303,244,1316,242,302,244,1318,241,1306,247,304,250,1311,241,311,242,1307,246,308,246,1307,245,306,246,300,247,1314,244,307,240,1311,248,1310,243,306,246,300,246,1315,244,299,244,1315,246,300,246,1309,250,305,240,1311,249,307,238,1311,248,302,243,1313,246,306,240,1313,246,305,241,1311,247,307,239,1317,240,305,243,1318,241,302,244,1311,248,1309,245,304,248,306,240,1313,245,320,227,1321,238,1309,245,307,244,305,241,1313,242,10772,247,2583,249,1310,243,306,246,1309,244,307,246,1308,246,309,243,298,248,1315,241,1312,244,308,244,305,241,1322,237,1312,242,304,247,309,238,1321,238,307,238,1316,244,1311,243,304,248,1309,244,308,243,1312,243,308,245,1309,244,311,241,301,244,1311,249,302,244,1316,243,1307,244,313,242,304,242,1313,245,303,243,1317,242,301,245,1317,242,305,240,1313,246,306,240,1312,246,304,242,1311,247,302,245,1314,242,302,246,1315,244,305,241,1313,245,307,240,1311,246,310,237,1316,244,1311,242,307,245,305,241,1314,245,306,240,1314,243,1312,243,309,243,302,245,1317,239,10881,239,2581,250,1308,245,305,246,1310,245,304,249,1305,249,304,248,303,242,1311,249,1313,241,313,239,300,245,1311,248,1310,244,313,239,299,247,

1312,246,1314,241,312,239,307,240,1312,247,307,239,1311,246,305,243,1308,251,301,245,1314,246,301,244,1315,244,316,231,1309,249,304,241,1313,247,301,246,1312,246,301,245,1313,244,310,237,1316,243,313,233,1315,244,1310,245,306,246,302,245,1313,246,301,242,1319,243,1312,242,308,243,306,240,1314,245,10769,248,2585,246,1306,247,307,247,1308,243,308,246,1311,244,304,248,301,245,1311,248,1308,245,310,242,299,248,1311,249,1310,243,308,244,305,241,1311,249,302,239,1316,247,1310,244,304,249,1315,239,303,249,1317,238,306,246,1309,244,306,244,304,245,1313,246,302,243,1311,249,1310,244,310,242,308,239,1312,247,302,244,1317,242,311,235,1310,248,301,245,1311,248,300,244,1315,246,308,239,1311,247,307,240,1317,242,300,245,1312,248,305,241,1318,240,303,244,1313,246,301,245,1317,242,1314,237,312,244,301,245,1314,245,300,246,1313,247,1311,242,309,244,299,248,1312,242,10774,242,2594,242,1305,248,306,247,1305,248,316,237,1307,248,306,246,299,246,1315,244,1306,249,304,248,306,240,1312,247,1315,238,304,249,303,244,1310,249,302,244,1312,247,1309,246,308,244,1314,240,307,243,1311,247,308,244,1310,243,309,244,301,245,1313,245,303,243,1315,245,1311,242,307,246,305,241,1319,240,306,240,1314,245,307,237,1316,245,306,241,1312,247,304,241,1313,247,303,243,1314,245,313,234,1318,238,311,236,1326,234,304,241,1317,243,303,241,1319,242,308,238,1319,240,1312,242,308,244,311,235,1317,242,307,239,1320,236,1316,242,309,243,306,240,1322,235,10774,244,2593,238,1315,238,311,242,1309,244,318,233,1316,240,309,243,306,240,1314,245,1309,244,315,238,303,243,1316,244,1310,243,315,238,302,244,1313,246,309,236,1319,238,1313,243,310,243,1310,244,316,238,1312,242,312,240,1312,241,315,239,302,241,1321,239,307,240,1318,243,1313,239,313,240,304,241,1314,245,306,241,1316,243,302,243,1313,247,299,246,1314,246,308,237,1321,236,315,233,1312,249,302,242,1313,246,302,244,1317,243,304,242,1317,242,304,241,1314,246,304,243,1316,242,1311,243,305,246,307,241,1315,243,304,242,1314,246,1309,245,311,242,306,240,1311,245,10873,248,2580,252,1303,251,306,246,1310,243,304,250,1307,246,307,245,302,243,1312,250,1305,248,304,248,301,245,1311,247,1308,247,304,249,301,245,

300,249,1313,245,1302,253,304,248,297,249,1309,249,1307,248,301,251,295,250,1311,249,297,249,1308,251,1313,240,305,248,1303,251,301,251,1305,249,299,254,1303,250,302,250,296,251,1304,255,299,246,1309,248,1306,251,302,249,298,249,1311,248,295,250,1305,254,299,247,1310,249,297,249,1308,251,300,245,1312,247,298,248,1309,247,306,244,1305,253,299,247,1311,247,297,249,1313,247,297,248,1310,249,299,245,1309,252,1302,251,302,251,297,248,1309,251,300,244,1307,254,1306,246,307,247,297,248,1311,247,10768,250,2579,252,1299,254,301,250,1305,250,301,252,1305,249,306,246,301,244,1308,252,1303,250,301,251,298,247,1309,252,1306,247,307,245,298,249,1307,251,304,242,1306,253,1311,243,299,253,1306,248,309,244,1304,249,305,248,1315,239,307,243,304,244,1308,251,298,248,1304,256,1319,234,308,244,304,243,1307,251,304,241,1314,246,303,243,1310,248,299,248,1317,241,302,246,1306,252,303,243,1309,250,305,240,1310,250,296,250,1307,252,297,246,1313,248,298,248,1316,243,295,250,1312,248,1306,248,302,250,299,247,1309,250,298,248,1312,247,1309,245,311,241,300,246,1308,247,10769,252,2580,252,1305,248,304,252,1305,245,298,255,1304,249,303,250,298,244,1315,248,1302,251,305,247,298,249,1309,250,1309,244,306,246,295,252,1311,247,301,245,1310,250,1306,247,302,251,1302,252,301,250,1307,248,306,246,1306,249,300,252,308,238,1310,249,297,249,1308,250,1305,247,306,248,298,248,1313,247,298,248,1309,249,297,249,1310,249,300,246,1311,249,295,249,1316,244,295,250,1313,246,299,245,1313,248,298,248,1309,250,307,239,1314,244,298,249,1313,245,300,247,1308,250,1317,238,311,241,298,248,1313,246,298,248,1311,247,1312,243,304,248,299,246,1311,247,10778,241,2584,247,1301,252,304,250,1303,248,300,255,1302,252,311,240,296,251,1310,249,1303,251,302,250,302,244,1308,250,1310,245,298,253,300,247,1308,251,296,249,1310,249,1308,247,303,250,1309,245,311,242,1304,248,305,248,1313,240,312,241,297,248,1310,250,304,242,1307,252,1304,250,302,250,307,239,1308,251,298,248,1311,247,304,243,1313,246,298,247,1309,250,301,243,1314,248,300,246,1312,246,296,250,1316,243,301,245,1309,250,298,249,1311,245,301,247,1314,245,296,250,1312,247,1309,245,303,249,305,241,1309,

B-OFF : (3 captures)

1311,249,1305,245,310,244,298,247,1315,243,299,248,1313,245,302,243,1312,247,307,238,1325,234,299,246,1312,246,299,247,1312,246,302,240,1319,243,299,247,1319,238,301,246,1314,244,309,235,1320,239,311,236,1314,243,301,245,1310,248,306,240,1313,246,301,244,1310,246,1316,239,308,244,309,237,1317,239,10765,249,2578,252,1303,249,303,250,1314,236,308,247,1307,246,303,249,305,241,1307,251,1304,249,301,251,297,248,1323,237,1310,242,309,243,298,248,1317,241,300,246,1310,246,1306,249,309,244,1309,244,306,247,1306,246,306,247,1307,245,309,244,303,242,1307,251,301,245,1309,251,1306,246,306,242,305,244,1313,245,300,246,1308,250,311,235,1314,244,301,246,1315,242,324,222,1316,242,306,240,1314,244,300,246,1311,247,313,230,1314,248,310,235,1321,237,300,245,1311,247,307,239,1322,236,305,242,1318,238,304,243,1309,249,312,234,1320,238,1313,238,307,247,304,242,1320,236,10766,249,2582,246,1305,248,307,247,1304,248,306,246,1308,244,308,245,304,242,1316,242,1308,245,311,241,305,241,1307,251,1307,246,313,239,297,249,1309,249,304,241,1313,247,1310,239,304,252,1306,247,306,246,1307,246,304,248,1303,250,306,246,301,245,1309,248,306,241,1320,238,1321,232,306,246,308,237,1313,244,299,248,1311,247,298,249,1309,247,301,246,1315,243,297,248,1313,245,306,239,1314,245,298,248,1309,249,304,243,1311,245,306,241,1317,241,301,244,1311,248,304,241,1312,246,306,240,1310,248,300,244,1320,241,303,242,1312,246,1310,243,308,245,304,240,1308,249,10765,248,2585,246,1305,246,306,248,1307,245,301,251,1309,243,304,246,301,247,1314,244,1308,246,303,248,300,246,1311,248,1305,248,308,245,296,248,1311,247,297,249,1313,244,1314,240,304,248,1304,247,318,236,1306,248,307,246,1306,245,307,245,308,238,1310,248,300,245,1315,243,1311,244,309,242,299,247,1314,244,303,241,1316,244,299,246,1312,246,315,231,1311,247,303,243,1309,249,307,239,1311,245,313,234,1318,241,304,243,1316,241,300,247,1310,247,304,242,1317,240,301,245,1318,242,300,245,1314,244,301,245,1320,238,306,238,1312,249,1309,244,307,245,307,238,1317,239,10886,249,2580,248,1311,244,300,252,1307,246,305,248,1305,247,305,247,296,249,1310,250,1309,243,309,243,310,236,1312,247,1308,244,305,247,298,

1313,242,306,245,301,245,1311,245,299,249,1311,248,1313,240,312,241,1307,247,307,245,1306,247,311,241,1310,245,303,248,303,243,1309,250,300,246,1309,249,1314,237,305,249,301,246,1317,240,304,243,1309,250,304,241,1317,242,309,236,1315,244,302,243,1316,244,302,244,1312,245,303,241,1313,248,306,240,1311,247,301,245,1316,243,299,247,1313,245,308,238,1320,237,308,239,1313,246,299,247,1311,248,303,242,1311,247,1324,230,309,244,307,238,1320,237,10766,250,2583,247,1307,246,314,239,1303,246,315,242,1306,247,305,247,301,246,1309,249,1306,248,300,251,304,242,1310,248,1308,246,304,248,304,242,1319,239,300,247,1312,246,1308,246,304,248,1308,248,304,246,1312,243,308,243,1309,245,303,249,298,246,1312,248,303,244,1317,241,1313,240,303,250,308,237,1312,247,298,248,1318,241,297,248,1312,247,300,246,1316,242,309,234,1319,243,304,241,1311,249,306,239,1309,250,303,243,1316,243,302,243,1314,246,300,245,1318,240,299,247,1318,240,305,242,1322,234,305,244,1309,249,299,247,1310,249,1312,241,305,247,300,246,1311,246,10771,246,2578,251,1307,246,317,237,1312,240,303,249,1305,249,303,250,298,247,1308,251,1309,245,306,246,300,246,1320,240,1304,248,325,225,308,240,1317,242,297,248,1310,249,1307,246,310,244,1313,240,308,244,1313,239,311,243,1311,243,318,234,300,245,1313,245,303,243,1312,248,1308,245,304,253,300,241,1317,241,302,244,1312,246,311,233,1315,246,299,247,1311,248,301,244,1319,240,302,243,1317,242,305,241,1318,240,302,244,1312,247,303,243,1321,237,302,244,1316,241,303,244,1315,244,305,241,1322,237,302,243,1315,244,304,241,1316,244,1310,243,307,245,312,235,1321,236,10890,247,2582,248,1311,242,305,247,1311,243,306,246,1310,243,320,232,296,251,1311,246,1307,248,304,248,306,240,1310,249,1312,242,317,235,303,243,1313,244,306,240,1320,241,1313,239,304,250,1313,240,313,239,1307,247,310,242,1308,245,310,242,305,242,1318,239,305,241,1318,241,1310,240,309,247,302,244,1319,240,309,237,1317,241,306,239,1317,242,306,240,1319,240,304,241,1318,241,309,237,1318,240,310,236,1318,239,305,244,1312,247,309,235,1316,243,301,245,1312,246,313,233,1313,246,312,234,1315,243,306,240,1322,236,303,244,1315,242,1312,243,308,244,305,242,1315,241,

299,248,1309,250,1306,247,305,247,300,247,1312,246,1307,246,305,245,304,245,1310,248,301,245,1308,252,1309,244,304,249,1309,245,302,250,1307,245,305,249,1307,247,304,249,298,247,1311,248,309,235,1316,245,1308,246,307,246,299,246,1315,243,301,245,1308,251,302,244,1314,243,302,245,1310,249,305,241,1317,241,298,248,1311,248,302,245,1310,248,303,246,1309,247,306,241,1315,243,304,242,1314,242,303,246,1311,247,301,246,1315,243,300,246,1312,247,302,244,1313,245,1310,244,310,243,309,237,1312,245,10775,244,2581,249,1305,248,302,250,1307,247,302,252,1310,243,306,246,300,246,1312,247,1308,246,313,236,302,248,1311,248,1308,245,309,244,304,241,1309,251,299,246,1310,250,1308,242,317,239,1309,244,310,243,1310,244,304,249,1306,246,306,247,301,245,1314,245,300,245,1315,244,1319,236,307,245,312,234,1315,242,305,242,1313,247,299,247,1310,248,298,248,1312,247,303,244,1315,243,306,240,1310,248,313,234,1313,245,307,239,1309,247,307,242,1316,243,299,247,1314,245,300,246,1316,243,300,245,1313,246,305,241,1315,245,299,246,1318,241,1309,245,309,244,303,240,1315,245,10769,249,2585,246,1314,239,309,243,1316,239,305,246,1305,250,308,241,302,246,1313,247,1304,249,304,248,299,247,1309,251,1304,249,303,250,300,243,1313,247,304,243,1317,242,1309,244,306,249,1304,248,306,246,1306,247,307,246,1310,244,307,245,303,243,1314,244,310,237,1310,247,1309,246,304,249,302,244,1313,246,299,246,1316,244,304,241,1325,234,304,242,1308,252,306,238,1312,247,299,247,1310,247,301,247,1313,246,304,242,1317,243,306,238,1314,246,303,242,1321,238,306,239,1313,247,306,239,1315,245,306,240,1323,237,301,243,1311,249,1313,241,310,243,301,244,1312,245,10892,246,2582,250,1306,246,308,245,1313,241,304,249,1311,241,307,247,300,246,1317,241,1310,241,309,246,309,237,1310,249,1307,247,309,243,301,246,1314,244,302,244,1308,249,1310,246,306,246,1311,243,305,248,1308,246,313,239,1306,248,308,244,304,243,1309,249,303,244,1311,246,1317,237,312,241,302,242,1319,241,307,240,1309,249,306,240,1314,245,303,244,1310,247,299,247,1316,243,302,244,1310,249,308,238,1318,241,299,243,1316,246,302,245,1310,248,303,242,1312,248,313,232,1316,244,311,234,1321,237,301,246,1312,248,

i was able to clearly notice a repeating signal for each of the buttons (hence identify where it starts and ends) as well as see a clear difference at the end of the signal to identify the ON OFF, or the specific button (last 4 high/low are for identifying the button, while last 5th and 6th are for on/off) refer to attached image (only extract of the end of the signals) ; sshots00213

Now comes the next part : what to do with that info...

not sure i know how to convert that into a protocol, nor know how to calculate the pulse length, nor the signal value....

I imagine that for the signal B-OFF for example, which in full would look like such : sshots00215

it would be something like : 1 sync bit then 01010110011001101001010101101001101010101010101010101010101001101

and therefore, for B-ON it would be 1 sync bit then 01010110011001101001010101101001101010101010101010101001101001101

so i need to dig a bit more, but any help is welcomed or at least confirmation about if what i am doing looks at least fine and if i should continue :)

minusdavid commented 5 years ago

Not sure off the top of my head. I know I've gone into the library code and just messed around.

I work as a software engineer though so I'm used to troubleshooting and diagnosing things through a bit of trial and error when there's no obvious faults.

Martin-Laclaustra commented 5 years ago

@hycday You have several problems that make this library unsuitable for your switch. To set you on track, this is are quick hints from observing "A-ON": This is the head of you signal (2 sync bits + 4 first data bits, each bit one timings pair:on-off):

243 10782 237 2584 250 1309 245 304 250 1308 246 306

The signal repeats each 132 timings, that is 2 sync bits 64 data bits. The pulse length is ~260. The syncs are aprox. (1,41) and (1,10), and data are encoded as (1,5) and (1,1) to separate 1s and 0s. The problems are:

With this library you can only expect to mimic the signal, but never to receive it. To achieve this you should use my branch https://github.com/Martin-Laclaustra/rc-switch/tree/transmittimingsarray Search around a little bit in issues and pull request to find out what to do. Best luck!

hycday commented 5 years ago

thanks Martin for your answer. So I found out some elements of answers indeed (in case other are also searching, I believe this comment is good enough : https://github.com/sui77/rc-switch/issues/237#issuecomment-399211046). I will dig more into that to know how to use the info you mentionned and try to understand how to use the transmittimingsarray branch so that i could send arrays.

I now understand that my issues is due to the 2 sync bit, however, I have no idea what that means....and I have no idea how you got all that info by observing A-ON :/ I would really love to understand how you did that, so that I can replicate the same logic for the rest, and also to know what I am doing rather than just "copy paste thanks bye".

I tried to understand; and I wonder if my "logic" is good. so if i clean the A-ON signal by removing all the "duplicates" (easy to do via the visual graph), I have :

244,10770,249,2579,248,1313,246,301,251,1308,246,302,251,1318,238,307,244,300,246,1315,246,1306,249,307,246,297,250,1311,248,1308,247,301,252,300,244,1319,242,301,245,1319,243,1311,243,314,239,1312,243,306,247,1306,248,306,244,1314,244,306,247,303,243,1313,246,305,241,1322,239,1308,248,307,244,307,240,1313,247,302,245,1316,245,302,242,1313,246,309,239,1319,242,320,225,1311,251,305,240,1314,246,300,246,1312,248,313,231,1315,247,304,242,1315,245,303,244,1316,243,303,243,1312,249,1315,240,312,239,305,242,1318,243,300,246,1323,237,302,245,1312,246,1312,245,306

1- I am not sure how to find the real beginning of a signal... why does it start with "244, 10770, 249..." and not one data bit before or after ? how to know that ? I am asking because then it completely changes the way I look at the graph and it can make it "mirrored". I looked at the pattern, and went from one "10000" to another "10000" and basically, in order to keep the minimum to do a loop, it had to start with 244, 10770...is that a good logic or is there a better way to know ?

2- lets say, considering point one is understood, and taking the head signal data bits that you quoted on above comments as example, then are you saying that it is a 2 sync bit signal because of the 10782 and 2584, which are longer than the other 0 and 1 bits that would be around 1300 and 300 ? (also this is visible in the graph because the first 2 are longer than all the rest ?) (see first 2 red lines in image in point 3 below)

3- with that in mind, i then have 2 sync bits, followed by 64 data bits (2+64 red lines in the above image) sshots00216. Ok I think this is clear.

4- then here, i dont get how you found the "every 132 timing", is it 2+64 = 66, x2 = 132 ? which I can also get by counting how many comma separated numbers i have in the signal ?

5- then you got the 260 pulse by looking at the lowest number (average) and you got that the bit sync are (1, 41) and (1,10) by doing 10770/260 = 41 and 2585/260 = 10 approx. then same for 0 and 1. but how do you know if 0 is (1,1) and 1 is (1,5) or 0 is (1,5) and 1 is (1,1) ?

So I think I get it better if this is it. I only need to understand how to use these info to create a new protocol and send my signal A-ON (1010100110011001011010101001011001010101010101010101011001010110) I tried "normalizing" the signal and got

260,10660,260,2600,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,1300,260,260

Then I tried the below, but it didnt work...

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

unsigned int data[]   = {260,10660,260,2600,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,1300,260,260,260,260,260,1300,260,260,260,1300,260,260,260,1300,260,1300,260,260, 0};

void setup() {
  mySwitch.enableTransmit(13);  
}

void loop() {
  mySwitch.send(data);
  delay(200);
}

data being a starting-low zero-terminated array of timings...not sure if I need to do anything else now...but no success till now (but at least i have a feeling i understand more)

EDIT : just out of curiosity, i "mirrored" the signal, and tried as if the starting sync bit are 10660, 260, 2600, 260, and it works perfectly now !!! so not sure about where i would use the info about the data bit (1,1), (1,5) the sync bits (1,41) and (1,10) since i only need to "copy paste" the whole 132 bits, but at least i know what i am doing..or i think i do.

Thanks again ! hope this helps any one else

181221 commented 5 years ago

@SebastianGrans I got the same remote sockets that you have, but I am not able to get it to work. How did you get it to work? Can you post your codes, maybe I can try them and see if they work for me to?

SebastianGrans commented 5 years ago

@SebastianGrans I got the same remote sockets that you have, but I am not able to get it to work. How did you get it to work? Can you post your codes, maybe I can try them and see if they work for me to?

I tried to document everything I did and it should be available here: http://sebastiangrans.github.io

Good luck :)