# Problems in beaglebone black GPIO configration

**URL:** <https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523>\
**Category:** Hardware\
**Created:** [7 February 2021 02:24 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523 "2021-02-07T02:24:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [7 February 2021 02:24 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/1 "2021-02-07T02:24:21Z")

</div>

HI ,I have a beaglebone black board and I want to control P9\_15(GPIO48) outputing high or low levels by Johnny5 . I am a new user of beaglebone black board and Node-RED, there are some problems in configuring gpio out node of Johnny5. My current flow is simple as follows:

```auto
[{"id":"f5e61d75.93bc1","type":"tab","label":"Flow1","disabled":false,"info":""},{"id":"5aada02c.0fd5","type":"inject","z":"f5e61d75.93bc1","name":"ON","topic":"x","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":180,"wires":[["4a75b5cb.32488c"]]},{"id":"4a75b5cb.32488c","type":"gpio out","z":"f5e61d75.93bc1","name":"P9-15","state":"OUTPUT","pin":"48","i2cDelay":"0","i2cAddress":"","i2cRegister":"","outputs":0,"board":"cc553fd0.3e82a","x":510,"y":200,"wires":[]},{"id":"6551b710.a6e528","type":"inject","z":"f5e61d75.93bc1","name":"OFF","topic":"x","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":240,"wires":[["4a75b5cb.32488c"]]},{"id":"cc553fd0.3e82a","type":"ioplugin","z":"","name":"","username":"","password":"","boardType":"beaglebone-io","serialportName":"","connectionType":"local","mqttServer":"","pubTopic":"","subTopic":"","tcpHost":"","tcpPort":"","sparkId":"","sparkToken":"","beanId":"","impId":"","uuid":"","token":"","sendUuid":"","samplingInterval":"100"}]

```

I don’t sure how to configure gpio out node of Johnny5. When I edit gpio out node of Johnny5, there have some Properties need to be configured including Pin parameter. At first, I thought the Pin parameter should be filled with the 48 (number format). But after deployment, I clickd on the inject ON node and found an error message in the system as follows: msg : error."TypeError: Cannot read property 'index' of undefined".

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/daeedbbfafbf5b90be11cb51664c6fb338b13bc2.png)  
So, I changed the Pin parameter to P9\_15 and GPIO\_48 (symbol format). But after deployment, the following error message appeared when clicking on inject ON node: msg : error "Error: EACCES: permission denied, open '/sys/devices/platform/ocp/ocp:P9\_15\_pinmux/state'".  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a535b76edde5b8119106ab2a0514c9ec827e963f.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47f3edf2ee31aeefe7184a275503f5150dd00195.png)  
I think this problem should not be caused by inject ON node. it should be caused by a GPIO configuration error.but I don’t know how to correct. I hope someone can help me solve this problem, because if I can't control GPIO, then I can't control external devices. Here I express my gratitude in advance to those who can help me.

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [7 February 2021 14:54 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/2 "2021-02-07T14:54:43Z")

</div>

Hi @lpj669 ,

Two things to check, first let's make sure you have the latest pre-packaged version of bb-node-red-installer for the beagleboard. As back in September we update this package to utilze the 'gpio' group for i/o permission..

```auto
debian@bbb-pwr01-ser09:~$ dpkg --list | grep bb-node
ii bb-node-red-installer 1.2.9-0rcnee0~buster+20210205 armhf Node-RED installer for beagleboard.org

```

Finally, let's double check that u-boot isn't blocking anything:

```auto
sudo /opt/scripts/tools/version.sh

```

Regards,

---

<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:** [7 February 2021 22:27 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/3 "2021-02-07T22:27:32Z")

</div>

Hi

my user (debian) seem to be in groups  
`debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c cloud9ide xenomai weston-launch tisdk docker iio spi admin remoteproc eqep pwm gpio`

but I get an error I think we saw before

```
"Error: ENOENT: no such file or directory, open 
'/sys/devices/platform/ocp/ocp:P8_11_pinmux/state'"

```

and indeed none of the pins are mentioned in that directory  
the only ones there are

```auto
drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:cape-universal
drwxr-xr-x 6 root root 0 Jan 1 2000 ocp:l4_wkup@44c00000
drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:P9_19_pinmux
drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:P9_20_pinmux

```

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [7 February 2021 22:51 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/4 "2021-02-07T22:51:27Z")

</div>

Hi @dceejay , node-red does not run as a normal user, instead:

```auto
debian@bbb-pwr01-ser09:~$ cat /lib/systemd/system/nodered.service | grep 'User\|Group'
User=node-red
Group=node-red

```

```auto
debian@bbb-pwr01-ser09:~$ cat /etc/group | grep gpio
gpio:x:999:debian,node-red

```

