# Rpi-gpio input node "stopped"

**URL:** <https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184>\
**Category:** General\
**Created:** [25 November 2018 18:22 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184 "2018-11-25T18:22:58Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 July 2019 11:42 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/22 "2019-07-11T11:42:26Z")

</div>

> [@naamah75](#):
>
> Failed to get version from Pi

is the failure line... so can you at a command line do

```
cd /usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/hardware
./nrgpio info

```

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [11 July 2019 13:22 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/23 "2019-07-11T13:22:12Z")

</div>

@dceejay I guess you got the problem... this is the output of the command:

```auto
raceback (most recent call last):
  File "./nrgpio.py", line 17, in <module>
    import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

```

In addition I've tried to use the `node-red-contrib-camerapi` node, and also in this case the node doesn't work.  
So... I decided to install a new Rasbian on an a new SD card and then tried to use the GPIO and the camera and now all works.  
Well, what I've broke on the original Rasbpian?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 July 2019 13:41 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/24 "2019-07-11T13:41:04Z")

</div>

looks like the python gpio libraries weren't installed.. which is odd as they are by default... (and I thought the gpio command may have used them... but maybe not) - but hey... you're off and running now.

---

<div class="post-metadata">

**Author:** ![naamah75](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/naamah75/32/4060_2.png) [@naamah75](https://discourse.nodered.org/u/naamah75)\
**Post date:** [11 July 2019 15:02 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/25 "2019-07-11T15:02:13Z")

</div>

Now I'm running on a newly freshly Raspbian installation.  
I think is a good idea to forget the "old broke" system (due to unusual problem) and restart with a new good system. Isn't right?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 July 2019 15:39 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/26 "2019-07-11T15:39:21Z")

</div>

Well you may be able to

```
sudo apt-get install rpi.gpio

```

to get it back - but who knows if there is anything else missing... a clean install would be cleanest.

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 17:58 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/27 "2019-10-02T17:58:46Z")

</div>

Whatever this is, it's still broken. I've installed a fresh current Raspbian on a new RPi3B+ and installed Node-RED from the package repository. It has the Pi GPIO nodes, but input nodes say "stopped" on every pin I selected. There's no error message anywhere in the system log or debug console. What else can I try?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 October 2019 18:15 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/28 "2019-10-02T18:15:58Z")

</div>

Have you tried installing as per the docs?

You can do that over your existing install

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 18:20 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/29 "2019-10-02T18:20:07Z")

</div>

I've installed it like this:

```
sudo apt install nodered

```

It then installed a ton of packages. Whate else is there to installing Node-RED on a Pi? The rest of the system works as expected. I can use GPIO output, but not input. I've also verified on the command line that my input pin has the expected levels. It's just the input node that rejects to work.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 October 2019 18:32 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/30 "2019-10-02T18:32:34Z")

</div>

Well the recommended is documented on the “getting started” “raspberry pi” page in the docs on the website.

If your current install has issues what have you got to lose?

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 18:39 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/31 "2019-10-02T18:39:10Z")

</div>

What's wrong with using the package that's already there? The docs fail to explain this. Is the available package in Raspbian considered bad or broken for some reason? I mean, it comes with the OS for the Pi, so I guess it should be well adapted to it, which isn't always the case with the original source.

I guess the script gives me the new v1.0 with doesn't have Pi nodes included. I'll have to reinstall those then.

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [2 October 2019 19:07 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/32 "2019-10-02T19:07:08Z")

</div>

One of the reasons is that the version installed by the package manager is quite old, and that the corresponding NodeJS version that is installed is no longer supported by Node-RED. So if you try to upgrade it manually afterwards, you run into all kinds of different problems related to that. Installing through the install script gets rid of those issues, and adds repositories for the correct NodeJS packages so you can install updated versions without an issue.

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 19:19 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/33 "2019-10-02T19:19:46Z")

</div>

So I reinstalled node-red with that script. Now it's not working as before anymore. I had installed the node-red-contrib-i2c package and its nodes are now missing. I also cannot uninstall it without losing these nodes. And I cannot reinstall it because it's already installed. Also, the GPIO nodes are still there and there's no issue reported for them, but they're essentially dead.

Update: The GPIO nodes are probably dead because the whole flow won't start anymore due to the missing i2c nodes.

Oh, here's an error line from the log:

2 Oct 21:17:09 - [warn] [node-red-contrib-i2c/i2c] Error: libnode.so.64: cannot open shared object file: No such file or directory

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 19:51 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/34 "2019-10-02T19:51:03Z")

</div>

