Skip to content

Use long lived TCP connection to hub and add heartbeat/ping sensor#50

Merged
tonyroberts merged 5 commits intomainfrom
dev
Oct 24, 2025
Merged

Use long lived TCP connection to hub and add heartbeat/ping sensor#50
tonyroberts merged 5 commits intomainfrom
dev

Conversation

@tonyroberts
Copy link
Owner

  • Keep alive a single TCP connection for each hub instead of constantly opening a new one for each request
  • Add a heartbeat sensor that pings the hub periodically to check it's alive

Instead of creating a new connection for each HTTP request, keep
a long lived TCP connection alive and use it for all requests.

This should use fewer resources on the hub and hopefully avoid
stability problems that can occur when the hub has been up
for many months.
Periodically ping the hub to check it's still responding.

This should help keep the hub's network interface awake.
Elsewhere it's assumed that unavailable values are either not set
in state dictionary or are None. Where empty strings are used it's
logging some warnings about float conversions which aren't needed.
@tonyroberts tonyroberts merged commit aa53d7b into main Oct 24, 2025
6 checks passed
@tonyroberts tonyroberts deleted the dev branch October 24, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant