0

I'm trying to decide my rf remote signals using ESP32 or node MCU. I have tried with Arduino and was successful but for some reason it is not working on either ESP32 or node MCU even using the same GPIO2 pin can anyone please tell me why both the boards are not able to decode the signal. I'm using the rc-switch library to decode and a 433Mhz transmitter reciever combo from amazon


RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
    mySwitch.resetAvailable();
  }
}```
6
  • Please include the wiring and your code into the question. You can edit it to add these information.
    – chrisl
    Apr 29, 2021 at 14:16
  • Maybe it's related with 3.3V/5V difference? Apr 29, 2021 at 14:17
  • @chrisl I have also put up the code Apr 29, 2021 at 14:30
  • @MichelKeijzers I used the vin pin on both the boards which provide 5v and the reciever also works on 5v so I don't this that's the case and also I used the 5v pin on Arduino just to be sure Apr 29, 2021 at 14:32
  • io 0 has a pull-up resistor because it is a boot config pin and on esp the interrupt pin numbers are the same as the labels on ocb
    – Juraj
    Apr 29, 2021 at 15:05

1 Answer 1

1

For ESP32, you should provide real GPIO number. For instance: mySwitch.enableReceive(13);

And without deep explanation, believe that it properly works with GPIO 13 and 27.
Details you can find by google...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.