What is this libnode.so anyway? I couldn't find relevant information about it online. There are packages I could install but they'd remove node.js so that's not what I need. Does Node-RED 1.0 run on a Pi 3 B+ at all? Or should I rather use the prepackaged version that comes from the makers of the Pi?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 October 2019 19:54 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/35 "2019-10-02T19:54:14Z")

</div>

Run

```auto
node-red-stop
node-red-start

```

and copy/paste the output here.  
The i2c node error is not an error, it is a warning, so should not be serious. If it is serious that that is a bug in the node.  
No you should not use the version that comes with the Pi, you should use the version specially configured by the developers.

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 19:56 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/36 "2019-10-02T19:56:39Z")

</div>

```auto
2 Oct 21:55:53 - [info]
Welcome to Node-RED
===================
2 Oct 21:55:53 - [info] Node-RED version: v1.0.0
2 Oct 21:55:53 - [info] Node.js version: v10.16.3
2 Oct 21:55:53 - [info] Linux 4.19.75-v7+ arm LE
2 Oct 21:55:54 - [info] Loading palette nodes
2 Oct 21:55:57 - [info] Dashboard version 2.16.3 started at /ui
2 Oct 21:55:57 - [warn] ------------------------------------------------------
2 Oct 21:55:57 - [warn] [node-red-contrib-i2c/i2c] Error: libnode.so.64: cannot open shared object file: No such file or directory
2 Oct 21:55:57 - [warn] ------------------------------------------------------
2 Oct 21:55:57 - [info] Settings file : /home/pi/.node-red/settings.js
2 Oct 21:55:57 - [info] Context store : 'default' [module=memory]
2 Oct 21:55:57 - [info] User directory : /home/pi/.node-red
2 Oct 21:55:57 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Oct 21:55:57 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi3b.json
2 Oct 21:55:57 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Oct 21:55:57 - [info] Waiting for missing types to be registered:
2 Oct 21:55:57 - [info] - i2c out
2 Oct 21:55:57 - [info] - i2c in
2 Oct 21:55:58 - [info] Server now running at http://127.0.0.1:1880/

```

And the message I get in the UI:

> Flows stopped due to missing node types.
> 
> ```
> i2c out
> i2c in
> 
> ```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 October 2019 20:11 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/37 "2019-10-02T20:11:42Z")

</div>

Actually it is confused about whether it is a warning or an error isn't it, it first says Warn, then error.  
In the terminal go to the .node-red directory then  
`npm remove node-red-contrib-i2c`  
and assuming that says it has removed it then  
`npm install node-red-contrib-i2c`  
and post the result here, unless that fixes it.

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 20:17 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/38 "2019-10-02T20:17:40Z")

</div>

It didn't uninstall the package. And when I tried to install it, it did something more it didn't tell me about.

```auto
pi@raspberrypi3b:~/.node-red $ npm remove node-red-contrib-i2c
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/rmp-client" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-10-02T20_14_32_970Z-debug.log
pi@raspberrypi3b:~/.node-red $ npm install node-red-contrib-i2c
+ node-red-contrib-i2c@0.5.2
removed 5 packages, updated 1 package and audited 633 packages in 8.409s
found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

```

Now my other nodes that I have written myself (and that are working fine in every other Node-RED setup so far) are also missing, in addition to i2c. It's getting worse and worse. The prepackaged Node-RED didn't have these bugs.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 October 2019 20:23 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/39 "2019-10-02T20:23:16Z")

</div>

The main problem is that you've started off the wrong way and now your fighting the errors that this is causing.

We can carry on trying to sort out a bad situation but it's going to be much easier to start again

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 October 2019 20:26 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/40 "2019-10-02T20:26:27Z")

</div>

> [@ygoe](#):
>
> my other nodes that I have written myself (and that are working fine in every other Node-RED setup so far) are also missing,

How did you install those? npm will remove any nodes that are not referenced in package.json. That is nothing to do with node-red, but may be due to the fact that you are now using a current version of npm rather than an old one.

---

<div class="post-metadata">

**Author:** ![ygoe](https://avatars.discourse-cdn.com/v4/letter/y/a5b964/32.png) [@ygoe](https://discourse.nodered.org/u/ygoe)\
**Post date:** [2 October 2019 20:33 UTC](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184/41 "2019-10-02T20:33:22Z")

</div>

I copied in the module directory into ~/.node-red/node\_modules and added it to ~/.node-red/package.json as dependency. This worked before. My code isn't public so I cannot use any public registry. NPM is a bit stupid and can't use non-public code otherwise. That's why I had to do it manually. It's not like NuGet which works just fine with local packages.

[Previous page](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184.md?page=1)

[Next page](https://discourse.nodered.org/t/rpi-gpio-input-node-stopped/5184.md?page=3)
