-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Versions
- Python: 2.7/3.x
- OS: NA
- Pymodbus: 1.5.2
- Modbus Hardware (if used): Veris-8036 / Schenier EM-6400
Pymodbus Specific
- Client: rtu-sync
Description
Trying to execute mei message (ReadDeviceInformationRequest) and ReportSlaveIdRequest results in struct error. This is partly because these requests do not get_response_pdu_size methods implemented and expected response length is passed as None . The _wait_for_data method in client.sync.ModbusSerialClient class for some devices does not wait for the complete data to come in to the read buffer, thereby returning partial data .
Code and Logs
error: unpack requires a string argument of length 2
(7 additional frame(s) were not displayed)
...
File "pymodbus/transaction.py", line 164, in execute
request.unit_id)
File "pymodbus/framer/rtu_framer.py", line 217, in processIncomingPacket
if self.checkFrame():
File "pymodbus/framer/rtu_framer.py", line 89, in checkFrame
self.populateHeader()
File "pymodbus/framer/rtu_framer.py", line 152, in populateHeader
size = pdu_class.calculateRtuFrameSize(data)
File "pymodbus/mei_message.py", line 118, in calculateRtuFrameSize
_, object_length = struct.unpack('>BB', buffer[size:size+2])
unpack requires a string argument of length 2