rc-switch icon indicating copy to clipboard operation
rc-switch copied to clipboard

Timing Issues on ESP32?

Open zahlex opened this issue 6 years ago • 5 comments

First of all: Thank you for this amazing library. This code is structured and written so well, it almost makes sense to me, even if I have literally zero experience with C++.

But nevertheless, I'm sadly not able to get the sending part working on my ESP32 board. (Receiving works just fine.) After discovering the codes my remote is using via the ReceiveDemo_Advanced Sketch, I modified the SendDemo Sketch to the following:

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {

  Serial.begin(9600);
  
  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);
  
  // Optional set protocol (default is 1, will work for most outlets)
  mySwitch.setProtocol(1);

  // Optional set pulse length.
  mySwitch.setPulseLength(185);
  
  // Optional set number of transmission repetitions.
  mySwitch.setRepeatTransmit(5);
  
}

void loop() {
  
  mySwitch.send(284099, 24); // ZAP 0311, CH2, ON
  delay(5000);  
  
  mySwitch.send(284108, 24); // ZAP 0311, CH2, OFF
  delay(5000);
    
}

And it works like a charm on my Arduino Uno. After getting that working, I tried to take it one step further and compiled the Sketch for my ESP32. Result: The Transmitter is working as a radio jammer. I cannot even use my remote, while the ESP32 is running this Sketch. So I assume some timing related things are totally out of control.

I've tried multiple pins and my board is an NodeMCU-32S with an ESP-WROOM-32 Module. I really hope, somebody has an idea how to solve this issue. If more information is needed, just let me know. Thanks in advance!

zahlex avatar Dec 11 '17 04:12 zahlex