Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make timeout configurable #129

Open
strakh-alex opened this issue Mar 25, 2024 · 5 comments
Open

Make timeout configurable #129

strakh-alex opened this issue Mar 25, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@strakh-alex
Copy link

strakh-alex commented Mar 25, 2024

Recently, the connection stopped working.

In the logs I found this error:

2024-03-25 12:25:32.496 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Failed to connect: [Errno 97] Address family not supported by protocol

I am running HomeAssitant in a Docker container on Raspberry Pi:

docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=Europe/Warsaw -v /Homeassistant:/config --network=host ghcr.io/home-assistant/home-assistant:stable

After I enabled IPv6 I got more verbose logs:

2024-03-25 13:06:04.612 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to configure host: 192.168.0.192
2024-03-25 13:06:04.831 DEBUG (MainThread) [aioairctrl.coap.client] syncing
2024-03-25 13:06:04.841 DEBUG (MainThread) [coap] Sending request - Token: fff4, Remote: <UDP6EndpointAddress 192.168.0.192>
2024-03-25 13:06:04.843 DEBUG (MainThread) [coap] Sending message <aiocoap.Message at 0x57727d50: NON POST (MID 11838, token fff4) remote <UDP6EndpointAddress 192.168.0.192>, 1 option(s), 8 byte(s) payload>
2024-03-25 13:06:04.926 DEBUG (MainThread) [coap] Incoming message <aiocoap.Message at 0x624be4b0: NON 2.05 Content (MID 11838, token fff4) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 1 option(s), 8 byte(s) payload>
2024-03-25 13:06:04.928 DEBUG (MainThread) [coap] Received Response: <aiocoap.Message at 0x624be4b0: NON 2.05 Content (MID 11838, token fff4) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 1 option(s), 8 byte(s) payload>
2024-03-25 13:06:04.929 DEBUG (MainThread) [coap] Response <aiocoap.Message at 0x624be4b0: NON 2.05 Content (MID 11838, token fff4) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 1 option(s), 8 byte(s) payload> matched to request <Pipe at 0x6f68fff0 around <aiocoap.Message at 0x57727d50: NON POST (MID 11838, token fff4) remote <UDP6EndpointAddress 192.168.0.192>, 1 option(s), 8 byte(s) payload> with 2 callbacks>
2024-03-25 13:06:04.946 DEBUG (MainThread) [aioairctrl.coap.client] synced: 109717A7
2024-03-25 13:06:04.947 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] got a valid client
2024-03-25 13:06:04.948 DEBUG (MainThread) [custom_components.philips_airpurifier_coap.config_flow] trying to get status
2024-03-25 13:06:04.948 DEBUG (MainThread) [aioairctrl.coap.client] retrieving status
2024-03-25 13:06:04.957 DEBUG (MainThread) [coap] Sending request - Token: fff5, Remote: <UDP6EndpointAddress 192.168.0.192>
2024-03-25 13:06:04.959 DEBUG (MainThread) [coap] Sending message <aiocoap.Message at 0x624befd8: NON GET (MID 11839, token fff5) remote <UDP6EndpointAddress 192.168.0.192>, 2 option(s)>
2024-03-25 13:06:34.950 WARNING (MainThread) [custom_components.philips_airpurifier_coap.config_flow] Timeout, host 192.168.0.192 doesn't answer, aborting

Caught another piece of logs:

2024-03-25 14:41:25.700 INFO (MainThread) [coap] Response <aiocoap.Message at 0x57f73fd8: NON 2.05 Content (MID 152, token 802d) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 3 option(s), 1448 byte(s) payload> could not be matched to any request
2024-03-25 14:41:25.701 INFO (MainThread) [coap] Ignoring unknown response (which is not a unicast CON)
2024-03-25 14:42:25.776 DEBUG (MainThread) [coap] Incoming message <aiocoap.Message at 0x5cab1150: NON 2.05 Content (MID 153, token 802d) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 3 option(s), 1448 byte(s) payload>
2024-03-25 14:42:25.778 DEBUG (MainThread) [coap] Received Response: <aiocoap.Message at 0x5cab1150: NON 2.05 Content (MID 153, token 802d) remote <UDP6EndpointAddress 192.168.0.192 (locally 192.168.0.150%wlx00367654e93d)>, 3 option(s), 1448 byte(s) payload>
@strakh-alex
Copy link
Author

I found the solution:
this timeout should be increased: https://github.com/kongo09/philips-airpurifier-coap/blob/master/custom_components/philips_airpurifier_coap/__init__.py#L133

It takes up to 2 minutes on my setup, but it would be better if the timeout was configurable.

@kongo09
Copy link
Owner

kongo09 commented Mar 26, 2024

That's an interesting idea, to make the timeout an option. I'll think about that.

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 26, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@kongo09 kongo09 reopened this Jun 2, 2024
@github-actions github-actions bot removed the Stale label Jun 3, 2024
Copy link

github-actions bot commented Aug 2, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 2, 2024
@kongo09 kongo09 removed the Stale label Aug 3, 2024
@kongo09 kongo09 added the enhancement New feature or request label Aug 18, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 18, 2024
@kongo09 kongo09 removed the Stale label Oct 18, 2024
@kongo09 kongo09 changed the title Cannot connect to AC2729 Make timeout configurable Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants