esp-homekit: PWM Frequency > ~1kHz Causes All Clients to Disconnect

Hey,

As soon as I enable the ESP8266 RTOS SDK PWM Driver (https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/components/esp8266/driver/pwm.c), then randomly after a few seconds to a few minutes, all clients get disconnected and cannot connect again. Pairing is also impossible to do whilst it is running. The startup code is simply;

    #define PWM_PERIOD 1000
    uint32_t duties = 100;
    uint32_t pin_num = 2;

    pwm_init(PWM_PERIOD, &duties, 1, &pin_num);
    pwm_set_phase(0, 0); 
    pwm_start();

Any thoughts? Probably an issue with interrupts messing up timing…?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

It’s the NodeMCU3 onboard LED’s close proximity to the Wi-Fi antenna. I set up the interrupts to fire off very fast but without turning the LED on or off. No issues. I added an external LED, no issues.