Skip to content

Idle time, connection TTL and other features - #52

Open
droscy wants to merge 13 commits into
tiagocoutinho:masterfrom
droscy:feat/idle-timeout/3
Open

Idle time, connection TTL and other features#52
droscy wants to merge 13 commits into
tiagocoutinho:masterfrom
droscy:feat/idle-timeout/3

Conversation

@droscy

@droscy droscy commented Nov 8, 2025

Copy link
Copy Markdown

Hello, I started receiving invalid data from inverter after a firmware upgrade and so I added to modbus-proxy some features in order to diagnose and bypass inconsistent reading.

These are the new parameters I've added:

  • idle_time: how many seconds to wait before closing an idle connection to the modbus device
  • connection_ttl: max duration of a connection, in seconds, to the modbus device
  • reconnect_delay: how many seconds to wait before establishing a new connection to the modbus device after an error
  • request_delay: how many seconds to wait between two requests

Comment thread README.md Outdated
Comment thread src/modbus_proxy.py Outdated
@tiagocoutinho
tiagocoutinho self-requested a review November 13, 2025 07:32

@tiagocoutinho tiagocoutinho left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Sorry for the late feedback.
I would feel more comfortable if the PR included tests. Would you mind adding a few?

@droscy

droscy commented Dec 7, 2025

Copy link
Copy Markdown
Author

I would feel more comfortable if the PR included tests. Would you mind adding a few?

Sure, as soon as I can study your test framework I'll add some test cases.

@droscy

droscy commented Dec 20, 2025

Copy link
Copy Markdown
Author

I've added some tests for the new parameters. All these tests are based on the asyncio.sleep() function to emulate the passing of time, so there is a remote chance of failure because the sleep() is not 100% time-accurate.

I've also added myself among contributors; other contributors are present in git history but I left the decision to you to add them to the readme file.

@droscy
droscy requested a review from tiagocoutinho January 21, 2026 08:31
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.

2 participants