Hello,
I was searching in source code of ESPEasy in branch "mega" for a place, when interrupt (irq / external even listener / isr ... however you call it) is configured on GPIO, if such GPIO is configured for switch.
However i didn't find any. I only found a piece of code, which is called 10x per second and reading value.
Did I overlook it, or is there really no interrupt registered and only relying on fact, that one of these reads will detect pressed state (specially if i have push button)? Cannot it then happen, that button press was in between of two checks and hence not detected at all?
thank you
best regards
jano
reading of events on gpio pins for switch
Moderators: grovkillen, Stuntteam, TD-er
Re: reading of events on gpio pins for switch
attachInterrupt() is what you looking for. You can see a usage example in my Pushbutton plugin. Also you can use it, if it's functionality is enough for you. There are some serious requirements against event handler, such as being static and being global.android12 wrote: ↑26 Sep 2018, 22:37 Hello,
I was searching in source code of ESPEasy in branch "mega" for a place, when interrupt (irq / external even listener / isr ... however you call it) is configured on GPIO, if such GPIO is configured for switch.
However i didn't find any. I only found a piece of code, which is called 10x per second and reading value.
Did I overlook it, or is there really no interrupt registered and only relying on fact, that one of these reads will detect pressed state (specially if i have push button)? Cannot it then happen, that button press was in between of two checks and hence not detected at all?
thank you
best regards
jano
https://github.com/enesbcs/ESPEasyPlugi ... button.ino
Re: reading of events on gpio pins for switch
Hi,
thanks for plugin. I'll consider it, if i'm forced to do build for myself.
I was asking about official "standard" builds, as we these it's not a problem for me to do such a short button press, that it's not detected at all. Also in real life, it happens to me like each 20-50th click is not recognized by easyesp.
And from source analysis it looks to me, it's loosing events just becase there is only poller user, but no attachInterrupts and ISR.
I was already thinking to switch to uPY, but there i also cannot find it in sources.
So if i got it confirmed, that there are no interrupts used in standard builds,then i can move on, and look for solution like custom build, or own script instead of easyESP etc.
thank you
best regards
jano
thanks for plugin. I'll consider it, if i'm forced to do build for myself.
I was asking about official "standard" builds, as we these it's not a problem for me to do such a short button press, that it's not detected at all. Also in real life, it happens to me like each 20-50th click is not recognized by easyesp.
And from source analysis it looks to me, it's loosing events just becase there is only poller user, but no attachInterrupts and ISR.
I was already thinking to switch to uPY, but there i also cannot find it in sources.
So if i got it confirmed, that there are no interrupts used in standard builds,then i can move on, and look for solution like custom build, or own script instead of easyESP etc.
thank you
best regards
jano
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: reading of events on gpio pins for switch
I suggest you look into the message delay in advanced settings. It should be 100mSec not 1000mSec.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: reading of events on gpio pins for switch
Hi,
delays in unchanged (0) but i don't use any controllers. I send UDP message from rule instead. But even without that, only when counting events in rules, i see there are lost ones.
IMHO due to fact, that it's not using interrupts to read GPIO changes.
thank you
best regards
jano
delays in unchanged (0) but i don't use any controllers. I send UDP message from rule instead. But even without that, only when counting events in rules, i see there are lost ones.
IMHO due to fact, that it's not using interrupts to read GPIO changes.
thank you
best regards
jano
Re: reading of events on gpio pins for switch
The pulsecounter plugin can use interrupts to read GPIO pins.
But only for the first 4 plugin positions in the list on the Devices tab.
But only for the first 4 plugin positions in the list on the Devices tab.
Who is online
Users browsing this forum: No registered users and 34 guests