> [@dceejay](#):
>
> ```auto
> "Error: ENOENT: no such file or directory, open 
> '/sys/devices/platform/ocp/ocp:P8_11_pinmux/state'"
> 
> ```
> 
> and indeed none of the pins are mentioned in that directory  
> the only ones there are
> 
> ```auto
> drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:cape-universal
> drwxr-xr-x 6 root root 0 Jan 1 2000 ocp:l4_wkup@44c00000
> drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:P9_19_pinmux
> drwxrwxr-x 3 root gpio 0 Feb 7 11:27 ocp:P9_20_pinmux
> 
> ```

cape universal isn't.enabled, please also run:

```auto
sudo /opt/scripts/tools/version.sh

```

Regards,

---

<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:** [8 February 2021 08:39 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/5 "2021-02-08T08:39:17Z")

</div>

> [@RobertCNelson](#):
>
> `sudo /opt/scripts/tools/version.sh`

```auto
sudo /opt/scripts/tools/version.sh
[sudo] password for debian: 
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLT0A5A1813BBBK5069]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.09-00002-g0f3f1c7907]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot.dts]
UBOOT: Loaded Overlay:[AM335X-20-00A0]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.94-ti-r42]
nodejs:[v10.23.1]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20201221.0-0~buster+20201221]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[46.706778] remoteproc remoteproc0: wkup_m3 is available
[46.891722] remoteproc remoteproc0: powering up wkup_m3
[46.891760] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[46.892058] remoteproc remoteproc0: remote processor wkup_m3 is now up
[51.663327] remoteproc remoteproc1: 4a334000.pru is available
[51.695711] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[51.663327] remoteproc remoteproc1: 4a334000.pru is available
[51.667193] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[51.695711] remoteproc remoteproc2: 4a338000.pru is available
[51.695871] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[0.852700] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[0.854363] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

```

---

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [9 February 2021 02:32 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/6 "2021-02-09T02:32:15Z")

</div>

Hi I have upgraded Node-RED and Node.js using the built-in upgrade tool:

```auto
sudo apt update
sudo apt upgrade nodejs bb-node-red-installer

```

I got some informations as follows:

```auto
root@beaglebone:/# dpkg --list | grep bb-node
ii bb-node-red-installer 1.2.9-0rcnee0~buster+20210205 armhf Node-RED installer for beagleboard.org

```

```auto
root@beaglebone:/# sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLT00C00719BBBK0F0C]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.94-ti-r42]
nodejs:[v10.23.1]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20201221.0-0~buster+20201221]
pkg:[bb-wl18xx-firmware]:[1.20200813.1-0~buster+20200813]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[66.543539] remoteproc remoteproc0: wkup_m3 is available
[66.636059] remoteproc remoteproc0: powering up wkup_m3
[66.636088] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[66.636342] remoteproc remoteproc0: remote processor wkup_m3 is now up
[69.375670] remoteproc remoteproc1: 4a334000.pru is available
[69.385572] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[69.375670] remoteproc remoteproc1: 4a334000.pru is available
[69.375833] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[69.385572] remoteproc remoteproc2: 4a338000.pru is available
[69.385755] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[0.949774] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[0.962987] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

```

the GPIO of beaglebone can be controled well and the LED can be on and off.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c116d8443b2aecb1be2202b3d63642f1a71c6106.png)  
but I found that the\*. node-red\* directory seems to have changed. It doesn't seem to be in the _root_ directory.isn't it?

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [10 February 2021 22:37 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/7 "2021-02-10T22:37:56Z")

</div>

> [@lpj669](#):
>
> but I found that the\*. node-red\* directory seems to have changed. It doesn't seem to be in the _root_ directory.isn't it?

So the base application and (application specific version of node) are under "/opt/node-red/" which get's overwritten on every install/upgrade.

The user home for node-red, is under /var/lib/node-red/ where your .config and .node-red directories are stored.

The node-red application runs as: user/group: node-red/node-red

Previously, node-red was installed under /usr/local/lib/node\_modules/, but i had to disconnect it from the default version of node in Debian. (we have other userspace node applications that haven't been updated for later node versions..)

Regards,

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [10 February 2021 22:55 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/8 "2021-02-10T22:55:13Z")

</div>

> [@dceejay](#):
>
> ```auto
> bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
> bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.09-00002-g0f3f1c7907]:[location: dd MBR]
> 
> ```

Having an old verison of u-boot in the eMMC makes this a fun thing to debug.. Get them both to v2019.04 and then you won't have to remember to hold down the 'user' boot to make sure the microSD boots..

Regards,

---

<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:** [10 February 2021 22:56 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/9 "2021-02-10T22:56:53Z")

</div>

Ah. How do I do that ? Thanks

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [10 February 2021 22:58 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/10 "2021-02-10T22:58:59Z")

</div>

Remove the microSD, all the eMMC ot bootup..

Then run:

```auto
debian@beaglebone:~$ cd /opt/scripts/tools/developers/
debian@beaglebone:/opt/scripts/tools/developers$ git pull
debian@beaglebone:/opt/scripts/tools/developers$ sudo ./update_bootloader.sh
debian@beaglebone:/opt/scripts/tools/developers$ sudo reboot

```

Next, stick microSD back in, let it boot up, then run:

```auto
debian@beaglebone:~$ cd /opt/scripts/tools/developers/
debian@beaglebone:/opt/scripts/tools/developers$ git pull
debian@beaglebone:/opt/scripts/tools/developers$ sudo ./update_bootloader.sh
debian@beaglebone:/opt/scripts/tools/developers$ sudo reboot

```

both will the be the latest..

Regards,

---

<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 February 2021 14:25 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/11 "2021-02-11T14:25:21Z")

</div>

Hi,

If I boot without sd card I just get 4 blue LED - and can't login. (I don't have a screen so can't see what's happening) . If I boot with sd card I can run script above.  
I then ran a full upgrade to get latest bb-nodered-installer and rebooted - and finally the pins all seem to have appeared. Phew. Thanks

---

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [12 February 2021 09:15 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/12 "2021-02-12T09:15:45Z")

</div>

Thank everyone very much for your help

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 April 2021 09:15 UTC](https://discourse.nodered.org/t/problems-in-beaglebone-black-gpio-configration/40523/13 "2021-04-13T09:15:59Z")

</div>

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