Je redémarre dans la mise en oeuvre du plugin …
Contexte : Jeedom 4.4.0, VM proxmox sous debian 10
J’ai une install de lecture de mon onduleur avec MyModbus qui fonctionne nickel.
Le but serai de normaliser modbus vers le mqtt comme mes autres protocoles
Toutes l’install à eu lieu sans problème.
Le paramètrage :
J’ai créé 2 registres test, 1 en 16 bit l’autre en 32 en image de ce que j’ai sur MyModbus qui fonctionne :
un extrait du log :
0184|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 185, in _scan_value_range
0185|raise ValueError("Failed to read {} {} table registers starting from {}: {}".format(count, table, start, result))
0186|ValueError: Failed to read 1 holding table registers starting from 37023: Exception Response(131, 3, IllegalAddress)
0187|[2023-10-18 01:13:12]WARNING : Couldn't get value from register 37023 in table holding
0188|[2023-10-18 01:13:12]WARNING : Couldn't get value from register 32065 in table holding
0189|[2023-10-18 01:13:22]DEBUG : Current transaction state - TRANSACTION_COMPLETE
0190|[2023-10-18 01:13:22]DEBUG : Running transaction 7
0191|[2023-10-18 01:13:22]DEBUG : SEND: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x3 0x7d 0x41 0x0 0x1
0192|[2023-10-18 01:13:22]DEBUG : New Transaction state 'SENDING'
0193|[2023-10-18 01:13:22]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
0194|[2023-10-18 01:13:22]WARNING : Failed to poll modbus device, attempting to reconnect: Modbus Error: [Connection] ModbusTcpClient(192.168.2.139:502): Connection unexpectedly closed 0.000007 seconds into read of 8 bytes without response from unit before it closed connection
0195|[2023-10-18 01:13:22]DEBUG : Connection to Modbus server established. Socket ('192.168.2.196', 53697)
0196|[2023-10-18 01:13:32]DEBUG : Current transaction state - IDLE
0197|[2023-10-18 01:13:32]DEBUG : Running transaction 1
0198|[2023-10-18 01:13:32]DEBUG : SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x3 0x7d 0x41 0x0 0x1
0199|[2023-10-18 01:13:32]DEBUG : New Transaction state 'SENDING'
0200|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
0201|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
0202|[2023-10-18 01:13:32]DEBUG : RECV: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x83 0x2
0203|[2023-10-18 01:13:32]DEBUG : Processing: 0x0 0x1 0x0 0x0 0x0 0x3 0x1 0x83 0x2
0204|[2023-10-18 01:13:32]DEBUG : Factory Response[131]
0205|[2023-10-18 01:13:32]DEBUG : Adding transaction 1
0206|[2023-10-18 01:13:32]DEBUG : Getting transaction 1
0207|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
0208|[2023-10-18 01:13:32]ERROR : Failed to read 1 holding table registers starting from 32065: Exception Response(131, 3, IllegalAddress)
0209|Traceback (most recent call last):
0210|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 182, in _scan_value_range
0211|return result.registers
0212|AttributeError: 'ExceptionResponse' object has no attribute 'registers'
0213|During handling of the above exception, another exception occurred:
0214|Traceback (most recent call last):
0215|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 89, in poll
0216|values = self._scan_value_range(table, group, self._scan_batching)
0217|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 185, in _scan_value_range
0218|raise ValueError("Failed to read {} {} table registers starting from {}: {}".format(count, table, start, result))
0219|ValueError: Failed to read 1 holding table registers starting from 32065: Exception Response(131, 3, IllegalAddress)
0220|[2023-10-18 01:13:32]DEBUG : Current transaction state - TRANSACTION_COMPLETE
0221|[2023-10-18 01:13:32]DEBUG : Running transaction 2
0222|[2023-10-18 01:13:32]DEBUG : SEND: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0x7d 0x42 0x0 0x1
0223|[2023-10-18 01:13:32]DEBUG : New Transaction state 'SENDING'
0224|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
0225|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
0226|[2023-10-18 01:13:32]DEBUG : RECV: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x9 0x8e
0227|[2023-10-18 01:13:32]DEBUG : Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x9 0x8e
0228|[2023-10-18 01:13:32]DEBUG : Factory Response[ReadHoldingRegistersResponse: 3]
0229|[2023-10-18 01:13:32]DEBUG : Adding transaction 2
0230|[2023-10-18 01:13:32]DEBUG : Getting transaction 2
0231|[2023-10-18 01:13:32]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
0232|[2023-10-18 01:13:33]DEBUG : Current transaction state - TRANSACTION_COMPLETE
0233|[2023-10-18 01:13:33]DEBUG : Running transaction 3
0234|[2023-10-18 01:13:33]DEBUG : SEND: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x3 0x90 0x9f 0x0 0x1
0235|[2023-10-18 01:13:33]DEBUG : New Transaction state 'SENDING'
0236|[2023-10-18 01:13:33]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
0237|[2023-10-18 01:13:33]DEBUG : Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
0238|[2023-10-18 01:13:33]DEBUG : RECV: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x83 0x2
0239|[2023-10-18 01:13:33]DEBUG : Processing: 0x0 0x3 0x0 0x0 0x0 0x3 0x1 0x83 0x2
0240|[2023-10-18 01:13:33]DEBUG : Factory Response[131]
0241|[2023-10-18 01:13:33]DEBUG : Adding transaction 3
0242|[2023-10-18 01:13:33]DEBUG : Getting transaction 3
0243|[2023-10-18 01:13:33]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
0244|[2023-10-18 01:13:33]ERROR : Failed to read 1 holding table registers starting from 37023: Exception Response(131, 3, IllegalAddress)
0245|Traceback (most recent call last):
0246|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 182, in _scan_value_range
0247|return result.registers
0248|AttributeError: 'ExceptionResponse' object has no attribute 'registers'
0249|During handling of the above exception, another exception occurred:
0250|Traceback (most recent call last):
0251|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 89, in poll
0252|values = self._scan_value_range(table, group, self._scan_batching)
0253|File "/var/www/html/plugins/modbus2mqtt/resources/modbus2mqttd/modbus4mqtt/modbus_interface.py", line 185, in _scan_value_range
0254|raise ValueError("Failed to read {} {} table registers starting from {}: {}".format(count, table, start, result))
0255|ValueError: Failed to read 1 holding table registers starting from 37023: Exception Response(131, 3, IllegalAddress)
0256|[2023-10-18 01:13:33]WARNING : Couldn't get value from register 37023 in table holding
0257|[2023-10-18 01:13:33]WARNING : Couldn't get value from register 32065 in table holding