Probleme compatibilité plugin mySensors après MAJ Raspbian

Bonjour les amis,
Depuis une mise à jour, mon plugin mySensors ne fonctionne plus.
Pour résoudre ce problème j’ai donc refait une installation complète sur la base d’une image officielle stable Rasbian 10 buster sur mon materiel Raspberry Pi 3 et j’ai rechargé une sauvegarde de base de données mais cette solution n’a pas résolu le problème.

J’ai d’installé et réinstallé complètement le plugin en version stable.
Le core jeedom est en version 4.2.14
J’ai positionné les log en mode debug pour avoir le maximum d’informations.
le log mySensors

[2022-04-30 08:22:08]: Début d'activation du plugin
[2022-04-30 08:22:09]: Info sur le démon : {"launchable_message":"","launchable":"nok","state":"nok","log":"nok","auto":0}
[2022-04-30 08:22:09]: Lancement de : /var/www/html/core/class/../../core/php/jeePlugin.php  plugin_id=mySensors function=install callInstallFunction=1

le log d’installation des dépendances

Début de l'installation
--2022-04-30 08:22:46--  https://raw.githubusercontent.com/lunarok/jeedom_nodejs/master/nodejs.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8003::154, 2606:50c0:8000::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1552 (1.5K) [text/plain]
Saving to: 'dependencies.sh'
0K .                                                     100% 3.60M=0s
2022-04-30 08:22:46 (3.60 MB/s) - 'dependencies.sh' saved [1552/1552]
dependencies.sh: 3: [: mySensors: unexpected operator
Version actuelle : 14
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 https://deb.nodesource.com/node_14.x buster InRelease
Fetched 15.0 kB in 1s (10.3 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
lsb-release is already the newest version (10.2019051400+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
dependencies.sh: 29: dependencies.sh: [[: not found
KO, version obsolète à upgrader
Suppression du Nodejs existant et installation du paquet recommandé
Reading package lists...
Building dependency tree...
Reading state information...
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
nodejs*
0 upgraded, 0 newly installed, 1 to remove and 9 not upgraded.
After this operation, 117 MB disk space will be freed.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 71030 files and directories currently installed.)
Removing nodejs (14.19.1-deb-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
dependencies.sh: 38: [: armv7l: unexpected operator
Utilisation du dépot officiel
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
## Confirming "buster" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
nodejs
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 0 B/23.3 MB of archives.
After this operation, 117 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 66068 files and directories currently installed.)
Preparing to unpack .../nodejs_14.19.1-deb-1nodesource1_armhf.deb ...
Unpacking nodejs (14.19.1-deb-1nodesource1) ...
Setting up nodejs (14.19.1-deb-1nodesource1) ...
Processing triggers for man-db (2.8.5-2) ...
ln: failed to create symbolic link '/usr/bin/nodejs': File exists
Version actuelle : v14.19.1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
> @serialport/bindings-cpp@10.7.0 install /var/www/html/plugins/mySensors/resources/node_modules/@serialport/bindings-cpp
> node-gyp-build
npm notice created a lockfile as package-lock.json. You should commit this file.
added 68 packages from 146 contributors and audited 68 packages in 14.751s
14 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Fin de l'installation

Le log mySensors_node

Sat Apr 30 2022 08:25:07 GMT+0200 (heure d’été d’Europe centrale) - Jeedom url : http://127.0.0.1:80/plugins/mySensors/core/api/jeeSensors.php?apikey=2390nvMwUO5KZJfBfy4O8bJYBnFPZZuqPMiMS2fxghqbaKLCnpvv1eOD6RcRPLlC&gateway=master, gwAddress : /dev/ttyUSB1
Connection type serial
/var/www/html/plugins/mySensors/resources/mysensors.js:230
gw = new SerialPort(gwAddress);
^
TypeError: SerialPort is not a constructor
at launchGateway (/var/www/html/plugins/mySensors/resources/mysensors.js:230:7)
at Object. (/var/www/html/plugins/mySensors/resources/mysensors.js:306:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47

Merci de votre lumière.
Claude

Bonjour,

Cela semble être un problème similaire à Probleme compatibilité plugins RfLink après MAJ Raspbian avec le package serial.

1 « J'aime »

Oui ça y ressemble.
Aussi j’ai essayé d’installer la version beta du plugin sans succès.

Bonjour,
C’est la version de SerialPort qui ne va pas bien. Essaye ça !

Merci Mmx, tout est OK après avoir fait la modification dans :
/plugins/mySensors/resources/package.json et remplacer « latest » par « ~9.2.0 » dans la ligne serialport
J’avais dèjà essayé cette modification sans succès pour le problème sur le plugin RfLink mais je n’avais pas essayé avec le plugin mySensors.
Je vais donc mettre le problème comme résolu.

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.