Plantage d'un plugin... problème de Heartbeat ?

Posez ici vos questions d'utilisation, de configuration de DomoticZ, de bugs, de conseils sur le logiciel lui même dans son utilisation et son paramétrage.
Des forums spécifiques sont ouverts ci-dessous pour regrouper les différents sujets.
f-d-m
Messages : 156
Inscription : 25 juin 2019, 21:36

Plantage d'un plugin... problème de Heartbeat ?

Message par f-d-m »

Bonjour,

Je rame depuis plusieurs mois avec un problème aléatoire avec un script qui plante complètement Domoticz.
Ce script doit questionner en HTTP un appareil qui expose un serveur web, récupérer la réponse et mettre à jour des variables Domoticz.
Ce script est un plugin écrit en Python.
Il doit se relancer toutes les X secondes et pour cela il utilise Domoticz.Heartbeat() si j'ai bien compris.
A partir d'un certain moment le plugin cesse de fonctionner et chaque itération envoie dans le log:
Error: xxx hardware (xxx) thread seems to have ended unexpectedly
Les autres threads continuent à fonctionner, et si on touche à un réglage du 'hardware' correspondant, Domoticz crashe immédiatement sans vraiment crasher. Il ne répond plus à rien, ne lance plus les actions, mais le process unix est toujours bien là.

Je suis bien incapable de dire si on est face à'un dépassement de ressources, un memory leak, un bug dans Domoticz ou dans le plugin.

Voici l'environnement :
Domoticz 2024.7 (désolé) sous Debian 11.11 (re-désolé), Python 3.9.2, Rasperry Pi 3B+
Matériel annexe: dongle pour compteur électrique HomeWizard https://www.homewizard.com/fr-be/p1-meter/
Plugin: https://github.com/Eraser3/HomeWizard-Wifi-p1-plugin

Avec le log en mémoire, je n'arrive jamais à remonter suffisamment haut pour tenter de trouver l'élément déclencheur.
Aussi j'ai opté pour un renvoi du log vers syslog, mais on perd les millèmes de secondes des time stamps.

Voici donc le syslog du dernier plantage en date:

Code : Tout sélectionner

Feb 19 12:18:13 rpi3b domoticz: (Phase 1 (A)) Updating device from 0:'2.210;0' to have values 0:'2.300;0'.
Feb 19 12:18:13 rpi3b domoticz: (Phase 2 (A)) Updating device from 0:'0.000;0' to have values 0:'0.000;0'.
Feb 19 12:18:13 rpi3b domoticz: (Phase 3 (A)) Updating device from 0:'2.660;0' to have values 0:'2.560;0'.
Feb 19 12:18:13 rpi3b domoticz: (Gaz) Updating device from 0:'1669880' to have values 0:'1669907'.
Feb 19 12:18:13 rpi3b domoticz: (Compteur HW - Wifi signal) Updating device from 0:'24' to have values 0:'28'.
Feb 19 12:18:13 rpi3b domoticz: (Compteur HW - Production switch) Updating device from 1:'On' to have values 0:'Off'.
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Pushing 'onHeartbeatCallback' on to queue
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Processing 'onHeartbeatCallback' message
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Calling message handler 'onHeartbeat' on 'module' type object.
Feb 19 12:18:13 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:22 rpi3b domoticz: Compteur HW: Pushing 'onHeartbeatCallback' on to queue
Feb 19 12:18:22 rpi3b domoticz: Compteur HW: Processing 'onHeartbeatCallback' message
Feb 19 12:18:22 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:22 rpi3b domoticz: Compteur HW: Calling message handler 'onHeartbeat' on 'module' type object.
Feb 19 12:18:22 rpi3b domoticz: (Compteur HW - Current power usage) Updating device from 0:'57;1637428' to have values 0:'-14;1637428'.
Feb 19 12:18:22 rpi3b domoticz: (Electricité) Updating device from 0:'1466521;1910854;1226528;513419;57;0' to have values 0:'1466521;1910854;1226528;513419;0;14'.
... autres "Updating device" ...
Feb 19 12:18:22 rpi3b domoticz: (Compteur HW - Production switch) Updating device from 0:'Off' to have values 1:'On'.
Feb 19 12:18:22 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:31 rpi3b domoticz: Compteur HW: Pushing 'onHeartbeatCallback' on to queue
Feb 19 12:18:31 rpi3b domoticz: Compteur HW: Processing 'onHeartbeatCallback' message
Feb 19 12:18:31 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:31 rpi3b domoticz: Compteur HW: Calling message handler 'onHeartbeat' on 'module' type object.
Feb 19 12:18:31 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:40 rpi3b domoticz: Compteur HW: Pushing 'onHeartbeatCallback' on to queue
Feb 19 12:18:40 rpi3b domoticz: Compteur HW: Processing 'onHeartbeatCallback' message
Feb 19 12:18:40 rpi3b domoticz: Compteur HW: Acquiring GIL for 'onHeartbeatCallback'
Feb 19 12:18:40 rpi3b domoticz: Compteur HW: Calling message handler 'onHeartbeat' on 'module' type object.
Feb 19 12:19:43 rpi3b domoticz: Compteur HW hardware (9) thread seems to have ended unexpectedly
Feb 19 12:19:57 rpi3b domoticz: Compteur HW hardware (9) thread seems to have ended unexpectedly
Feb 19 12:20:11 rpi3b domoticz: Compteur HW hardware (9) thread seems to have ended unexpectedly
Feb 19 12:20:25 rpi3b domoticz: Compteur HW hardware (9) thread seems to have ended unexpectedly
Feb 19 12:20:39 rpi3b domoticz: Compteur HW hardware (9) thread seems to have ended unexpectedly
... et ainsi de suite, il ne retombe pas sur ses pattes...
(j'ai activé la fonction debug, changé le Heartbeat de 10 à 9 secondes pour voir l'effet dans le log).
Je vais essayer de contacter l'auteur via Github.
Si ce comportement erratique vous inspire, merci de revenir vers moi !
---
Bruxelles

RPi 3B, Domoticz 2024.7, SSD, dongle Zigbee Sonoff
IPX-800 V3
multiples Sonoff et similaires (Tasmota, ESPeasy), multiples appareils Zigbee
SMA Sunny Boy 3.6
Ksenia Lares 4.0
Compteur digital à la norme DSMR5 - interface ESP32
Répondre