Z2m ne démarre plus

Bonjour,

Au reboot de mon PI4, z2m ne démarre plus.
J’ai cette erreur dans les logs.

> zigbee2mqtt@1.37.0 start
> node index.js
[2024-05-06 17:40:19] e[31merrore[39m: 	z2m: Failed to load external converter file '/var/www/html/plugins/z2m/core/class/../config/converters/Danfoss/icon.js' (Cannot find module 'zigbee-herdsman-converters/lib/extend'
Require stack:
- /var/www/html/plugins/z2m/resources/zigbee2mqtt/dist/util/utils.js
- /var/www/html/plugins/z2m/resources/zigbee2mqtt/dist/util/settings.js
- /var/www/html/plugins/z2m/resources/zigbee2mqtt/index.js)
[2024-05-06 17:40:19] e[31merrore[39m: 	z2m: Probably there is a syntax error in the file or the external converter is not compatible with the current Zigbee2MQTT version
[2024-05-06 17:40:19] e[31merrore[39m: 	z2m: Note that external converters are not meant for long term usage, it's meant for local testing after which a pull request should be created to add out-of-the-box support for the device
[2024-05-06 17:40:20] e[31merrore[39m: 	z2m: Error while starting zigbee-herdsman
[2024-05-06 17:40:20] e[31merrore[39m: 	z2m: Failed to start zigbee
[2024-05-06 17:40:20] e[31merrore[39m: 	z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-05-06 17:40:20] e[31merrore[39m: 	z2m: Exiting...
[2024-05-06 17:40:20] e[31merrore[39m: 	z2m: Error: No path provided and failed to auto detect path
at Function.create (/var/www/html/plugins/z2m/resources/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/adapter.ts:78:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Controller.start (/var/www/html/plugins/z2m/resources/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/controller.ts:122:24)
at Zigbee.start (/var/www/html/plugins/z2m/resources/zigbee2mqtt/lib/zigbee.ts:62:27)
at Controller.start (/var/www/html/plugins/z2m/resources/zigbee2mqtt/lib/controller.ts:108:27)
at start (/var/www/html/plugins/z2m/resources/zigbee2mqtt/index.js:107:5)

J’ai donc commencé par réinstaller les dépendances, dont les logs sont ci dessous, mas rien n’y fait.
Il semblerait qu’un module zigbee-herdsman soit en cause, mais cela ne me parle absolument pas.


+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_z2m
+ echo 1
+ echo 2
+ sudo chmod +x /var/www/html/core/class/../../plugins/z2m/resources/pre-install.sh
+ sudo /var/www/html/core/class/../../plugins/z2m/resources/pre-install.sh
Launch pre-install of z2m dependancy
+ echo 3
+ php /var/www/html/core/class/../php/jeecli.php plugin install mqtt2
apt: no process found
apt-get: no process found
unattended-upgr: no process found
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Hit:1 http://phoscon.de/apt/deconz bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://phoscon.de/apt/deconz bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
git is already the newest version (1:2.30.2-1+deb11u2).
lsb-release is already the newest version (11.1.0+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v18.20.2 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://phoscon.de/apt/deconz bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
git is already the newest version (1:2.30.2-1+deb11u2).
lsb-release is already the newest version (11.1.0+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v18.20.2 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:4 http://phoscon.de/apt/deconz bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
git is already the newest version (1:2.30.2-1+deb11u2).
lsb-release is already the newest version (11.1.0+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v18.20.2 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
--2024-05-06 17:04:14--  https://getcomposer.org/installer
Resolving getcomposer.org (getcomposer.org)... 2001:41d0:302:1100::8:104f, 54.36.53.46
Connecting to getcomposer.org (getcomposer.org)|2001:41d0:302:1100::8:104f|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58444 (57K) [application/octet-stream]
Saving to: 'composer-setup.php'
0K .......... .......... .......... .......... .......... 87% 1.84M 0s
50K .......                                               100% 19.5M=0.03s
2024-05-06 17:04:15 (2.08 MB/s) - 'composer-setup.php' saved [58444/58444]
Begin installation of composer
All settings correct for using Composer
Downloading...
Composer (version 2.7.6) successfully installed to: /var/www/html/core/ajax/composer.phar
Use it: php composer.phar
End installation of composer
added 115 packages, and audited 116 packages in 6s
18 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
Synchronizing state of mosquitto.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mosquitto
+ echo 4
+ sudo killall apt apt-get unattended-upgr
apt: no process found
apt-get: no process found
unattended-upgr: no process found
+ sudo rm /var/lib/apt/lists/lock
+ sudo rm /var/cache/apt/archives/lock
+ sudo rm /var/lib/dpkg/lock /var/lib/dpkg/lock-frontend
+ sudo sudo dpkg --configure -a --force-confdef
+ sudo apt update
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://phoscon.de/apt/deconz bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
+ echo 5
+ sudo chmod +x /var/www/html/core/class/../../resources/install_nodejs.sh
+ sudo /var/www/html/core/class/../../resources/install_nodejs.sh
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://phoscon.de/apt/deconz bullseye InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:6 https://repo.jellyfin.org/debian bullseye InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
git is already the newest version (1:2.30.2-1+deb11u2).
lsb-release is already the newest version (11.1.0+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v18.20.2 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
+ echo 6
+ sudo apt install -o Dpkg::Options::=--force-confdef -y php-yaml
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
php-yaml is already the newest version (2.2.1+2.1.0+2.0.4+1.3.2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ echo 7
+ sudo systemctl restart apache2
+ echo 8
+ sudo chmod +x /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ sudo /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ echo Launch post-install of z2m dependancy
Launch post-install of z2m dependancy
+ realpath /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ dirname /var/www/html/plugins/z2m/resources/post-install.sh
+ BASEDIR=/var/www/html/plugins/z2m/resources
+ [ -d /var/www/html/plugins/z2m/resources/zigbee2mqtt ]
+ rm -rf /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ mkdir /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /var/www/html/plugins/z2m/resources/zigbee2mqtt
Cloning into '/var/www/html/plugins/z2m/resources/zigbee2mqtt'...
+ cd /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ [ -f /var/www/html/plugins/z2m/resources/../data/wanted_z2m_version ]
+ npm ci
added 803 packages, and audited 804 packages in 52s
92 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
+ npm run build
> zigbee2mqtt@1.37.0 build
> tsc && node index.js writehash
+ chown www-data:www-data -R /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ echo 9
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end z2m
+ echo 10
+ rm /tmp/jeedom_install_in_progress_z2m
+ echo '*******************End of package installation******************'
*******************End of package installation******************

Informations Jeedom

Core : 4.4.5 (V4-stable)
DNS Jeedom : non

Plugin : JeeZigbee
Version : 2024-04-24 01:01:56 (stable)
Statut Démon : Stoppé - (2024-05-06 17:40:07)

J’ai fini par comprendre !
Les logs d’erreur induisent un peu en erreur, je trouve, car cela n’a rien à voir avec les external converters ou le module zigbee-herdsman.
La seule ligne vraiment importante est la suivante:

Error: No path provided and failed to auto detect path

En réalité j’ai perdu la configuration de ma clé Raspbee 2 en redémarrant le démon du plugin JeeZigbee: Je n’avais pas fait attention mais mon « Port du contrôleur » était vide dans le formulaire de configuration du plugin, or il semble bien qu’une sauvegarde automatique de la configuration soit faite quand on le redémarre.

En creusant un peu plus, je constate en effet que mon port (/dev/ttyS0) n’est pas dans la liste de choix.

Je m’en suis sorti en modifiant la configuration du plugin directement en base de données.
Mais, pour ne perdre à nouveau la configuration en validant le formulaire de configuration qui n’affiche toujours pas mon port, j’ai modifié le fichier plugin_info/configuration.php pour l’ajouter à la façon du port /dev/ttyS2 pour le modèle Atlas, inséré en ligne 59

  if(file_exists('/dev/ttyS0')){
  	echo ' <option value="/dev/ttyS0">{{Raspbee II (/dev/ttyS0)}}</option>';
  }

Informations importantes pour les dev, en plus de ceux qui est déjà disponible dans la signature du premier post:

Raspberry PI 4B
Debian 11
Raspbee II sur le connecteur GPIO standard à 40 pin, firmware 0x26780700

Et je ne sais pas pourquoi ce n’est pas le port /dev/ttyAMA0 comme j’ai pu lire à maintes reprises.