Deamon KO Mysensors sur fresh install jeedom : Solution

Bonjour,
Je viens de réinstaller complètement Jeedom à partir de l’image iso. Récupération de la sauvegarde, tout fonctionne sauf mysensors :

  • les dépendances ne sont pas lancées quand on appuie dessus
  • quand on les lance en ssh depuis le dossier ressources, on obtient ceci :

Début de l'installtion
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
build-essential est déjà la version la plus récente (12.6).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 14 non mis à jour.
mkdir: impossible de créer le répertoire « /var/www »: Le fichier existe
install.sh: ligne 16 : cd: ../node/: Aucun fichier ou dossier de ce type
rm: impossible de supprimer 'package.json': Aucun fichier ou dossier de ce type
npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-07-19T21_58_13_060Z-debug.log
npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

> @serialport/bindings-cpp@10.7.0 install /root/node_modules/@serialport/bindings-cpp
> node-gyp-build

npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.

+ serialport@10.4.0
added 21 packages from 88 contributors in 14.418s

Broadcast message from root@jeedom (somewhere) (Tue Jul 19 23:58:32 2022):

Communications restored with UPS jeedom UPS_IDEN

npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
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.
npm WARN saveError ENOENT: no such file or directory, open '/root/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.

+ request@2.88.2
added 47 packages from 58 contributors in 8.72s
Fin de l'installtion

Ensuite dans les logs on obtient ceci :

nice: « nodejs »: Aucun fichier ou dossier de ce type
nice: « nodejs »: Aucun fichier ou dossier de ce type
nice: 'nodejs': No such file or directory
nice: « nodejs »: Aucun fichier ou dossier de ce type
nice: 'nodejs': No such file or directory
nice: 'nodejs': No such file or directory
nice: « nodejs »: Aucun fichier ou dossier de ce type
Tue Jul 19 2022 23:33:31 GMT+0200 (Central European Summer Time) - Jeedom url : http://127.0.0.1:80/plugins/mySensors/core/api/jeeSensors.php?apikey=AbghgfQqQESQJHYD6JySQfxI2mAXWfN67nc453cQ6dc2CMBN&gateway=master, gwAddress : /dev/ttyUSB22
Connection type serial
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'serialport'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at launchGateway (/var/www/html/plugins/mySensors/resources/mysensors.js:229:19)
    at Object.<anonymous> (/var/www/html/plugins/mySensors/resources/mysensors.js:306:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Tue Jul 19 2022 23:35:11 GMT+0200 (heure d’été d’Europe centrale) - Jeedom url : http://127.0.0.1:80/plugins/mySensors/core/api/jeeSensors.php?apikey=AbghgfQqQESQJHYD6JySQfxI2mAXWfN67nc453cQ6dc2CMBN&gateway=master, gwAddress : /dev/ttyUSB22
Connection type serial
internal/modules/cjs/loader.js:638
    throw err;
    ^

J’ai lu les posts qui parlent du serial mais le batch a bien le correctif.

Et le demon ne se lance pas.

Ici, peut être ?

Merci. Ca corrige une des erreurs.
reste :


Wed Jul 20 2022 00:25:58 GMT+0200 (Central European Summer Time) - Jeedom url : http://127.0.0.1:80/plugins/mySensors/core/api/jeeSensors.php?apikey=AbghgfQqQESQJHYD6JySQfxI2mAXWfN67nc453cQ6dc2CMBN&gateway=master, gwAddress : /dev/ttyUSB22
Connection type serial
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'serialport'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at launchGateway (/var/www/html/plugins/mySensors/resources/mysensors.js:229:19)
    at Object.<anonymous> (/var/www/html/plugins/mySensors/resources/mysensors.js:306:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Wed Jul 20 2022 00:26:10 GMT+0200 (heure d’été d’Europe centrale) - Jeedom url : http://127.0.0.1:80/plugins/mySensors/core/api/jeeSensors.php?apikey=AbghgfQqQESQJHYD6JySQfxI2mAXWfN67nc453cQ6dc2CMBN&gateway=master, gwAddress : /dev/ttyUSB22
Connection type serial
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'serialport'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at launchGateway (/var/www/html/plugins/mySensors/resources/mysensors.js:229:19)
    at Object.<anonymous> (/var/www/html/plugins/mySensors/resources/mysensors.js:306:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

Il ne trouve pas serialport alors que ci-dessus les logs indiquent que c’est ok.

1 « J'aime »

En le faisant comme ceci :

npm install serialport

c’est OK

1 « J'aime »

Installation de Mysensors sur jeedom 4.2 à partir de l’image fournie par Jeedom
jeedom-debian-buster-amd64-4.2.20

Les modifications à faire sont les suivantes :
1 - modifier la ligne 232 du fichier /mysensors/core/class/mySensors.calss.php par :

 $cmd = 'nice -n 19 node ' . $sensor_path . '/mysensors.js ' . $url . ' ' . $gateway . ' ' . $log;

utiliser l’éditeur de fichier jeedom
2 - modifier la ligne 20 du fichier /mysensors/ressources/install.sh

sudo npm install serialport

utiliser l’éditeur de fichier jeedom

3 pour lancer les dépendances aller dans /mysensors/ressources/
en ssh, taper :
sudo bash install.sh

Variantes possibles :
Je n’ai pas testé le 2, j’ai lancé l’install.sh puis après tapé la commande d’install du serialport

1 « J'aime »