@sdetweil thx!
Read the statement by Michael Teeuw here.
Posts
-
RE: Need "correct" version of node-libgpiod ....
@sdetweil Dear Sam,
I was able to get this done - to my big surprise …
As announced, I just have pushed it to git and will post a corresponding message tomorrow.
Do I get it right that it is recommended to edit the modules page as well?
And the 3rd Party Modules page then will populate by itself, right?
Thanks!Warmest regards,
Ralf -
RE: Need "correct" version of node-libgpiod ....
@schlomm I’m absolute beginner …
Had HEAVILY used AI to get this done and have recycled a LOT.GPIO part is from old (discontinued) module MMM-Pir from Bugsounet.
This is reflected in pirLib.js - sliightly modified for my purposes.I do have a repository - pushed literally minutes ago …
Feel free to have a look.Buttons should work with some modification. Essentiall for my purposes I simply query state of a single GPIO pin - to which a PIR sensor is connected. Code must be enhanced to handle more than one pin - if you are talking about “butons” - which signals plural…
As mentioned such modification should be doable with AI as well.
[ EDIT : My system is a raspi5 / bookworm as well - this is main reason for some difficulties. Some procedures simply doesn’t work anymore with new libraries and I had to change implementation…]
Good luck!
Warm regards,
Ralf -
RE: Need "correct" version of node-libgpiod ....
@sdetweil Dear Sam,
just FYI: I’ve just identified that my main problem is NOT the version mismatch but a major change in node-libgpiod’s handling of GPIO-ressources.
This was the main reason for mal-function of PIR sensor detection. “Version” was a side effect, not root-cause.
I’m nearly done with this and it seems that it will work as intended…Thanks again for your support!
Regards,
Ralf -
RE: Need "correct" version of node-libgpiod ....
@sdetweil OK; thanks.
I will stop to handle these mismatches.
Will try to get the MM-Module runnable .
Console/terminal runs with node may not be necessary …
Thanks anyway for your kind support!
Ralf -
RE: Need "correct" version of node-libgpiod ....
@sdetweil Dear Sam,
thanks again for this long explanation!My versions (if I interpret correctly) doesn’t mismatch :-(
0|MagicMir | ### SYSTEM: manufacturer: ; model: ; virtual: false 0|MagicMir | ### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.12.20+rpt-rpi-2712 0|MagicMir | ### VERSIONS: electron: 32.2.7; used node: 20.18.1; installed node: 20.18.1; npm: 10.8.2; pm2: 5.4.3 0|MagicMir | ### OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefinedSo I’m not sure at all, what to do.
pi@MagicMirrorPi5:~ $ n list node/20.18.1Does show up exact this version, as well.
Where are my problems from ???
Thanks a LOT for any idea!Ralf
-
RE: Need "correct" version of node-libgpiod ....
@sdetweil
Dear Sam, OK, thanks for this.
Not fully understood…How can I
- figure out, how my mirror is started? (looooong ago I‘ve used your install script and (if I remember correctly) I‘ve answered „yes“ to „do you want automatically start your mirror at system startup“ - or something similar. - Never took care about, what is done - it worked (and still works)…)
- double check the above „VERSIONS“ - message - is this message in logfile?
- can I get „keeping the node versions synched“?
Thanks for further advise!
Warmest regards,
Ralf -
RE: Need "correct" version of node-libgpiod ....
@sdetweil said
you should know if you run
node serveronly, then the bytecode has to match the nodejs standalone engine versionOK, thanks.
It seems that rebuild have corrected the error for the module.
When I try to run a node-command in the shell (terminal) then I get an similar error message as above.
Is this caused by your explanation part above?
Different versions needed for either terminal or inside mirror?
Can you tell me HOW the magic mirror is started (when I have used your install script)?Is there a way to test something which had to run in the mirror (like the module) on commandline?
To illustrate what I mean:
I have a very short test-script test-gpiod.js// test-gpiod.js , Aug 2025, Dr. Ralf Korell const { Chip } = require("node-libgpiod"); try { const chip = new Chip(0); console.log("Chip label:", chip.getChipLabel()); } catch (err) { console.error("Error loading chip:", err); }which I try to run with
node test-gpiod.jsBut this produces error message:
/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/bindings/bindings.js:121 throw e; ^ Error: The module '/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/node-libgpiod/build/Release/node-libgpiod.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 128. This version of Node.js requires NODE_MODULE_VERSION 115. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`). at Module._extensions..node (node:internal/modules/cjs/loader:1586:18) at Module.load (node:internal/modules/cjs/loader:1288:32) at Module._load (node:internal/modules/cjs/loader:1104:12) at Module.require (node:internal/modules/cjs/loader:1311:19) at require (node:internal/modules/helpers:179:18) at bindings (/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/bindings/bindings.js:112:48) at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-PresenceScreenControl/node_modules/node-libgpiod/lib/misc.js:1:37) at Module._compile (node:internal/modules/cjs/loader:1469:14) at Module._extensions..js (node:internal/modules/cjs/loader:1548:10) at Module.load (node:internal/modules/cjs/loader:1288:32) { code: 'ERR_DLOPEN_FAILED' } Node.js v20.18.1Thanks for any help!
Warmest regards,
Ralf -
RE: Need "correct" version of node-libgpiod ....
@sdetweil Dear Sam,
thanks for this information.
Can you please enlighten me?
I can read what you wrote and I got a light idea - but didn’t understand …I definitely have used your install script.
what is @electron and
what correlation is between node-libgpiod and @electron ? and what will this../../node_modules/.bin/electron-rebuilddo?
Sorry for these questions - I would like to understand, what happens.
If this is “neccessary” I will try to automate this for others with a postinstall script.
Thanks for your effort!
warmest regards,
Ralf