Page 1 of 1

ESP output flickering

Posted: Friday 05 January 2024 14:28
by Rosomak
I have been struggling with this problem for several years and I can't cope.
ESP Output turns on and off very fast after reboot for a few or a dozen or so seconds. (Sometimes this happens when you quickly turn the switch on and off).

Domoticz ver: 2023/2 on Raspberry Pi
ESP_Easy: mega-20231225

Although it doesn't matter because it is not dependent on the software version or whether it is esp32 or esp8266.
It looks as if Domoticz was shouting over ESP Easy and vice versa, how to set the output.

Removing On/Off action from switch settings ends this behavior, but then Im not able to control output from Domoticz dashboard.

Domoticz:
I created dummy hardware with virtual sensor type: Switch with Idx:127
Inside switch settings I created http request to turn on or off ESP output.
ESP Easy:
I created two devices, one for ESP output with Idx: 127 called "Light" and one for ESP input.
I also make one rule:

Code: Select all

On System#Boot do
 gpio,14,0
endon

On Input#State=0 do
 if[Light#State]=0
  gpio,14,1
 else
  gpio,14,0
 endif
endon
Its a very minimal setup but is killing me when during night, after ESP reboot due to network failure I have a DISCO at home :(
Any sugestions ?

Re: ESP output flickering

Posted: Friday 05 January 2024 16:36
by jvdz
You do not have the internal pull-up active for gpio14, so do you have a resistor to pull it down or up to garantee it's default state?

Re: ESP output flickering

Posted: Friday 05 January 2024 18:32
by Rosomak
jvdz wrote: Friday 05 January 2024 16:36 You do not have the internal pull-up active for gpio14, so do you have a resistor to pull it down or up to garantee it's default state?
It has no effect. Neither internal pullup nor resistor helps.
There doesn't even have to be an input device and rules can be empty.
Don't tell me that no one has this problem?

Re: ESP output flickering

Posted: Monday 08 January 2024 23:32
by RonkA
Not having this problem myself but maybe:

Code: Select all

On System#Boot do
 gpio,4,0
 gpio,14,0
endon
Also do you have debounce set on the swich?

Re: ESP output flickering

Posted: Tuesday 09 January 2024 15:12
by Rosomak
Hi RonkA,
Thank you for your post.

I did a minimal setup now. One device in Domoticz and one device in ESP. No Rules, No PB Switch, External 10k pullup resistor at the output. Please see what is happening with the output when I change the state fast enough.
[youtube]https://youtube.com/shorts/cuNayzz_o9w?feature=share[/youtube]

I noticed it is worst when network is busy. And once again it does not mether I use sonoff, nodemcu, my own design esp8266 or esp32.

One thing that helps a lot is to change "Check Replay:" to 'Check Acknowledgment'.

Re: ESP output flickering

Posted: Wednesday 10 January 2024 13:31
by RonkA
Inputswich called Output... As if live is not complex enough! :lol:

Anyhoe.. i'm no expert but on my Esp's i use the Domoticz HTTP controller for sensors and for swiches i have Domoticz MQTT running..
Why i did it like this is cannot remember but swiching works fine without your described problems in my setup..

Also i don't see the benefit of looping the state of the swich back to the Esp32 with the On- and Off action part..
Maybe try it without the on off triggers.

Re: ESP output flickering

Posted: Wednesday 17 January 2024 8:17
by Rosomak
RonkA wrote: Wednesday 10 January 2024 13:31 Also i don't see the benefit of looping the state of the swich back to the Esp32 with the On- and Off action part..
Maybe try it without the on off triggers.
Without this funcktion I cant change state by clicking icon in domoticz.
RonkA wrote: Wednesday 10 January 2024 13:31 Anyhoe.. i'm no expert but on my Esp's i use the Domoticz HTTP controller for sensors and for swiches i have Domoticz MQTT running..
Why i did it like this is cannot remember but swiching works fine without your described problems in my setup..
I know and you are right, MQTT solves this problem.

After thinking its a time now to move my system to industry 4.0, so I'm facing complete rebuild.
Thanks for help every one.