Page 1 of 1

Wemos D1 mini and flickering PWM

Posted: 02 Jan 2018, 14:46
by xl15
I run ESP Easy 2 on a Wemos D1 mini. It controls a 12 V LED spotlight via a mosfet and it works fine.
But when I added a light sensor that sends its value via MQTT once a minute, I get a flicker once a minute.
It's like the pwm output gets high when the Wemos sends data. A very short while, but it looks like an annoying flash.

Re: Wemos D1 mini and flickering PWM

Posted: 02 Jan 2018, 21:29
by TD-er
Just a notice, I added this topic to the following issue on Github: https://github.com/letscontrolit/ESPEasy/issues/672

Re: Wemos D1 mini and flickering PWM

Posted: 03 Jan 2018, 14:57
by Shardan
The ESP8266 is single threaded - the cpu can only do one job at a given time.
So if the cpu is occupied working on the rules the PWM stops for a moment as it is software controlled.

I've noticed that with controlling fan speed in a dust sensor with a lot of rules.
Fan stops every second, same as flickering with your LED.

For LEDs the solution is atm to use a PCA9685 PWM chip.
Possibly you might have to change the plugin a bit for driving a MOSFet as it is set for driving a small LED directly.
The setting can't be changed vie the WEB GUI at this time.

This is described in the github issue #651 https://github.com/letscontrolit/ESPEasy/issues/651

Regards
Shardan