Oui, j’ai fait des essais en modifiant le numéro d’esclave par acquis de conscience.
Normalement, ça n’a pas d’incidence si j’ai tout compris, quand c’est du modbus/TCP pur, sans cascade série derrière.
En tout cas, quel que soit le numéro d’esclave renseigné dans le plugin ou dans Modbus Doctor, la situation reste inchangée.
Logs ci dessous, pour la séquence suivante:
Essai d’ecriture 100
Raffraichissement des valeurs, le 54 est toujours à 500
Essai d’ecriture 200
Raffraichissement des valeurs, le 54 est toujours à 500
Essai d’ecriture à 100
[2023-08-17 10:49:58]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:04]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:04]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:05]DEBUG : **************** execute *****: {"user_login":"admin","user_id":"1"}
[2023-08-17 10:50:05]DEBUG : mymodbusd: Received message: {'CMD': 'write', 'write_cmd': {'eqId': '127', 'cmdWriteValue': 100, 'cmdId': '2119'}, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:05+02:00'}
[2023-08-17 10:50:05]INFO : mymodbusd: Command 'write' received from jeedom: sending the command to the daemon
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* check_queue - daemon_cmd: {"write_cmd": {"eqId": "127", "cmdWriteValue": 100, "cmdId": "2119"}}
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* connect to execute write commands
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* connect called
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* connecting...
[2023-08-17 10:50:05]DEBUG : Connecting to 192.168.0.230:502.
[2023-08-17 10:50:05]DEBUG : Connecting.
[2023-08-17 10:50:05]DEBUG : Client connected to modbus server
[2023-08-17 10:50:05]INFO : Protocol made connection.
[2023-08-17 10:50:05]INFO : Connected to 192.168.0.230:502.
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* write_request {'last_value': None, 'name': 'Temp W 100', 'type': 'action', 'slave': 1, 'fct_modbus': '6', 'data_type': 'uint16', 'addr': 54, 'byteorder': '>', 'wordorder': '>', 'repeat': False}
[2023-08-17 10:50:05]DEBUG : [100]
[2023-08-17 10:50:05]DEBUG : send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:05]DEBUG : Adding transaction 1
[2023-08-17 10:50:05]DEBUG : recv: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:05]DEBUG : Processing: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:05]DEBUG : Factory Response[WriteSingleRegisterResponse': 6]
[2023-08-17 10:50:05]DEBUG : Getting transaction 1
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* disconnect after write
[2023-08-17 10:50:05]DEBUG : PyModbusClient: *OkofenModbus* disconnect called
[2023-08-17 10:50:05]INFO : Protocol lost connection.
[2023-08-17 10:50:05]DEBUG : Client disconnected from modbus server: None
[2023-08-17 10:50:10]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:12]DEBUG : **************** execute *****: {"user_login":"admin","user_id":"1"}
[2023-08-17 10:50:12]DEBUG : mymodbusd: Received message: {'CMD': 'read', 'read_cmd': {'eqId': '127'}, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:12+02:00'}
[2023-08-17 10:50:12]INFO : mymodbusd: Command 'read' received from jeedom: sending the command to the daemon
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* check_queue - daemon_cmd: {"read_cmd": {"eqId": "127"}}
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* connect called
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* connecting...
[2023-08-17 10:50:12]DEBUG : Connecting to 192.168.0.230:502.
[2023-08-17 10:50:12]DEBUG : Connecting.
[2023-08-17 10:50:12]DEBUG : Client connected to modbus server
[2023-08-17 10:50:12]INFO : Protocol made connection.
[2023-08-17 10:50:12]INFO : Connected to 192.168.0.230:502.
[2023-08-17 10:50:12]DEBUG : send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x3 0x0 0x1
[2023-08-17 10:50:12]DEBUG : Adding transaction 2
[2023-08-17 10:50:12]DEBUG : recv: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
[2023-08-17 10:50:12]DEBUG : Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
[2023-08-17 10:50:12]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:12]DEBUG : Getting transaction 2
[2023-08-17 10:50:12]DEBUG : [1]
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* read value for Mode General (command id 1704): 1
[2023-08-17 10:50:12]DEBUG : send: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x1 0x0 0x1
[2023-08-17 10:50:12]DEBUG : Adding transaction 3
[2023-08-17 10:50:12]DEBUG : recv: 0x0 0x3 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
[2023-08-17 10:50:12]DEBUG : Processing: 0x0 0x3 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
[2023-08-17 10:50:12]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:12]DEBUG : Getting transaction 3
[2023-08-17 10:50:12]DEBUG : [2]
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* read value for Protocole Modbus (command id 2112): 2
[2023-08-17 10:50:12]DEBUG : send: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x36 0x0 0x1
[2023-08-17 10:50:12]DEBUG : Adding transaction 4
[2023-08-17 10:50:12]DEBUG : recv: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xf4
[2023-08-17 10:50:12]DEBUG : Processing: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xf4
[2023-08-17 10:50:12]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:12]DEBUG : Getting transaction 4
[2023-08-17 10:50:12]DEBUG : [500]
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* read value for Temp R (command id 2117): 500
[2023-08-17 10:50:12]INFO : Send to jeedom : {'eqId': '127', 'values': {'1704': 1, '2112': 2, '2117': 500}}
[2023-08-17 10:50:12]DEBUG : PyModbusClient: *OkofenModbus* disconnect called
[2023-08-17 10:50:12]DEBUG : Starting new HTTP connection (1): localhost:80
[2023-08-17 10:50:12]INFO : Protocol lost connection.
[2023-08-17 10:50:12]DEBUG : Client disconnected from modbus server: None
[2023-08-17 10:50:12]DEBUG : jeemymodbus.php: $result *{"eqId":"127","values":{"1704":1,"2112":2,"2117":500}}* type: array
[2023-08-17 10:50:12]DEBUG : jeemodbus.php: Mise à jour cmd Mode General -> new value: 1
[2023-08-17 10:50:12]DEBUG : jeemodbus.php: Mise à jour cmd Protocole Modbus -> new value: 2
[2023-08-17 10:50:12]DEBUG : jeemodbus.php: Mise à jour cmd Temp R -> new value: 500
[2023-08-17 10:50:12]INFO : jeemodbus.php: Mise à jour des commandes info : 'Mode General' 'Protocole Modbus' 'Temp R'
[2023-08-17 10:50:12]DEBUG : http://localhost:80 "POST /plugins/mymodbus/core/php/jeemymodbus.php?apikey=sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq HTTP/1.1" 200 0
[2023-08-17 10:50:16]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:18]DEBUG : **************** execute *****: {"user_login":"admin","user_id":"1"}
[2023-08-17 10:50:18]DEBUG : mymodbusd: Received message: {'CMD': 'write', 'write_cmd': {'eqId': '127', 'cmdWriteValue': 200, 'cmdId': '2120'}, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:18+02:00'}
[2023-08-17 10:50:18]INFO : mymodbusd: Command 'write' received from jeedom: sending the command to the daemon
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* check_queue - daemon_cmd: {"write_cmd": {"eqId": "127", "cmdWriteValue": 200, "cmdId": "2120"}}
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* connect to execute write commands
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* connect called
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* connecting...
[2023-08-17 10:50:18]DEBUG : Connecting to 192.168.0.230:502.
[2023-08-17 10:50:18]DEBUG : Connecting.
[2023-08-17 10:50:18]DEBUG : Client connected to modbus server
[2023-08-17 10:50:18]INFO : Protocol made connection.
[2023-08-17 10:50:18]INFO : Connected to 192.168.0.230:502.
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* write_request {'last_value': None, 'name': 'Temp W 200', 'type': 'action', 'slave': 1, 'fct_modbus': '6', 'data_type': 'uint16', 'addr': 54, 'byteorder': '>', 'wordorder': '>', 'repeat': False}
[2023-08-17 10:50:18]DEBUG : [200]
[2023-08-17 10:50:18]DEBUG : send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0xc8
[2023-08-17 10:50:18]DEBUG : Adding transaction 5
[2023-08-17 10:50:18]DEBUG : recv: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0xc8
[2023-08-17 10:50:18]DEBUG : Processing: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0xc8
[2023-08-17 10:50:18]DEBUG : Factory Response[WriteSingleRegisterResponse': 6]
[2023-08-17 10:50:18]DEBUG : Getting transaction 5
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* disconnect after write
[2023-08-17 10:50:18]DEBUG : PyModbusClient: *OkofenModbus* disconnect called
[2023-08-17 10:50:18]INFO : Protocol lost connection.
[2023-08-17 10:50:18]DEBUG : Client disconnected from modbus server: None
[2023-08-17 10:50:22]DEBUG : **************** execute *****: {"user_login":"admin","user_id":"1"}
[2023-08-17 10:50:22]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
[2023-08-17 10:50:22]DEBUG : mymodbusd: Received message: {'CMD': 'read', 'read_cmd': {'eqId': '127'}, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:22+02:00'}
[2023-08-17 10:50:22]INFO : mymodbusd: Command 'read' received from jeedom: sending the command to the daemon
[2023-08-17 10:50:22]DEBUG : PyModbusClient: *OkofenModbus* check_queue - daemon_cmd: {"read_cmd": {"eqId": "127"}}
[2023-08-17 10:50:22]DEBUG : PyModbusClient: *OkofenModbus* connect called
[2023-08-17 10:50:22]DEBUG : PyModbusClient: *OkofenModbus* connecting...
[2023-08-17 10:50:22]DEBUG : Connecting to 192.168.0.230:502.
[2023-08-17 10:50:22]DEBUG : Connecting.
[2023-08-17 10:50:22]DEBUG : Client connected to modbus server
[2023-08-17 10:50:22]INFO : Protocol made connection.
[2023-08-17 10:50:22]INFO : Connected to 192.168.0.230:502.
[2023-08-17 10:50:22]DEBUG : send: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x3 0x0 0x1
[2023-08-17 10:50:22]DEBUG : Adding transaction 6
[2023-08-17 10:50:22]DEBUG : recv: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
[2023-08-17 10:50:22]DEBUG : Processing: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
[2023-08-17 10:50:22]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:22]DEBUG : Getting transaction 6
[2023-08-17 10:50:22]DEBUG : [1]
[2023-08-17 10:50:22]DEBUG : send: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x1 0x0 0x1
[2023-08-17 10:50:22]DEBUG : Adding transaction 7
[2023-08-17 10:50:22]DEBUG : recv: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
[2023-08-17 10:50:22]DEBUG : Processing: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
[2023-08-17 10:50:22]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:22]DEBUG : Getting transaction 7
[2023-08-17 10:50:22]DEBUG : [2]
[2023-08-17 10:50:22]DEBUG : send: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x3 0x0 0x36 0x0 0x1
[2023-08-17 10:50:22]DEBUG : Adding transaction 8
[2023-08-17 10:50:22]DEBUG : recv: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xf4
[2023-08-17 10:50:22]DEBUG : Processing: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xf4
[2023-08-17 10:50:22]DEBUG : Factory Response[ReadHoldingRegistersResponse': 3]
[2023-08-17 10:50:22]DEBUG : Getting transaction 8
[2023-08-17 10:50:22]DEBUG : [500]
[2023-08-17 10:50:22]DEBUG : PyModbusClient: *OkofenModbus* disconnect called
[2023-08-17 10:50:22]INFO : Protocol lost connection.
[2023-08-17 10:50:22]DEBUG : Client disconnected from modbus server: None
[2023-08-17 10:50:24]DEBUG : **************** execute *****: {"user_login":"admin","user_id":"1"}
[2023-08-17 10:50:25]DEBUG : mymodbusd: Received message: {'CMD': 'write', 'write_cmd': {'eqId': '127', 'cmdWriteValue': 100, 'cmdId': '2119'}, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:25+02:00'}
[2023-08-17 10:50:25]INFO : mymodbusd: Command 'write' received from jeedom: sending the command to the daemon
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* check_queue - daemon_cmd: {"write_cmd": {"eqId": "127", "cmdWriteValue": 100, "cmdId": "2119"}}
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* connect to execute write commands
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* connect called
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* connecting...
[2023-08-17 10:50:25]DEBUG : Connecting to 192.168.0.230:502.
[2023-08-17 10:50:25]DEBUG : Connecting.
[2023-08-17 10:50:25]DEBUG : Client connected to modbus server
[2023-08-17 10:50:25]INFO : Protocol made connection.
[2023-08-17 10:50:25]INFO : Connected to 192.168.0.230:502.
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* write_request {'last_value': None, 'name': 'Temp W 100', 'type': 'action', 'slave': 1, 'fct_modbus': '6', 'data_type': 'uint16', 'addr': 54, 'byteorder': '>', 'wordorder': '>', 'repeat': False}
[2023-08-17 10:50:25]DEBUG : [100]
[2023-08-17 10:50:25]DEBUG : send: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:25]DEBUG : Adding transaction 9
[2023-08-17 10:50:25]DEBUG : recv: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:25]DEBUG : Processing: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x36 0x0 0x64
[2023-08-17 10:50:25]DEBUG : Factory Response[WriteSingleRegisterResponse': 6]
[2023-08-17 10:50:25]DEBUG : Getting transaction 9
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* disconnect after write
[2023-08-17 10:50:25]DEBUG : PyModbusClient: *OkofenModbus* disconnect called
[2023-08-17 10:50:25]INFO : Protocol lost connection.
[2023-08-17 10:50:25]DEBUG : Client disconnected from modbus server: None
[2023-08-17 10:50:25]INFO : Send to jeedom : {'heartbeat_request': 1692262225}
[2023-08-17 10:50:25]DEBUG : Starting new HTTP connection (1): localhost:80
[2023-08-17 10:50:25]DEBUG : jeemymodbus.php: $result *{"heartbeat_request":1692262225}* type: array
[2023-08-17 10:50:25]DEBUG : mymodbusd: Received message: {'CMD': 'heartbeat_answer', 'answer': 1692262225, 'apikey': 'sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq', 'dt': '2023-08-17T10:50:25+02:00'}
[2023-08-17 10:50:25]DEBUG : http://localhost:80 "POST /plugins/mymodbus/core/php/jeemymodbus.php?apikey=sKLBILdswqpFGNux9XAxLhAeMDgStjgh1TTLf47nwVEUrhBRlX0cJrk3LJeQ5ndq HTTP/1.1" 200 0
[2023-08-17 10:50:28]DEBUG : deamon_info = {"state":"ok","launchable":"ok"}
Je suis très perplexe. Manifestement, les messages envoyés sont les mêmes par les deux outils.
Et ce qui est très étrange, c’est que le message de retour de la chaudière, quand je fais un essai d’écriture, a l’air de bien confirmer la bonne réception, puisque le message en retour contient le même code de fonction (6) en octet 7