BBB Relay Cape Trouble

I’m running a BBB Wireless with the relay cape, and I am using NodeRed and GPIO to control the relays. For a while I’ve been having an issue where if the BBB is booted with the cape plugged in, when NodeRed tries to activate the relay we get the following error:
Error: ENOENT: no such file or directory, open '/sys/devices/platform/ocp/ocp:P9_27_pinmux/state
However, if I boot the BBB without the cape plugged in, plug in the cape after it is finished booting, and then attempt to control the relays work just fine. Have tried digging through various forums to no avail and I don’t know how to start troubleshooting or what to check. Any help is appreciated!

@riteshjbhatt with the board booted, please run this command and report it’s output:

sudo /opt/scripts/tools/version.sh

Regards

Here’s the output without the cape plugged in:

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTBWA51843BBWG0018]
model:[TI_AM335x_BeagleBone_Black_Wireless]
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-UIO-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BBBW-WL1835-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
kernel:[4.19.94-ti-r42]
nodejs:[v10.24.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210225.0-0~buster+20210225]
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.807242] remoteproc remoteproc0: wkup_m3 is available
[ 67.091683] remoteproc remoteproc0: powering up wkup_m3
[ 67.091714] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 67.092019] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
[ 17.849716] libpruio: loading out-of-tree module taints kernel.
dmesg | grep pinctrl-single
[ 0.958721] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.972335] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

And here with the cape plugged in:

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLTBWA51843BBWG0018]
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[l ocation: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-UIO-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
UBOOT: Loaded Overlay:[BB-BBBW-WL1835-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0]
UBOOT: Loaded Overlay:[BBORG_RELAY-00A2]
kernel:[4.19.94-ti-r42]
nodejs:[v10.24.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20210225.0-0~buster+20210225]
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 us ers 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/m mcblk1p1 ro rootfstype=ext4 rootwait uboot_detected_capes=BBORG_RELAY, coherent_ pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[ 67.950243] remoteproc remoteproc0: wkup_m3 is available
[ 68.031691] remoteproc remoteproc0: powering up wkup_m3
[ 68.031720] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 68.031971] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
[ 18.100037] libpruio: loading out-of-tree module taints kernel.
dmesg | grep pinctrl-single
[ 0.954337] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.967603] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

Looking through the only difference I noticed was the presence of this line when booted with the cape:

UBOOT: Loaded Overlay:[BBORG_RELAY-00A2]

Perhaps the cape’s overlay is creating a conflict?

Okay, your overlay loaded just fine, the issue, node-red is ‘trying’ to use config-pin to grab P9_27…

It doesn’t need to do that…

Just toggle led: relay-jp4

You should find it under /sys/class/led/…

Then under relay-jp4, change brightness from 0 → 255 to on/off…

Edit: Side “note” if you want to disable “auto-loading” of the default overlay, i did originally code in these options into /boot/uEnv.txt

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Override_external_capes

disable_uboot_overlay_addr0=1
disable_uboot_overlay_addr1=1
disable_uboot_overlay_addr2=1
disable_uboot_overlay_addr3=1

I don’t remember if they work or not, but connect a serial cable and see what slot the BBORG_RELAY cape uses when u-boot loads… (sorry this isn’t exported to linux user space…)

Regards,

I have found with node-red the easiest way is to simply use the File node, rather than special libraries. you should look at the options regarding appending (you don’t want to do that) and line termination.