All RPi GPIO pins showing N/A

Hey gang,
After a mass update of nodes, my GPIO pins are now showing N/A: 0 and are non-operational.
I tried to roll back to 1.2.3 with npm install node-red-node-pi-gpio@1.2.3 but I see rollback option failed:

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

+ node-red-node-pi-gpio@1.2.3
updated 1 package and audited 67 packages in 1.505s

6 packages are looking for funding
  run `npm fund` for details

found 17 vulnerabilities (13 moderate, 4 high)
  run `npm audit fix` to fix them, or `npm audit` for details
pi@raspberrypi:~ $ npm audit
npm ERR! code EAUDITNOPJSON
npm ERR! audit No package.json found: Cannot audit a project without a package.j                                                                                            son

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2022-01-24T14_54_58_300Z-debug.log

2022-01-24T14_54_58_300Z-debug.log:

1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'audit' ]
2 info using npm@6.14.15
3 info using node@v12.22.9
4 verbose config Skipping project config: /home/pi/.npmrc. (matches userconfig)
5 verbose npm-session 7b1a01aeeeb69daa
6 verbose stack Error: No package.json found: Cannot audit a project without a package.json
6 verbose stack     at /usr/lib/node_modules/npm/lib/audit.js:164:19
6 verbose stack     at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
6 verbose stack     at Promise._settlePromiseFromHandler (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:514:35)
6 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
6 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
6 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
6 verbose stack     at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:643:18)
6 verbose stack     at PromiseArray._resolve (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:126:19)
6 verbose stack     at PromiseArray._promiseFulfilled (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:144:14)
6 verbose stack     at PromiseArray._iterate (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:114:31)
6 verbose stack     at PromiseArray.init [as _init] (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:78:10)
6 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:571:21)
6 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:619:10)
6 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:699:18)
6 verbose stack     at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:643:18)
6 verbose stack     at PromiseArray._resolve (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise_array.js:126:19)
7 verbose cwd /home/pi
8 verbose Linux 5.10.63-v7l+
9 verbose argv "/usr/bin/node" "/usr/bin/npm" "audit"
10 verbose node v12.22.9
11 verbose npm  v6.14.15
12 error code EAUDITNOPJSON
13 error audit No package.json found: Cannot audit a project without a package.json
14 verbose exit [ 1, true ]

Any suggestions on the next step to take, please?

Thank you,
Dax.

You are running the command from the wrong folder, you should be running it from the .node-red folder.

Before downgrading, unless you can point to a known issue with the latest version, stop node-red in a terminal and start it again and post the full terminal output here. That may allow us to identify the problem. You can stop and start using
node-red-stop
node-red-start

Hey Colin, thanks so much for your reply.

I've done that and this is what I get. The GPIO nodes are still showing N/A: 0

Starting as a systemd service.
24 Jan 17:35:09 - [info]
Welcome to Node-RED
===================
24 Jan 17:35:09 - [info] Node-RED version: v1.2.8
24 Jan 17:35:09 - [info] Node.js  version: v12.22.9
24 Jan 17:35:09 - [info] Linux 5.10.63-v7l+ arm LE
24 Jan 17:35:10 - [info] Loading palette nodes
Missing ENV var CONFIG_PATH
24 Jan 17:35:12 - [info] Dashboard version 3.1.5 started at /ui
24 Jan 17:35:13 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
24 Jan 17:35:13 - [info] Settings file  : /home/pi/.node-red/settings.js
24 Jan 17:35:13 - [info] HTTP Static    : /home/pi/node-red-static
24 Jan 17:35:13 - [info] Context store  : 'default' [module=memory]
24 Jan 17:35:13 - [info] User directory : /home/pi/.node-red
24 Jan 17:35:13 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Jan 17:35:13 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
24 Jan 17:35:13 - [info] Server now running at http://127.0.0.1:1880/
24 Jan 17:35:13 - [warn]
---------------------------------------------------------------------
24 Jan 17:35:13 - [info] Starting flows
24 Jan 17:35:14 - [info] Started flows
24 Jan 17:35:14 - [info] [mqtt-broker:RPi MQTT Server] Connected to broker: mqtt://localhost:1883
24 Jan 17:35:17 - [info] [e-mail:dax@puzzlefactory.uk] Message sent: 250 OK id=xxxxxxxxxx
24 Jan 17:35:18 - [info] [e-mail:dax@puzzlefactory.uk] Message sent: 250 OK id=xxxxxxxxxx
24 Jan 17:35:26 - [info] [e-mail:dax@puzzlefactory.uk] Message sent: 250 OK id=xxxxxxxxxx

Oh boy! I just discovered that my NR version is WAAAY behind.
I'm going to update that now and report back. Perhaps some of the updated nodes have dependencies that don't exist in v1.2.8.

Is there a way to enable auto-updates or at least get a notification when a new stable version is released?

Also updated Node.JS to 14.18.3 and installed NVM (why the heck didn't I have that before?! :slight_smile: )

And I'm very happy to say that my GPIO nodes are working once again. GREAT!

Once again, thanks so much, Colin. If you'd not replied, I never would have thought to check my NR version.

The problem with using nvm is that then you cannot use the usual install script for installing/updating node red and nodejs.

Ahh, interesting! So considering this RPi is used 99% for Node-RED, you'd suggest removing NVM and using the update scripts?

Also, where can I find those update scripts, please?

All the best,
Dax.

There's a great page on nodered.org dedicated to this topic ...

Regards, Ralph

1 Like

Thank you, Ralph!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.