danimtb / dasshio

Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant
Apache License 2.0
196 stars 63 forks source link

Sniffing restarts after every button press #28

Closed sholzmayer closed 6 years ago

sholzmayer commented 6 years ago

Any idea why the sniffing restarts after each button press? I have two buttons next to each other and I sometimes press them right after each other. But due to this 20sec delay the seccond button press is not recognized...

2018-03-02 00:53:27,507 | INFO | Starting sniffing...

2018-03-02 00:53:45,691 | INFO | 01 - button pressed!
...
2018-03-02 00:53:56,051 | INFO | Packet captured, waiting 20s ...

2018-03-02 00:54:16,053 | INFO | Starting sniffing...
2018-03-02 00:54:29,577 | INFO | 03 - button pressed!
...
2018-03-02 00:54:30,275 | INFO | Successful request
2018-03-02 00:54:30,331 | INFO | Packet captured, waiting 20s ...

2018-03-02 00:54:50,339 | INFO | Starting sniffing...
danimtb commented 6 years ago

Hi @sholzmayer, thank you for reporting!

This is a limitation of how the script works regarding detection of the buttons. There is a timeout parameter for useres to adjust (defaulted to 20 seconds) and some users have reported that works nice with 8 seconds but this depends on your network...

Please try the timeout param and let me know 😄

sholzmayer commented 6 years ago

Didn't know anything about this parameter. Thanks for adding it to the Readme 👍 I will check it later.

Btw: Using a fixed IP address reduces the time to establish the connection (in my case) under 5 sec, because there is no time spend to the DHCP lookup.

danimtb commented 6 years ago

Good to know! I think 20 seconds was a good margin to stay safe 🤣 Many thanks and do not hesitate to report any issue or reopen this in case it is not solved