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

Add delays to avoid corrupting packages. #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Magic-Doufu
Copy link

Add delays to solve corruption pack issue. (CH341 working well, but ft232 with vcp driver always corrupting.)

-->1-3-0-0-0-10-197-205
<--1-3-20-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-163-103
-->1-3-0-0-0-10-197-205
<--1-3-20-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-163-103
-->1-3-0-0-0-10-197-205
<--1-3-20-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-163-103
-->1
invalid request: Request length is invalid 1
-->3-0-0-0-10-197-205
invalid request: Invalid CRC in request

@@ -274,6 +274,8 @@ def _do_run(self):

# Read rest of the request
while True:
# Add delays to avoid corrupting packages. (For use with FT232-RS485 device.)

Choose a reason for hiding this comment

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

"For use with FT232-RS485 device"???

But it's sitting under a while True and will affect every modbus_rtu device.

This will halt all execution for every modbus-rtu device prior to reading the rest of a request, a completely unessesary performance impact for many applications which do not warrant it.

I've had projects pushing near 500 requests per second, and i wouldn't be suprised if others are pushing higher, even if just in bench tests a 0.001s delay is massive in that regard.

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