ESPEasy - Device=PushButton - Delays of feedback [ISSUE FIXED]
Moderators: grovkillen, Stuntteam, TD-er
ESPEasy - Device=PushButton - Delays of feedback [ISSUE FIXED]
Hi, I've been running this issue since I started using ESPEasy and I cannot find a way to solve it even looking at the code.
I setup a push button (physically attached to GPIO13/D7 to one of my unit) as per below:
No matter what I setup (I tried literally everythign!) once I press the button I've an immediate change of its status to "1" that is triggering a relay.
But it takes around 1300ms (as per below screeshot) after I release the button until the device status is back to 0; this means if someone push the button meanwhile nothing happens!!!
How can I have immediate reset of device status once button is released?
I've a virtual switch on node-red that sends on/off command to the same relay and this is perfectly working and I can send command once after the other without delays or lags.
If anyone can help or address me to the right piece of code handling this behaviour I'll be very thankfull...
I setup a push button (physically attached to GPIO13/D7 to one of my unit) as per below:
No matter what I setup (I tried literally everythign!) once I press the button I've an immediate change of its status to "1" that is triggering a relay.
But it takes around 1300ms (as per below screeshot) after I release the button until the device status is back to 0; this means if someone push the button meanwhile nothing happens!!!
How can I have immediate reset of device status once button is released?
I've a virtual switch on node-red that sends on/off command to the same relay and this is perfectly working and I can send command once after the other without delays or lags.
If anyone can help or address me to the right piece of code handling this behaviour I'll be very thankfull...
Last edited by papperone on 27 Oct 2016, 11:11, edited 1 time in total.
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
Am I the only one with this problem?
Isn't there any other user using ESPEasy to get input from a physical push-button?
Isn't there any other user using ESPEasy to get input from a physical push-button?
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
Hi !
EVENT: indicates that you are using Rules ...
And the Rules are only fired once a second. Look at the code:
I think that is your missing second ... And while the runOncePerSecond has to do a lot other stuff ... You end up with 1300ms ...
I suppose
EVENT: indicates that you are using Rules ...
And the Rules are only fired once a second. Look at the code:
Code: Select all
void runOncePerSecond()
{
.....
if (Settings.UseRules)
rulesTimers();
I suppose
regards
Dominik
Dominik
Re: ESPEasy - Device=PushButton - Delays of feedback
Thanks moelski, this indeed makes sense...moelski wrote:Hi !
EVENT: indicates that you are using Rules ...
And the Rules are only fired once a second. Look at the code:I think that is your missing second ... And while the runOncePerSecond has to do a lot other stuff ... You end up with 1300ms ...Code: Select all
void runOncePerSecond() { ..... if (Settings.UseRules) rulesTimers();
I suppose
Now the issue is how to fix it I will give a thought this evening once back home...
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
Hi !
* You could move the rule handling in the 100ms timer...
* You can add a custom timer for rules ... (I have done that with my Wifi Candle. It uses 40Hz update rate ...)
* Maybe write a plugin that don´t depend on rules ...
I think there are quit a few options. But most of them need coding ...
Good questionNow the issue is how to fix it
* You could move the rule handling in the 100ms timer...
* You can add a custom timer for rules ... (I have done that with my Wifi Candle. It uses 40Hz update rate ...)
* Maybe write a plugin that don´t depend on rules ...
I think there are quit a few options. But most of them need coding ...
regards
Dominik
Dominik
Re: ESPEasy - Device=PushButton - Delays of feedback
Coding is the less of my worries I just want make sure I choose the best option with minimal impact for me.
I guess the safest is to write my own plugin so I will disconnect from all the rules while maintaininig easy upgrate to future version of ESPEasy, but I do like as well the custom timer option...
I need further testing as I do believe there are other sources of delays, in the way the switch is handled in ESPEasy actual code, but it's just a sensation that needs to be confirmed or not looking to the code!
Will keep you updated on the evolution...
I guess the safest is to write my own plugin so I will disconnect from all the rules while maintaininig easy upgrate to future version of ESPEasy, but I do like as well the custom timer option...
I need further testing as I do believe there are other sources of delays, in the way the switch is handled in ESPEasy actual code, but it's just a sensation that needs to be confirmed or not looking to the code!
Will keep you updated on the evolution...
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
Can you elaborate a bit more on this? Maybe shareing your wifi candle code will help me to leverage this technique and try to implement it for my push button handling...moelski wrote:* You can add a custom timer for rules ... (I have done that with my Wifi Candle. It uses 40Hz update rate ...)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
This could be due to the default 1000 mSec delay after sending stuff to your controller. Try what happens if you set it to 0.papperone wrote:Hi, I've been running this issue since I started using ESPEasy and I cannot find a way to solve it even looking at the code.
I setup a push button (physically attached to GPIO13/D7 to one of my unit) as per below:
No matter what I setup (I tried literally everythign!) once I press the button I've an immediate change of its status to "1" that is triggering a relay.
But it takes around 1300ms (as per below screeshot) after I release the button until the device status is back to 0; this means if someone push the button meanwhile nothing happens!!!
How can I have immediate reset of device status once button is released?
I've a virtual switch on node-red that sends on/off command to the same relay and this is perfectly working and I can send command once after the other without delays or lags.
If anyone can help or address me to the right piece of code handling this behaviour I'll be very thankfull...
Re: ESPEasy - Device=PushButton - Delays of feedback
I am not sure I understand. I don't see any delay parameter in the controller setup I have when I connect to ESPEasy device. Can you help clarify?Martinus wrote: This could be due to the default 1000 mSec delay after sending stuff to your controller. Try what happens if you set it to 0.
PS in RC firmware the footer should be changed to new domain instead of www.esp8266.nu
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Re: ESPEasy - Device=PushButton - Delays of feedback
Check this setting in tools/advanced menu:
Message Delay (ms):
defaults to 1000 but can be lowered. This could be the delay that you're experiencing.
Message Delay (ms):
defaults to 1000 but can be lowered. This could be the delay that you're experiencing.
Re: ESPEasy - Device=PushButton - Delays of feedback
Thanks Martinus, that was it! I admit I've never realize there was such parameter in the Advanced Tab.Martinus wrote:Check this setting in tools/advanced menu:
Message Delay (ms):
defaults to 1000 but can be lowered. This could be the delay that you're experiencing.
FYI bringing it to 0 did not work as the button behaviour was faster but unstable, with lots of false event.
With tome trial&error I set it to 100ms, really stable and button reacts real time even with multiple pushes one after the other!
Thanks again, I'll update the title as issue is fixed
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: ESPEasy - Device=PushButton - Delays of feedback [ISSUE FIXED]
Thanks Martinus for this explanation.
I thought this variable was related to MQTT only.
Some of my DS18B20 have an update rate of 500msec (close to the heater), so I tried to lower the message delay to 400msec.
The result was a very spiked memory usage: from normal operation 20300 bytes down to spikes of 14200 and even 12600.
Can you understand why? Is it something to worry about?
Martinus, what will happen with the measurements made every 500msec when the messages to the controller are send only every 1000msec?
@papperone: did you check your memory usage with the 100msec setting?
Thanks
Domosapiens
I thought this variable was related to MQTT only.
Some of my DS18B20 have an update rate of 500msec (close to the heater), so I tried to lower the message delay to 400msec.
The result was a very spiked memory usage: from normal operation 20300 bytes down to spikes of 14200 and even 12600.
Can you understand why? Is it something to worry about?
Martinus, what will happen with the measurements made every 500msec when the messages to the controller are send only every 1000msec?
@papperone: did you check your memory usage with the 100msec setting?
Thanks
Domosapiens
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: ESPEasy - Device=PushButton - Delays of feedback [ISSUE FIXED]
I did and I saw no differences... this setting, in my case, was only affecting the reactiveness of some devices (swtiches) that's it...Domosapiens wrote: ↑14 Nov 2017, 23:50 Thanks Martinus for this explanation.
I thought this variable was related to MQTT only.
Some of my DS18B20 have an update rate of 500msec (close to the heater), so I tried to lower the message delay to 400msec.
The result was a very spiked memory usage: from normal operation 20300 bytes down to spikes of 14200 and even 12600.
Can you understand why? Is it something to worry about?
Martinus, what will happen with the measurements made every 500msec when the messages to the controller are send only every 1000msec?
@papperone: did you check your memory usage with the 100msec setting?
Thanks
Domosapiens
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone
Who is online
Users browsing this forum: No registered users and 26 guests