sui77 / rc-switch

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

Problem recieving anything #96

Open Edvin85 opened 8 years ago

Edvin85 commented 8 years ago

Hi, looks like a great library, but i have some problems getting this to work. I uploaded RecieveDemo-simple example to my UNO R3 board, (also tried on MEGA2560) using Adruino version 1.6.13. Under upload i get this warning in the window: "WARNING: Category 'Device Control, Signal Input/Output' in library rc-switch is not valid. Setting to 'Uncategorized'" I connected reciever as described with the data pin to interrupt 0 (D2). When looking in the serial monitor with baud9600, nothing happens I have beed trying those units: Nexa handheld switch Nexa Wall switch Nexa timer remote ESIC temperature transmitter

I have been using this reciever to other home automation projects with other librarys with success, an i can see the reciever picup signals from all units if i connect a led to the datapin.

What am i missing here?

Best regards

alexschwantes commented 7 years ago

I could be wrong, but I don't think nexa is supported.. At least I couldn't get it to work.

bphermansson commented 7 years ago

Just tried with a Arduino Duemilanove and Nexas PAT-103 remote, works fine.

Totoche95 commented 7 years ago

I also connected a receiver on D2 (i see signal on scope) and program an Arduino Uno with simple_receive sketch. Nothing on serial. I added two lines in interrupt routine to make the Led blink when signal receive , and it blinks irregularely (good! )(continuously because i am in center town with many signal arround) so signal arrive and interrupt runs. But that is strange is with hundreds of 433MHz signal, none is seen on serial.

void RECEIVE_ATTR RCSwitch::handleInterrupt() { static unsigned int changeCount = 0; static unsigned long lastTime = 0; static unsigned int repeatCount = 0;

const long time = micros(); const unsigned int duration = time - lastTime;

xi = -xi; // defined at 1 in global scope;

if (duration > RCSwitch::nSeparationLimit) { // A long stretch without signal level change occurred. This could // be the gap between two transmission.

if (xi == 1) digitalWrite(13, HIGH); // Led blinks when receive signal from 433MHz module (Added)
  else  digitalWrite(13, LOW);

if (diff(duration, RCSwitch::timings[0]) < 200) {
  // This long signal is close in length to the long signal which
  // started the previously recorded timings; this suggests that
  // it may indeed by a a gap between two transmissions (we assume
  // here that a sender will send the signal multiple times,
  // with roughly the same gap between them).
  repeatCount++;
  if (repeatCount == 2) {
    for(unsigned int i = 1; i <= numProto; i++) {
      if (receiveProtocol(i, changeCount)) {
        // receive succeeded for protocol i
        break;
      }
    }
    repeatCount = 0;
  }
}
changeCount = 0;

}

Totoche95 commented 7 years ago

OK, i commented the line // detect overflow
if (changeCount >= RCSWITCH_MAX_CHANGES) {

So it accept long frames, it cannot decode it (it is a 433MHz thermometer sensor) but i know it works fine. Cheers

Received 484 / 4032bit Protocol: 1960 Unknown encodingReceived 4032 / 488bit Protocol: 484 Received 4032 / 484bit Protocol: 488 Received 4028 / 484bit Protocol: 488 Received 4028 / 488bit Protocol: 492 Received 1952 / 488bit Protocol: 488 Received 4044 / 468bit Protocol: 468 Received 4048 / 468bit Protocol: 472

alexschwantes commented 7 years ago

Just to further clarify why it didn't work for me. I had tried to get it working with a Nexa PE-3 remote (https://www.nexa.se/vara-produkter/system-nexa/paket/pe3) and it didn't work as it uses a different (newer) protocol. These blogs describe the newer protocol http://tech.jolowe.se/home-automation-rf-protocols/ , http://dephiox.blogspot.no/2013/01/decoding-new-nexa-protocol.html

I used https://github.com/JoakimWesslen/Tx433_Nexa as a base along with piscope to find the code being sent. It worked after a lot of effort, but in the end I found RF just not as reliable as a wifi switch.