-
Notifications
You must be signed in to change notification settings - Fork 948
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
RTU Framer discards packets splitted into two calls to "processIncomingPacket" #394
Comments
I stumbled upon the same issue: VersionsPython: 3.6.4, 3.7.3 and with DescriptionWhen I integrated @RonnyDe1982's workaround, a key error was raised for
Hence, I adapted the snippet to:
Not the neatest solution, but it worked for my case. I guess it is worth to dig a little bit deeper to find the cause of this error. |
@meierphil Thanks for the hints and workaround. I will try to get a solution for this |
I'm trying to figure out if I am seeing this same split packet issue with the RTU framer. My master device is sending this command: [2019-09-13T12:09:37.412Z][DEBUG]-ModbusMaster.py:43,Sending request: address=1, function=3, data=[0, 0, 0, 1] And the Pymodbus Sync server is reporting this error: 2019-09-13 07:51:33,892 MainThread DEBUG sync :45 Client Connected [/dev/ttyUSB1:/dev/ttyUSB1] It looks to me like "0x1 0x3 0x0 0x0 0x0" is missing the final "0x1" which is in the second frame - along with "0x84 & 0xa" Is this the same issue? |
Hi, I just face the same issue with a TCP device. Here a piece of code, showing my issue. In sync mode there is no problem; In async mode, the message is split in two piece of code :
I managed to deal my problem with rewriting processIncomingPacket of the Framer.
The corresponding logs are : (the reply message has changed due to the state of my device)
|
I met the same issue like yours. |
Hi, you can use https://github.com/riptideio/pymodbus/pull/466 to fix your issue. I use this and it works. |
Versions
Pymodbus Specific
Description
The RTU Framer had a known issue related to modbus requests not served by the library but other physical modbus devices. This issues seems to be fixed in branch "pymodbus-2.2.0".
However, the suggested bugfix in pymodbus/rtu:framer.py, lines 231-233 introduces another problem for large modbus requests which cannot be passes in one single data frame to the function processIncomingPacket.
Whenever an incomplete packet has been received this packet is discarded since "checkFrame" returns false.
Known workaround:
The text was updated successfully, but these errors were encountered: