Je me permet de faire un petit up pour vous faire suivre mes petites (non) avancées.
J’ai passé pas mal de temps à penser que je configurais mal les registres de lecture sous Jeedom. Finalement, j’ai commencé à obtenir une réponse cohérente (mais inexploitable en l’état).
Voici la configuration qui m’a permis d’avoir une réponse de la part de l’automate :
Et la réponse obtenue avec cette configuration est : 0000000010000000000000010000000000000000101111100000000100000000011111000000000100000001000000000000000100000000000000010000000000000001000000000000000100000000
Un bel ensemble de 1 et de 0 peu exploitable. Mais je trouve ici un début de quelque chose puisque j’arrive à obtenir une réponse, de la part de l’automate, qui est transcrite dans Jeedom.
Je change donc de configuration pour celle ci :
Et là, à nouveau pas de réponse de la part de l’automate dans les variables Jeedom. Un petit tour dans les logs et voici ce que je trouve :
[2022-09-19 15:49:58][INFO] : Lancement démon /usr/bin/python3 /var/www/html/plugins/modbus/resources/modbusd/modbusd.py --loglevel debug --socketport 55030 --timesleep 2 --retrydefault True --timeoutretries 10 --nbretry 3 --sockethost 127.0.0.1 --callback http://127.0.0.1:80/plugins/modbus/core/php/jeeModbus.php --apikey XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --pid /tmp/jeedom/modbus/deamon.pid
[2022-09-19 15:49:58][INFO] : Start demond
[2022-09-19 15:49:58][INFO] : Log level : debug
[2022-09-19 15:49:58][INFO] : RetryDefault : False
[2022-09-19 15:49:58][INFO] : nbRetry : 3
[2022-09-19 15:49:58][INFO] : Timeout : 10
[2022-09-19 15:49:58][INFO] : Socket port : 55030
[2022-09-19 15:49:58][INFO] : Socket host : 127.0.0.1
[2022-09-19 15:49:58][INFO] : PID file : /tmp/jeedom/modbus/deamon.pid
[2022-09-19 15:49:58][INFO] : Apikey : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[2022-09-19 15:49:58][INFO] : Device : auto
[2022-09-19 15:49:58][INFO] : TimeSleep : 2
[2022-09-19 15:49:58][DEBUG] : Writing PID 27863 to /tmp/jeedom/modbus/deamon.pid
[2022-09-19 15:49:58][DEBUG] : Init request module v2.27.1
[2022-09-19 15:49:58][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2022-09-19 15:49:58][DEBUG] : Result:null
[2022-09-19 15:49:58][DEBUG] : http://127.0.0.1:80 "GET /plugins/modbus/core/php/jeeModbus.php?apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX HTTP/1.1" 200 0
[2022-09-19 15:49:58][DEBUG] : Socket interface started
[2022-09-19 15:49:58][DEBUG] : LoopNetServer Thread started
[2022-09-19 15:49:58][DEBUG] : Listening on: [127.0.0.1:55030]
[2022-09-19 15:49:58][DEBUG] : Start listening...
[2022-09-19 15:49:59][DEBUG] : Client connected to [127.0.0.1:51316]
[2022-09-19 15:49:59][DEBUG] : Client disconnected from [127.0.0.1:51316]
[2022-09-19 15:49:59][DEBUG] : Message received in socket JEEDOM_SOCKET_MESSAGE
[2022-09-19 15:49:59][DEBUG] : ADD DEVICE TO GLOBALS :[{'typeDevice': 'tcp', 'id': '764', 'unitID': '1', 'optionnalport': 502, 'ipDevice': '192.168.33.5', 'eqlogicName': 'TEST2 NSX31', 'registerParams': [{'nameCmd': '8754', 'cmdId': '5719', 'format': 'bitsformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}, {'nameCmd': '8754-2', 'cmdId': '5732', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}]}]
[2022-09-19 15:50:01][DEBUG] : === LECTURE DES AUTOMATES ===
[2022-09-19 15:50:01][DEBUG] : {'764': {'typeDevice': 'tcp', 'id': '764', 'unitID': '1', 'optionnalport': 502, 'ipDevice': '192.168.33.5', 'eqlogicName': 'TEST2 NSX31', 'registerParams': [{'nameCmd': '8754', 'cmdId': '5719', 'format': 'bitsformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}, {'nameCmd': '8754-2', 'cmdId': '5732', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}]}}
[2022-09-19 15:50:01][DEBUG] : HEY
[2022-09-19 15:50:01][DEBUG] : {'typeDevice': 'tcp', 'id': '764', 'unitID': '1', 'optionnalport': 502, 'ipDevice': '192.168.33.5', 'eqlogicName': 'TEST2 NSX31', 'registerParams': [{'nameCmd': '8754', 'cmdId': '5719', 'format': 'bitsformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}, {'nameCmd': '8754-2', 'cmdId': '5732', 'format': 'longformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}]}
[2022-09-19 15:50:01][DEBUG] : Connection to Modbus server established. Socket ('192.168.32.9', 41313)
[2022-09-19 15:50:01][DEBUG] : {'nameCmd': '8754', 'cmdId': '5719', 'format': 'bitsformat', 'functioncode': 'fc03', 'nbregister': '10', 'startregister': '8754', 'wordorder': 'littleword', 'byteorder': 'littlebyte', 'offset': '-1', 'decimal': 0, 'operation': 0}
[2022-09-19 15:50:01][DEBUG] : Current transaction state - IDLE
[2022-09-19 15:50:01][DEBUG] : Running transaction 1
[2022-09-19 15:50:01][DEBUG] : SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x3 0x22 0x31 0x0 0xa
[2022-09-19 15:50:01][DEBUG] : New Transaction state 'SENDING'
[2022-09-19 15:50:01][DEBUG] : Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
[2022-09-19 15:50:02][DEBUG] : Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
[2022-09-19 15:50:02][DEBUG] : RECV: 0x0 0x1 0x0 0x0 0x0 0x17 0x1 0x3 0x14 0x0 0x1 0x80 0x0 0x0 0x7d 0x80 0x0 0x3e 0x80 0x80 0x0 0x80 0x0 0x80 0x0 0x80 0x0 0x80 0x0
[2022-09-19 15:50:02][DEBUG] : Processing: 0x0 0x1 0x0 0x0 0x0 0x17 0x1 0x3 0x14 0x0 0x1 0x80 0x0 0x0 0x7d 0x80 0x0 0x3e 0x80 0x80 0x0 0x80 0x0 0x80 0x0 0x80 0x0 0x80 0x0
[2022-09-19 15:50:02][DEBUG] : Factory Response[ReadHoldingRegistersResponse: 3]
[2022-09-19 15:50:02][DEBUG] : Adding transaction 1
[2022-09-19 15:50:02][DEBUG] : Getting transaction 1
[2022-09-19 15:50:02][DEBUG] : Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
[2022-09-19 15:50:02][DEBUG] : [1, 32768, 125, 32768, 16000, 32768, 32768, 32768, 32768, 32768]
[2022-09-19 15:50:02][ERROR] : Erreur de lecture sur l'automate : TEST2 NSX31
Sur la ligne suivante extraite du log, il y a les résultats que je cherche à obtenir, ces résultats étant exactement les données trouvée via Modbus Doctor :
[2022-09-19 15:50:02][DEBUG] : [1, 32768, 125, 32768, 16000, 32768, 32768, 32768, 32768, 32768]
La donnée qui m’interesse le plus est le 125 (dans le cas présent).
Est-ce qu’il y aurait un moyen, que je n’ai pas vu peut être, qui permet de récupérer individuellement chaque donnée de la ligne en gras avant que le plugin se mette en erreur ?
Je vous remercie à tous par avance