Page 1 of 1

Longpress only works once

Posted: 03 Feb 2021, 12:23
by herber_ch
hi

In my test setup, longpress only works once after starting. I have eight buttons (on a switch input - PCF8574), the long press event is only sent once for each.

Code: Select all

First time after boot:
21065: PCF : Port=3 State=1 Output value=1
21167: EVENT: SW03#SW03=1
21203: PCF : LongPress: Port= 3 State=1 Output value=11
21239: EVENT: SW03#SW03=11
24265: PCF : Port=3 State=0 Output value=0
24305: EVENT: SW03#SW03=0

Code: Select all

Second time after boot:
40765: PCF : Port=3 State=1 Output value=1
40802: EVENT: SW03#SW03=1
44265: PCF : Port=3 State=0 Output value=0
44363: EVENT: SW03#SW03=0
Longpress min. interval (ms) ist set to 1000ms and running ESP_Easy_mega_20210114_normal_ESP8266_4M1M. Any ideas or help?


Thanks.

Re: Longpress only works once

Posted: 03 Feb 2021, 16:18
by leel1967l
Will have a look at it.
Can you post the screenshot of the device configuration?

Re: Longpress only works once

Posted: 04 Feb 2021, 11:14
by herber_ch
thanks, here is my configuration

Re: Longpress only works once

Posted: 04 Feb 2021, 19:03
by leel1967l
You are using an inverted logic, where HIGH=1.
Have you tried to flag the "Inverted Logic" option?

Re: Longpress only works once

Posted: 06 Feb 2021, 21:35
by herber_ch
Thanks, but I didn't see why i use inverted logic? For me 1=HIGH ist normal :?

I still activated the option and tried all possible settings. All variants send LONGPRESS only once.

Then I did a downgrade (mega-20200426). With this version everything works correctly, LONGPRESS is sent every time.

What may have changed since this version?

Re: Longpress only works once

Posted: 07 Feb 2021, 00:43
by TD-er
I have seen another reported issue on the latest (or maybe last 2) builds regarding the GPIO expanders.

It is in an unrelated PR on GitHub, but it looks like it may be the same issue as you're seeing: https://github.com/letscontrolit/ESPEas ... -773838731

Re: Longpress only works once

Posted: 07 Feb 2021, 11:22
by leel1967l
herber_ch wrote: 06 Feb 2021, 21:35 Thanks, but I didn't see why i use inverted logic? For me 1=HIGH ist normal :?

I still activated the option and tried all possible settings. All variants send LONGPRESS only once.

Then I did a downgrade (mega-20200426). With this version everything works correctly, LONGPRESS is sent every time.

What may have changed since this version?
Hi @herbert_ch
I mean that you are using ACTIVE=HIGH. Is this what you want?
The PCF8574 has ACTIVE=LOW. It means that it has state=1 when not pressed, and state=0 when pressed.

Try using
"Doubleclick event: Active only on LOW"
"Lonpress event: Active only on LOW"

Finally, if you don't solve with the above changes, can you try a version built in december 2020 (20201227) to understand where the problem has been introduced?

Re: Longpress only works once

Posted: 29 Jul 2021, 18:36
by herber_ch
hi

Sorry, i have been away for a long time for personal reasons. but now i'm back and want to solve the problem.
I mean that you are using ACTIVE=HIGH. Is this what you want?
The PCF8574 has ACTIVE=LOW. It means that it has state=1 when not pressed, and state=0 when pressed.
Ah, now i understand. But i'm not using a regular switch but a TTP223 Touch Sensor witch is inverted also. So it shoud double invertet = normal ? :?

I have tested many older builds (without change the config) to find out, when it started:
  • Build 20201016 Longpress work normal
  • Build 20201022 Longpress only works once
so it must be any change in Build 20201022 (https://github.com/letscontrolit/ESPEas ... a-20201022) that is causing the longpress to stop working. any ideas what that could be?

Re: Longpress only works once

Posted: 29 Jul 2021, 18:46
by TD-er
This elaborate PR was merged in between those builds, so I guess it would very likely be related to this PR: https://github.com/letscontrolit/ESPEasy/pull/2778

Re: Longpress only works once

Posted: 29 Jul 2021, 19:02
by herber_ch
this seems to be about this issue. but most of it doesn't mean anything to me, I'm not a programmer. :cry:

is there anything i can do or help?

Re: Longpress only works once

Posted: 29 Jul 2021, 20:51
by TD-er
I asked the author of that PR to have a look.

Not sure if he is on holiday right now, he hasn't read his Slack message yet :)

Re: Longpress only works once

Posted: 30 Jul 2021, 10:29
by leel1967l
Hi,
I need sometime to setup a PCF expander in my lab.

In the meantime, can you make the following test:
1) disable the doubleclick event and try to see if longpress still works only once
2) reduce the doubleclick time to 500ms and try to see if longpress still works only once

then report back your findings.

thanks

Re: Longpress only works once

Posted: 30 Jul 2021, 20:37
by herber_ch
hi

Tested with build 20210503:
1) if I disable doubleclick, longpress also only works once
2) reduce the doubleclick under 1000ms is not possible, there is a check for that

I also tested:
- doubleclick=1000, longpress=5000 => still works only once, but the event 11 comes after about 1 second
- doubleclick=3000, longpress=1000 => still works only once, but the event 11 comes after about 3 seconds

Re: Longpress only works once

Posted: 31 Jul 2021, 09:27
by leel1967l
ok. Thanks for testing.
Can you try to set "Longpress event" = "ACTIVE only on LOW" ?

And then report back?

Re: Longpress only works once

Posted: 02 Aug 2021, 08:37
by herber_ch
Tested also with build 20210503:
- "Longpress event" = "ACTIVE only on LOW", doubleclick=1000, longpress=1000=> still works only once

Re: Longpress only works once

Posted: 03 Aug 2021, 18:13
by leel1967l
Hi,
Bug is confirmed and solution will provided ASAP.

Please see: https://github.com/letscontrolit/ESPEasy/issues/3736 for updates.