GPIO.IN mode failed, missing file or invalid permissions

Hi, I’m having trouble getting GPIO input on the Beaglebone Black using the Adafruit_BBIO library.
Setting a pin to GPIO.OUT works fine:

debian@beaglebone:~/Desktop$ python -i
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import Adafruit_BBIO.GPIO as GPIO

GPIO.setup(“P8_7”, GPIO.OUT)
print(GPIO.input(“P8_7”))
0

GPIO.output(“P8_7”, GPIO.HIGH)
print(GPIO.input(“P8_7”))
1

exit()

When I try to set the pin to GPIO.IN, it gives the error
ValueError: Set gpio mode failed, missing file or invalid permissions.

debian@beaglebone:~/Desktop$ python -i
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import Adafruit_BBIO.GPIO as GPIO

GPIO.setup(“P8_7”, GPIO.IN)
Traceback (most recent call last):
File “”, line 1, in
ValueError: Set gpio mode failed, missing file or invalid permissions.

exit()

How do I read in GPIO input?

This is the output to sudo /opt/scripts/tools/version.sh

debian@beaglebone:~/Desktop$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[ea6ea9fca05f36f5044398884375b0231348d6e2]
eeprom:[A335BNLT00C02916BBBK1F31]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-28]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.01-00002-g9aa111a004]
kernel:[4.9.78-ti-r94]
nodejs:[v6.12.3]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BB-UART4-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20180126.0-0rcnee0~stretch+20180126]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee2~stretch+20180104]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
dmesg | grep pinctrl-single
[ 1.385802] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END

and dmesg | grep bone

debian@beaglebone:~/Desktop$ dmesg | grep bone
[ 0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.enable_partno=BB-UART1,BB-UART4 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet
[ 6.620318] systemd[1]: Set hostname to .

some additional information

debian@beaglebone:~/Desktop$ cat /etc/dogtag
BeagleBoard.org Debian Image 2018-01-28

debian@beaglebone:~/Desktop$ cat /boot/uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.9.78-ti-r94
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1

please open a GitHub issue and I will try to reproduce this issue:

https://github.com/adafruit/adafruit-beaglebone-io-python/

thanks,
drew

https://github.com/adafruit/adafruit-beaglebone-io-python/issues/264

Thanks, I’ll take a look.