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();
 }
}```
asked Apr 29, 2021 at 14:10
6
  • Please include the wiring and your code into the question. You can edit it to add these information. Commented Apr 29, 2021 at 14:16
  • Maybe it's related with 3.3V/5V difference? Commented Apr 29, 2021 at 14:17
  • @chrisl I have also put up the code Commented 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 Commented 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 Commented 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...

answered May 21, 2021 at 15:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.