coolchip / node-red-contrib-smartmeter

Node to provide data from smartmeters
MIT License
11 stars 8 forks source link

Compatibility with Node-RED 4.0 #65

Open MPueschel opened 1 week ago

MPueschel commented 1 week ago

Hi,

the Node does not seem to be compatible with Node-RED 4.0. Is there a simple solution for this? Thank you.

MatzeG commented 1 week ago

Same here

DaZeller commented 1 week ago

same here

Update: further information Update2: Finding a Workaround

Ausgabe NodeRed Log:

user@NodeRed: node-red-log Stopped nodered.service - Node-RED graphical event wiring tool. nodered.service: Consumed 38.401s CPU time. Started nodered.service - Node-RED graphical event wiring tool. nodered.service: Referenced but unset environment variable evaluates to an empty string: NODE_RED_OPTIONS 22 Jun 17:56:53 - [info] Welcome to Node-RED 22 Jun 17:56:53 - [info] Node-RED version: v4.0.0 22 Jun 17:56:53 - [info] Node.js version: v18.19.1 22 Jun 17:56:53 - [info] Linux 5.15.158-1-pve x64 LE 22 Jun 17:56:54 - [info] Loading palette nodes 22 Jun 17:56:56 - [info] Dashboard version 3.6.5 started at /ui 22 Jun 17:56:57 - [warn] ------------------------------------------------------ 22 Jun 17:56:57 - [warn] [node-red-contrib-smartmeter/smartmeter] Error: libnode.so.108: cannot open shared object file: No such file or directory 22 Jun 17:56:57 - [warn] [node-red-contrib-smartmeter/smartmeter-connection] Error: libnode.so.108: cannot open shared object file: No such file or directory 22 Jun 17:56:57 - [warn] ------------------------------------------------------ 22 Jun 17:56:57 - [info] Settings file : /home/nodered/.node-red/settings.js 22 Jun 17:56:57 - [info] Context store : 'default' [module=memory] 22 Jun 17:56:57 - [info] User directory : /home/nodered/.node-red 22 Jun 17:56:57 - [warn] Projects disabled : editorTheme.projects.enabled=false 22 Jun 17:56:57 - [info] Flows file : /home/nodered/.node-red/flows.json 22 Jun 17:56:57 - [info] Server now running at http://127.0.0.1:1880/ 22 Jun 17:56:57 - [info] Waiting for missing types to be registered: 22 Jun 17:56:57 - [info] - smartmeter-connection 22 Jun 17:56:57 - [info] - smartmeter

Ausgabe npm installation:

user@NodeRed:~# npm install node-red-contrib-smartmeter 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 deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

Ausgabe Versuch libnode nachträglich zu installieren:

user@NodeRed:~# apt install libnode108 Reading package lists... Done Building dependency tree... Done Reading state information... Done Package libnode108 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libnode109 E: Package 'libnode108' has no installation candidate

--> Es scheint als sei hier evtl. die Ursache des Problems... ?

Trying to find a Workaround by creating a Symlink

user@NodeRed:~ # ln -s /usr/lib/x86_64-linux-gnu/libnode.so.109 /usr/lib/x86_64-linux-gnu/libnode.so.108 user@NodeRed:~ # ls -l /usr/lib/x86_64-linux-gnu/libnode.so* lrwxrwxrwx 1 root root 14 Apr 18 21:08 /usr/lib/x86_64-linux-gnu/libnode.so -> libnode.so.109 lrwxrwxrwx 1 root root 40 Jun 22 18:51 /usr/lib/x86_64-linux-gnu/libnode.so.108 -> /usr/lib/x86_64-linux-gnu/libnode.so.109 -rw-r--r-- 1 root root 47772280 Apr 18 21:08 /usr/lib/x86_64-linux-gnu/libnode.so.109

This shifted the problem to the "next stage" and is now:

user@NodeRed:~ # service nodered restart user@NodeRed:~ # node-red-log 22 Jun 18:51:51 - [info] Welcome to Node-RED 22 Jun 18:51:51 - [info] Node-RED version: v4.0.0 22 Jun 18:51:51 - [info] Node.js version: v18.19.1 22 Jun 18:51:51 - [info] Linux 5.15.158-1-pve x64 LE 22 Jun 18:51:52 - [info] Loading palette nodes 22 Jun 18:51:54 - [info] Dashboard version 3.6.5 started at /ui 22 Jun 18:51:54 - [warn] ------------------------------------------------------ 22 Jun 18:51:54 - [warn] [node-red-contrib-smartmeter/smartmeter] Error: The module '/home/nodered/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 108. This version of Node.js requires NODE_MODULE_VERSION 109. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). 22 Jun 18:51:54 - [warn] [node-red-contrib-smartmeter/smartmeter-connection] Error: Module did not self-register: '/home/nodered/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node'. 22 Jun 18:51:54 - [warn] ------------------------------------------------------ 22 Jun 18:51:54 - [info] Settings file : /home/nodered/.node-red/settings.js 22 Jun 18:51:54 - [info] Context store : 'default' [module=memory] 22 Jun 18:51:54 - [info] User directory : /home/nodered/.node-red 22 Jun 18:51:54 - [warn] Projects disabled : editorTheme.projects.enabled=false 22 Jun 18:51:54 - [info] Flows file : /home/nodered/.node-red/flows.json 22 Jun 18:51:54 - [info] Server now running at http://127.0.0.1:1880/ 22 Jun 18:51:54 - [info] Waiting for missing types to be registered: 22 Jun 18:51:54 - [info] - smartmeter-connection 22 Jun 18:51:54 - [info] - smartmeter

ThomasCr commented 3 days ago

I have now the same problem... :(

jgantenberg commented 2 days ago

There seems to be an issue with the upgrade from node-red 3.1 to 4.0. I run node-red with smartmeter module in a docker container and the upgrade to node-red 4.0 brought the discussed error. But now I set up a new blank container, installed all needed modules via palette and imported my flows from the old container. As usual I had to fill credentials manually but after that everything works fine.

MatzeG commented 2 days ago

thx jgantenberg

also first uninstalling only the smartmeter component, updating to nodered 4.0.x and reinstalling the smartmeter works for me in the docker environment

MPueschel commented 1 hour ago

thx jgantenberg and MatzeG

MatzeG's approach worked perfectly for me.

I previously exported the smartmeter-node config and imported it again after updating and reinstalling.