Je suis sur le nouveau plugin Modbus que l’équipe jeedom vient de sortir.
(Je post ce nouveau message car c’est un point différent du précédent)
Je suis conscient que le plugin est en BETA et qu’il est tout neuf. Mon post à vocation a contribuer au test de ce plugin et à la résolution des problèmes rencontrés.
Jeedom 4.2.11
ModBus : Mode RTU
J’ai configuré 2 contrôleurs (automates) Modbus avec les adresses modbus n°1 et n°2.
Pas de souci pour la lecture et l’écriture sur 1 unique variable (registre Modbus 21), lorsque les 2 contrôleurs sont en ligne (en communication).
Lorsque je coupe (volontairement), l’alimentation du contrôleur n°1, il y a (selon moi) un dysfonctionnement
J’écris (alors que le controleur 2 est hors ligne) sur le contrôleur 1 la valeur 200 et sur le contrôleur 2 la valeur 210
Il est normal que la valeur 200 ne soit pas prise en compte car le contrôleur 1 car il est hors tension
Mais le contrôleur 2 est toujours sous tension et il n’y a pas d’écriture (et pas de lecteur) de la variable 21. Les leds de mon câble RS485 clignote uniquement en rouge (plus de vert donc plus de communication sur le Modbus)
Ceci est le même phénomène sur que le plugin Modbus RTU
C’est clairement pour moi une bugg car nous devons pouvoir continuer à communiquer avec les automates présents sur le bus Modbus (donc dans notre cas le contrôleur 2)
[2022-02-12 22:49:16][DEBUG] : WRITETEST : {"apikey":"XXXXXXXXXj","typeDevice":"rtu","action":"writeAction","unitID":1,"options":{"nameCmd":"Registre 21 Ecriture","cmdId":"3549","format":0,"functioncode":"fc16","nbregister":0,"startregister":"21","wordorder":"littleword","byteorder":"bigbyte","isnegatif":"0","offset":"0","valuesrequest":[{"valeur":"250","nbregister":"1"}]},"deviceInfo":{"typeDevice":"rtu","portserial":"\/dev\/ttyUSB0","baudrate":57600,"unitID":1,"parity":"N","stopbits":1,"bytesize":8,"id":"288"}}
[2022-02-12 22:49:18][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":200}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}},"FUNC":"readF"}
[2022-02-12 22:49:18][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":200}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}}
[2022-02-12 22:49:18][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:18][DEBUG] : VALUETOEVENT >>>>>>> 200
[2022-02-12 22:49:18][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:18][DEBUG] : VALUETOEVENT >>>>>>> 200
[2022-02-12 22:49:18][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":200}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}},"FUNC":"readF"}
[2022-02-12 22:49:18][DEBUG] : Result:{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:49:18][DEBUG] : RETURNFUNCTIONWRITE{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:49:20][DEBUG] : WRITETEST : {"apikey":"XXXXXXXXXj","typeDevice":"rtu","action":"writeAction","unitID":2,"options":{"nameCmd":"Registre 21 Ecriture","cmdId":"3582","format":0,"functioncode":"fc16","nbregister":0,"startregister":"21","wordorder":"littleword","byteorder":"bigbyte","isnegatif":"0","offset":"0","valuesrequest":[{"valeur":"260","nbregister":"1"}]},"deviceInfo":{"typeDevice":"rtu","portserial":"\/dev\/ttyUSB0","baudrate":57600,"unitID":2,"parity":"N","stopbits":1,"bytesize":8,"id":"292"}}
[2022-02-12 22:49:23][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}},"FUNC":"readF"}
[2022-02-12 22:49:23][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}}
[2022-02-12 22:49:23][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:23][DEBUG] : VALUETOEVENT >>>>>>> 250
[2022-02-12 22:49:23][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:23][DEBUG] : VALUETOEVENT >>>>>>> 200
[2022-02-12 22:49:23][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":200}]}},"FUNC":"readF"}
[2022-02-12 22:49:24][DEBUG] : Result:{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:49:24][DEBUG] : RETURNFUNCTIONWRITE{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:49:29][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:29][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}}
[2022-02-12 22:49:29][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:29][DEBUG] : VALUETOEVENT >>>>>>> 250
[2022-02-12 22:49:29][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:29][DEBUG] : VALUETOEVENT >>>>>>> 260
[2022-02-12 22:49:29][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:35][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:35][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}}
[2022-02-12 22:49:35][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:35][DEBUG] : VALUETOEVENT >>>>>>> 250
[2022-02-12 22:49:35][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:35][DEBUG] : VALUETOEVENT >>>>>>> 260
[2022-02-12 22:49:35][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:40][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:40][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}}
[2022-02-12 22:49:40][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:40][DEBUG] : VALUETOEVENT >>>>>>> 250
[2022-02-12 22:49:40][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:40][DEBUG] : VALUETOEVENT >>>>>>> 260
[2022-02-12 22:49:40][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:46][DEBUG] : Result:{"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:46][DEBUG] : DATACORRESPOND : {"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}}
[2022-02-12 22:49:46][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecteure
[2022-02-12 22:49:46][DEBUG] : VALUETOEVENT >>>>>>> 250
[2022-02-12 22:49:46][DEBUG] : CMDTOEVENT >>>>>>> Registre 21 Lecture
[2022-02-12 22:49:46][DEBUG] : VALUETOEVENT >>>>>>> 260
[2022-02-12 22:49:46][DEBUG] : DECODER : {"data":{"288":{"Registre 21 Lecteure":[{"StartRegister":21,"CmdId":"3551","value":250}]},"292":{"Registre 21 Lecture":[{"StartRegister":21,"CmdId":"3584","value":260}]}},"FUNC":"readF"}
[2022-02-12 22:49:56][DEBUG] : WRITETEST : {"apikey":"XXXXXXXXXj","typeDevice":"rtu","action":"writeAction","unitID":1,"options":{"nameCmd":"Registre 21 Ecriture","cmdId":"3549","format":0,"functioncode":"fc16","nbregister":0,"startregister":"21","wordorder":"littleword","byteorder":"bigbyte","isnegatif":"0","offset":"0","valuesrequest":[{"valeur":"200","nbregister":"1"}]},"deviceInfo":{"typeDevice":"rtu","portserial":"\/dev\/ttyUSB0","baudrate":57600,"unitID":1,"parity":"N","stopbits":1,"bytesize":8,"id":"288"}}
[2022-02-12 22:49:59][DEBUG] : WRITETEST : {"apikey":"XXXXXXXXXj","typeDevice":"rtu","action":"writeAction","unitID":2,"options":{"nameCmd":"Registre 21 Ecriture","cmdId":"3582","format":0,"functioncode":"fc16","nbregister":0,"startregister":"21","wordorder":"littleword","byteorder":"bigbyte","isnegatif":"0","offset":"0","valuesrequest":[{"valeur":"210","nbregister":"1"}]},"deviceInfo":{"typeDevice":"rtu","portserial":"\/dev\/ttyUSB0","baudrate":57600,"unitID":2,"parity":"N","stopbits":1,"bytesize":8,"id":"292"}}
[2022-02-12 22:50:00][DEBUG] : Result:{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:50:00][DEBUG] : RETURNFUNCTIONWRITE{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:50:04][DEBUG] : Result:{"FUNC":"write","isOk":"yes"}
[2022-02-12 22:50:04][DEBUG] : RETURNFUNCTIONWRITE{"FUNC":"write","isOk":"yes"}
J’ai remplcé l’APIKEY par des XXXX
En mode débug, le log s’est arrêté à 22:50:04
A 23:12 (soit 20 minutes après) il y a plus aucune trame sur le log, dans ce laps de temps
Je relance manuellement le demon (qui n’était pas à l’arrêt) et j’ai une erreur :
[2022-02-12 23:12:46]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
[2022-02-12 23:12:47]DEBUG : {'data': {'288': {}}, 'FUNC': 'readF'}
[2022-02-12 23:12:47]DEBUG : True
[2022-02-12 23:12:47]DEBUG : {'nameCmd': 'Registre 21 Lecteure', 'cmdId': '3551', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '1', 'startregister': '21', 'wordorder': 'littleword', 'byteorder': 'bigbyte', 'isnegatif': '0', 'offset': '0'}
[2022-02-12 23:12:47]DEBUG : Current transaction state - IDLE
[2022-02-12 23:12:47]DEBUG : Running transaction 1
[2022-02-12 23:12:47]DEBUG : SEND: 0x1 0x3 0x0 0x15 0x0 0x1 0x95 0xce
[2022-02-12 23:12:47]DEBUG : New Transaction state 'SENDING'
[2022-02-12 23:12:47]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-02-12 23:12:50]DEBUG : Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
[2022-02-12 23:12:50]DEBUG : Frame - [b''] not ready
[2022-02-12 23:12:50]DEBUG : Getting transaction 1
[2022-02-12 23:12:50]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-02-12 23:12:50]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
[2022-02-12 23:12:50]DEBUG : {'data': {'288': {}}, 'FUNC': 'readF'}
[2022-02-12 23:12:51]DEBUG : True
[2022-02-12 23:12:51]DEBUG : {'nameCmd': 'Registre 21 Lecteure', 'cmdId': '3551', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '1', 'startregister': '21', 'wordorder': 'littleword', 'byteorder': 'bigbyte', 'isnegatif': '0', 'offset': '0'}
[2022-02-12 23:12:51]DEBUG : Current transaction state - IDLE
[2022-02-12 23:12:51]DEBUG : Running transaction 1
[2022-02-12 23:12:51]DEBUG : SEND: 0x1 0x3 0x0 0x15 0x0 0x1 0x95 0xce
[2022-02-12 23:12:51]DEBUG : New Transaction state 'SENDING'
[2022-02-12 23:12:51]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-02-12 23:12:54]DEBUG : Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
[2022-02-12 23:12:54]DEBUG : Frame - [b''] not ready
[2022-02-12 23:12:54]DEBUG : Getting transaction 1
[2022-02-12 23:12:54]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-02-12 23:12:54]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
[2022-02-12 23:12:54]DEBUG : {'data': {'288': {}}, 'FUNC': 'readF'}
[2022-02-12 23:12:54]DEBUG : True
[2022-02-12 23:12:54]DEBUG : {'nameCmd': 'Registre 21 Lecteure', 'cmdId': '3551', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '1', 'startregister': '21', 'wordorder': 'littleword', 'byteorder': 'bigbyte', 'isnegatif': '0', 'offset': '0'}
[2022-02-12 23:12:54]DEBUG : Current transaction state - IDLE
[2022-02-12 23:12:54]DEBUG : Running transaction 1
[2022-02-12 23:12:54]DEBUG : SEND: 0x1 0x3 0x0 0x15 0x0 0x1 0x95 0xce
[2022-02-12 23:12:54]DEBUG : New Transaction state 'SENDING'
[2022-02-12 23:12:54]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-02-12 23:12:57]DEBUG : Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
[2022-02-12 23:12:57]DEBUG : Frame - [b''] not ready
[2022-02-12 23:12:57]DEBUG : Getting transaction 1
[2022-02-12 23:12:57]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-02-12 23:12:57]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
[2022-02-12 23:12:58]DEBUG : True
[2022-02-12 23:12:58]DEBUG : {'nameCmd': 'Registre 21 Lecteure', 'cmdId': '3551', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '1', 'startregister': '21', 'wordorder': 'littleword', 'byteorder': 'bigbyte', 'isnegatif': '0', 'offset': '0'}
[2022-02-12 23:12:58]DEBUG : Current transaction state - IDLE
[2022-02-12 23:12:58]DEBUG : Running transaction 1
[2022-02-12 23:12:58]DEBUG : SEND: 0x1 0x3 0x0 0x15 0x0 0x1 0x95 0xce
[2022-02-12 23:12:58]DEBUG : New Transaction state 'SENDING'
[2022-02-12 23:12:58]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-02-12 23:13:01]DEBUG : Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
[2022-02-12 23:13:01]DEBUG : Frame - [b''] not ready
[2022-02-12 23:13:01]DEBUG : Getting transaction 1
[2022-02-12 23:13:01]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-02-12 23:13:01]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
[2022-02-12 23:13:01]DEBUG : {'data': {'288': {}}, 'FUNC': 'readF'}
[2022-02-12 23:13:01]DEBUG : True
[2022-02-12 23:13:01]DEBUG : {'nameCmd': 'Registre 21 Lecteure', 'cmdId': '3551', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '1', 'startregister': '21', 'wordorder': 'littleword', 'byteorder': 'bigbyte', 'isnegatif': '0', 'offset': '0'}
[2022-02-12 23:13:01]DEBUG : Current transaction state - IDLE
[2022-02-12 23:13:01]DEBUG : Running transaction 1
[2022-02-12 23:13:01]DEBUG : SEND: 0x1 0x3 0x0 0x15 0x0 0x1 0x95 0xce
[2022-02-12 23:13:01]DEBUG : New Transaction state 'SENDING'
[2022-02-12 23:13:01]DEBUG : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-02-12 23:13:04]DEBUG : Transaction failed. (Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received))
[2022-02-12 23:13:04]DEBUG : Frame - [b''] not ready
[2022-02-12 23:13:04]DEBUG : Getting transaction 1
[2022-02-12 23:13:04]DEBUG : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-02-12 23:13:04]ERROR : Exception on read device : 'ModbusIOException' object has no attribute 'registers'
Je redémarre le controleur 2 et çà redemarre normalement
La valeur sur le controleur 1 n’a pas été prise en compte (automate qui a été coupé) => Ceci est logique et ne cause pas de problème
La valeur écrite sur le controleur 2 est alors prise en compte (automate qui était en ligne).
Ce n’est pas normal que la valeur soit prise en compte uniquemenrt sur le retour à la normal de tous les automates. Nous devrions pouvoir continuer à communiquer (lecture et écriture) avec l’automate 2 qui est toujours en ligne
J’espère avoir été assez précis et clair