Я использую шлюз вещей для подключения к ведомому устройству Modbus с unitid больше 255, pymodbus выдает ошибку, как показано ниже:
tb-gateway-py_1 | struct.error: ubyte format requires 0 <= number <= 255
tb-gateway-py_1 | ''2020-04-23 08:43:46' - ERROR - modbus_connector - 178 - ubyte format requires 0 <= number <= 255'
tb-gateway-py_1 | Traceback (most recent call last):
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 122, in __process_devices
tb-gateway-py_1 | input_data = self.__function_to_device(current_data, unit_id)
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 226, in __function_to_device
tb-gateway-py_1 | unit=unit_id)
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
tb-gateway-py_1 | return self.execute(request)
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/pymodbus/client/sync.py", line 108, in execute
tb-gateway-py_1 | return self.transaction.execute(request)
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/pymodbus/transaction.py", line 153, in execute
tb-gateway-py_1 | broadcast=broadcast
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/pymodbus/transaction.py", line 217, in _transact
tb-gateway-py_1 | packet = self.client.framer.buildPacket(packet)
tb-gateway-py_1 | File "/root/.local/lib/python3.6/site-packages/pymodbus/framer/socket_framer.py", line 212, in buildPacket
tb-gateway-py_1 | message.function_code)
tb-gateway-py_1 | struct.error: ubyte format requires 0 <= number <= 255
Возможно ли использовать «read_holding_registers» с unitid больше 255 в Режим TCP?