PWM dimming, delay, decreasing??
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
PWM dimming, delay, decreasing??
Hi,
I'm trying to convert an old avr dimmer to esp8266 with espeasy. So far, hardware works as expected... However, it seems like, when setting the pwm, for example
pwm=12,1024,1000 -> ok nice and smooth
pwm=12,100,1000 -> it goes to 0 and then starts to increase to 100, instead of decreasing from 1024
if you set
pwm=12,0,1000 -> immediately off
is this intentionally or a bug??
I'm trying to convert an old avr dimmer to esp8266 with espeasy. So far, hardware works as expected... However, it seems like, when setting the pwm, for example
pwm=12,1024,1000 -> ok nice and smooth
pwm=12,100,1000 -> it goes to 0 and then starts to increase to 100, instead of decreasing from 1024
if you set
pwm=12,0,1000 -> immediately off
is this intentionally or a bug??
Re: PWM dimming, delay, decreasing??
I reviewed _P001_Switch.ino to see if there is an explanation. As written, PWM (with optional duration function) is configured to "increase" the PWM value (e.g., brighten effect). It does not offer a traditional fade. But it will wrap around to a lower PWM value when the new PWM value is smaller than the previous. This matches what you are seeing.

- Thomas
I would label it as an intentional bug.is this intentionally or a bug??

- Thomas
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
Re: PWM dimming, delay, decreasing??
what a mess.
mega-20181028 is able to slowly dim down.
are there any notes, why the behaviour was changed?
mega-20181028 is able to slowly dim down.
are there any notes, why the behaviour was changed?
Re: PWM dimming, delay, decreasing??
The switch plugin went through some changes a few weeks ago. There was some discussion on it doing too much. Then it was reverted after things broke. I'm surprised you see it working differently than before.
- Thomas
- Thomas
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
Re: PWM dimming, delay, decreasing??
also, while I'm complaining like an old woman.... an option to set the pwm frequency would be great. like pwmfreq=100 for 100hz
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: PWM dimming, delay, decreasing??
https://espeasy.readthedocs.io/en/lates ... hlight=pwmPWM,<GPIO>,<duty>,<duration>,<frequency>
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: PWM dimming, delay, decreasing??
This is a known bug !!
Use a version with Core 2.4.1, all is fine ...
I use ESPEasy_mega-20180506 and PWM is working.
Use a version with Core 2.4.1, all is fine ...
I use ESPEasy_mega-20180506 and PWM is working.
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
Re: PWM dimming, delay, decreasing??
oh,
and I want to add:
/control?cmd=pwm,2,512,7000,500
-> I cannot find any release, where the pwmfreq is set to 500 either
its broken.
and I want to add:
/control?cmd=pwm,2,512,7000,500
-> I cannot find any release, where the pwmfreq is set to 500 either
its broken.
Re: PWM dimming, delay, decreasing??
As a said, try ESPEasy_mega-20180506 and all is fine ..bastibasti wrote: ↑13 Apr 2019, 23:05No it isn't.... dimming down doesnt work on the 20190413 core241 i just loaded
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
Re: PWM dimming, delay, decreasing??
I decided to go a different route. I'm currently making a wemos d1 shield with an avr that handles the pwm. (the easyesp also cannot simultaneously dim)


-
- New user
- Posts: 5
- Joined: 04 Jan 2018, 17:05
Re: PWM dimming, delay, decreasing??
I can confirm this is still an issue. I can fade up just fine, but cannot fade down. I can also confirm that loading the much older 2018-05-06 version, fading down works just fine. What's the deal with getting this fixed, since this seems to be a regression from over a year ago?
Re: PWM dimming, delay, decreasing??
I'm interested to have the Hardware project, can you share?
MArco
-
- Normal user
- Posts: 25
- Joined: 31 Jul 2018, 11:41
Re: PWM dimming, delay, decreasing??
... so far still making changes and adjusting. might need a little change in hardware if i cannot adjust the speed correctly. I will reply to you later
Re: PWM dimming, delay, decreasing??
This issue was caused by the pin state monitor which has been changed a while ago.
This tried to store the current PWM value in a parameter of only a few bits.
I just created a fix for this and it will be merged later today (and thus included in tomorrow's build)
This tried to store the current PWM value in a parameter of only a few bits.
I just created a fix for this and it will be merged later today (and thus included in tomorrow's build)
Who is online
Users browsing this forum: Bing [Bot] and 13 guests