# Osmc gpio problem

**URL:** <https://discourse.nodered.org/t/osmc-gpio-problem/8113>\
**Category:** General\
**Created:** [18 February 2019 18:10 UTC](https://discourse.nodered.org/t/osmc-gpio-problem/8113 "2019-02-18T18:10:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [18 February 2019 18:10 UTC](https://discourse.nodered.org/t/osmc-gpio-problem/8113/1 "2019-02-18T18:10:21Z")

</div>

Hi, I have been using node-red on a pi with osmc installed for quit a while without problem, however I now want to use the gpio nodes in a flow, I know node-red is not designed specifically to run on osmc but all my other flows work fine.

When I try to use a gpio node says Stopped and if I initiate the node it says not running I get [error] [rpi-gpio out:7ed8bdf2.dd8014] nrpgio python command not running in the console.

I can successfully run a python script from the commend line with sudo ./test.py it contains the following code

#!/usr/bin/env python  
import RPi.GPIO as GPIO  
import time

GPIO.setmode(GPIO.BCM)  
GPIO.setwarnings(False)  
GPIO.setup(24, GPIO.OUT)  
GPIO.output(24, GPIO.HIGH)  
time.sleep(1)  
GPIO.output(24,GPIO.LOW)

For info .

# Welcome to Node-RED

18 Feb 17:53:24 - [info] Node-RED version: v0.19.5  
18 Feb 17:53:24 - [info] Node.js version: v10.15.1  
18 Feb 17:53:24 - [info] Linux 4.14.78-4-osmc arm LE  
18 Feb 17:53:25 - [info] Loading palette nodes  
18 Feb 17:53:30 - [info] Settings file : /home/osmc/.node-red/settings.js  
18 Feb 17:53:30 - [info] Context store : 'default' [module=memory]  
18 Feb 17:53:30 - [info] User directory : /home/osmc/.node-red  
18 Feb 17:53:30 - [warn] Projects disabled : editorTheme.projects.enabled=false  
18 Feb 17:53:30 - [info] Flows file : /home/osmc/.node-red/flows\_osmc.json

osmc@osmc:~$ groups (returns)  
osmc adm disk lp dialout cdrom audio video gpio i2c

osmc@osmc:~$ python --version (returns)  
Python 2.7.13

I have added the following but they do not help.  
sudo adduser $USER gpio  
and NodeREDusername ALL=(ALL) NOPASSWD: /usr/bin/python to visudo

Anyone any ideas what I could try to get this working ?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [19 February 2019 11:07 UTC](https://discourse.nodered.org/t/osmc-gpio-problem/8113/2 "2019-02-19T11:07:01Z")

</div>

**Solved ,**

_ **OSMC GPIO ACCESS for anyone following here are the steps.** _

```auto
sudo su
apt-get update
apt-get install build-essential
export ARCH=arm
export CROSS_COMPILE=/usr/bin/
apt-get install python-pip python-dev gcc
apt-get install python-setuptools
pip install wheel
pip install rpi.gpio

```

_See Successfully installed rpi.gpio-0.6.5_

_Create file and paste in the following code_

```
nano /etc/udev/rules.d/50-gpio.rules

```

```auto
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"

SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660"

SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\

chown -R root:gpio /sys/class/gpio &amp;&amp; chmod -R 770 /sys/class/gpio;\

chown -R root:gpio /sys/devices/virtual/gpio &amp;&amp; chmod -R 770 /sys/devic$

chown -R root:gpio /sys$devpath &amp;&amp; chmod -R 770 /sys$devpath\'"

```

_Save and exit_

_Enter following cmds_

```auto
groupadd gpio

adduser “$USER” gpio

```

_To revert back from sudo su_

```
exit

```

_reboot_

**_Now attempting to get i2c working._**
