Longpress only works once

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Longpress only works once

#1 Post by herber_ch » 03 Feb 2021, 12:23

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.

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#2 Post by leel1967l » 03 Feb 2021, 16:18

Will have a look at it.
Can you post the screenshot of the device configuration?

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#3 Post by herber_ch » 04 Feb 2021, 11:14

thanks, here is my configuration
Attachments
screenshot.108.jpg
screenshot.108.jpg (209.13 KiB) Viewed 4255 times

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#4 Post by leel1967l » 04 Feb 2021, 19:03

You are using an inverted logic, where HIGH=1.
Have you tried to flag the "Inverted Logic" option?

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#5 Post by herber_ch » 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?

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Longpress only works once

#6 Post by TD-er » 07 Feb 2021, 00:43

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

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#7 Post by leel1967l » 07 Feb 2021, 11:22

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?

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#8 Post by herber_ch » 29 Jul 2021, 18:36

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?

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Longpress only works once

#9 Post by TD-er » 29 Jul 2021, 18:46

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

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#10 Post by herber_ch » 29 Jul 2021, 19:02

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?

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Longpress only works once

#11 Post by TD-er » 29 Jul 2021, 20:51

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 :)

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#12 Post by leel1967l » 30 Jul 2021, 10:29

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

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#13 Post by herber_ch » 30 Jul 2021, 20:37

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

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#14 Post by leel1967l » 31 Jul 2021, 09:27

ok. Thanks for testing.
Can you try to set "Longpress event" = "ACTIVE only on LOW" ?

And then report back?

herber_ch
Normal user
Posts: 7
Joined: 03 Feb 2021, 12:06

Re: Longpress only works once

#15 Post by herber_ch » 02 Aug 2021, 08:37

Tested also with build 20210503:
- "Longpress event" = "ACTIVE only on LOW", doubleclick=1000, longpress=1000=> still works only once

leel1967l
Normal user
Posts: 70
Joined: 30 Nov 2017, 18:29

Re: Longpress only works once

#16 Post by leel1967l » 03 Aug 2021, 18:13

Hi,
Bug is confirmed and solution will provided ASAP.

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

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests