adafruit / adafruit/adafruit-beaglebone-io-python

Cannot initialize GPIO.INPUT on BeagleBone Black Ubuntu 20.04

Open
#353 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
479
Forks
214
PR merge metrics
No merged PRs in 30d

Description

I'm running into issues when initializing a GPIO pin as input on a BeagleBone Black running Ubuntu 20.04 (https://forum.digikey.com/t/ubuntu-server-20-04/6649/25). Here is the python3 code

```
#! /usr/bin/env python3

import time
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
import Adafruit_BBIO.ADC as ADC
from Adafruit_I2C import Adafruit_I2C

def test_GPIO_output():
channel = "P8_10"
GPIO.setup(channel, GPIO.IN)
GPIO.cleanup()

if __name__ == '__main__':
test_GPIO_output()
```
When I run the script above I get the following error which looks similar to these issues in the past, although they seem to have a different configuration so I wasn't sure how to proceed. https://github.com/adafruit/adafruit-beaglebone-io-python/issues/165 and https://github.com/adafruit/adafruit-beaglebone-io-python/issues/248
```
Traceback (most recent call last):
File "test.py", line 15, in
test_GPIO_output()
File "test.py", line 11, in test_GPIO_output
GPIO.setup(channel, GPIO.IN)
ValueError: Set gpio mode failed, missing file or invalid permissions.

```

Here is the output of my system to ```sudo /opt/scripts/tools/version.sh ```

```
git:/opt/scripts/:[4d3a0aff57aae78a0db890f72ce505f61f1a93ce]
eeprom:[A335BNLTEIA02033SBB11671]
model:[TI_AM335x_BeagleBone_Black]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-dirty]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g31a8ae0206]:[location: dd MBR]
kernel:[5.4.0-26-generic]
/boot/uEnv.txt Settings:
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.14.20200430.0-0~focal+20200430]
WARNING:pkg:[bb-wl18xx-firmware]:[NOT_INSTALLED]
pkg:[kmod]:[27-1ubuntu2]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
groups:[ubuntu : ubuntu adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input netdev i2c bluetooth gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait]
dmesg | grep remote
[ 105.467106] remoteproc remoteproc0: wkup_m3 is available
dmesg | grep pru
dmesg | grep pinctrl-single
[ 2.826750] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing test.py on the stated BeagleBone Black and Ubuntu 20.04 setup, beginning at GPIO.setup(channel, GPIO.IN). Compare the failure with issues 165 and 248 and the system details from version.sh; done means identifying why input initialization fails or documenting the required compatible configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python, ubuntu
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.