Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO regression due to BeagleBone Blue LED support #178

Closed
ramgu opened this issue Oct 24, 2017 · 28 comments
Closed

GPIO regression due to BeagleBone Blue LED support #178

ramgu opened this issue Oct 24, 2017 · 28 comments
Assignees
Labels

Comments

@ramgu
Copy link

ramgu commented Oct 24, 2017

  • Platform/operating system (i.e. Raspberry Pi with Raspbian operating system,
    Windows 32-bit, Windows 64-bit, Mac OSX 64-bit, etc.): Beaglebone Black/Debian 8.9

  • Python version (run python -version or python3 -version): python 2.7.9

  • Error message you are receiving, including any Python exception traces: Traceback (most recent call last):
    File "kk.py", line 3, in
    GPIO.setup("P8_7", GPIO.OUT)
    ValueError: Set gpio value failed, missing file or invalid permissions.
    *
    syslog message:
    "beaglebone python[2434]: gpio_set_value: 66 couldn't open '/sys/class/leds/red/brightness': 2-No such file or directory
    "

  • List the steps to reproduce the problem below (if possible attach code or commands
    to run): **run following python snippet:

    1 import Adafruit_BBIO.GPIO as GPIO
    2
    3 GPIO.setup("P8_7", GPIO.OUT)
    4 GPIO.cleanup()
    **

@pdp7 pdp7 self-assigned this Oct 24, 2017
@pdp7 pdp7 added the bug label Oct 24, 2017
@pdp7
Copy link
Collaborator

pdp7 commented Oct 24, 2017

Thanks for opening. This is a regression from the BeagleBone Blue support and I need to fix the logic. The solution will be to identify which board Adafruit_BBIO is running on and then handle the pins appropriately.

@pdp7
Copy link
Collaborator

pdp7 commented Oct 24, 2017

I will need to add in logic to check for BeagleBone Blue and PocketBeagle:

TI AM335x BeagleBone Blue

grep -c 'TI AM335x BeagleBone Blue' /proc/device-tree/model (edited)

TI AM335x PocketBeagle

grep -c 'TI AM335x PocketBeagle' /proc/device-tree/model

@pdp7
Copy link
Collaborator

pdp7 commented Oct 28, 2017

I've created branch fix-issue-178 (5e2e785)

@pdp7
Copy link
Collaborator

pdp7 commented Oct 28, 2017

No more BeagleBone Black regression for P8_7 with commit becbc95 in branch fix-issue-178:

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ cat ~/issue178.py
import Adafruit_BBIO.GPIO as GPIO

GPIO.setup("P8_7", GPIO.OUT)
GPIO.cleanup()

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ sudo python ~/issue178.py
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio66/value

@pdp7
Copy link
Collaborator

pdp7 commented Oct 28, 2017

@MarkAYoder could you test becbc95 on the BeagleBone Blue?

@RobertCNelson what considerations should I have for the PocketBeagle?

thanks!

@Xperlack
Copy link

Xperlack commented Oct 30, 2017

Hello.

I'm totally stocked on this. With two little differences:

  • I get the error when trying to set a pin as input (e.g. GPIO.setup("P9_12",GPIO.IN)) and

  • it does work event if it's done as root.

I already read:

So I've jumped into almost every file commented on this posts to figure out how the proposed solutions will match my problem. Just because I'm catious. But I didn't find the exact line to put this so referred delay (issue 36).

So then I checked the *.patch option. Before patching, I just took a look on the code and what it does to 'py_gpio.c'. Then compare it with the actual code into 'py_gpio.c' file on my beaglebone. Surprise!!! - the code seems to be already handling the returns from export, setting directions and whatever. Then, I'm not sure the patch will solve something. So I DID NOT PATCH. Besides, I didn't like the huge counters polling the state of the /Sys directories.

Then I thought: ¬¬ man you just installed the OS and python libraries. This issues may be already solved on the last versions. So I came here and found out that yes, it was solved. Though is not working.

So to be sure what I installed the last updates I consulted again the tutorial https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/installation-on-ubuntu and made sure that the manual installation clones the files from this very exact repository. Although I did the 'apt-get' package manager installation.

On some point in the process I made the gpio setting directly on the /sys/class/gpio directories. Using echo, export, and all that sort of things. It worked fine, everything: output, input. Just wonderful. But of course I feel more like using the BBIO library facilities.

Then I met with the issue #165. It seems to be the newest!. I ran the solution proposed by some: RobertCNelson guy, which is:

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Nothing. It didn't work.

I'm stucked guys. Please help me.

@pdp7
Copy link
Collaborator

pdp7 commented Oct 30, 2017

@Xperlack please open up a new issue regarding the problem you are experiencing. this issue is about regression effecting certain GPIO pins due to support added for non-standard LEDs on the BeagleBone Blue.

@pdp7 pdp7 changed the title version 1.0.4 and 1.0.5 are not fully compatible with Beaglebone Black GPIO regression due to BeagleBone Blue LED support Oct 30, 2017
@Xperlack
Copy link

Thanks pdp7. I'm sorry I got confused.

Before doing so I'll check an idea. May be it solves the problem.

@pdp7
Copy link
Collaborator

pdp7 commented Oct 31, 2017

for reference:
These are all the LEDs defined in source/event_gpio.h:

#define USR_LED_GPIO_MIN 53
#define USR_LED_GPIO_MAX 56
#define USR_LED_RED      66
#define USR_LED_GREEN    67
#define BAT25   27
#define BAT50   11
#define BAT75   61
#define BAT100  10000       // Placeholder until I find the real number
#define WIFI    10001       // Ditto

which map to entries in pins_t table[] in source/common.c

  • 66

    • BeagleBone (not Blue): { "TIMER4", "P8_7", 66, -1, -1},
    • BeagleBone Blue: { "RED_LED", "RED", 66, -1, -1}, // LEDs
  • 67

    • BeagleBone (not Blue): { "TIMER7", "P8_8", 67, -1, -1},
    • BeagleBone Blue: { "GREEN_LED", "GREEN", 67, -1, -1},
  • 27

    • BeagleBone (not Blue): { "GPIO0_27", "P8_17", 27, -1, -1},
    • BeagleBone Blue: { "BAT25", "BAT25", 27, -1, -1},
    • PocketBeagle: { "GPIO0_27", "P2_19", 27, -1, -1},
  • 11

    • BeagleBone (not Blue): { "UART5_RTSN", "P8_32", 11, -1, -1},
    • BeagleBone Blue: { "BAT50", "BAT50", 11, -1, -1},
  • 61

    • BeagleBone (not Blue): { "GPIO1_29", "P8_26", 61, -1, -1},
    • BeagleBone Blue: { "BAT75", "BAT75", 61, -1, -1},

NOTE: header pin modes are well defined in these PDFs:

@pdp7
Copy link
Collaborator

pdp7 commented Oct 31, 2017

Test program

import Adafruit_BBIO.GPIO as GPIO

test_pins = [ "P8_7", "P8_8", "P8_17", "P8_32", "P8_26" ]

for pin in test_pins:
  print("========================")
  print("test GPIO.setup(): {0}".format(pin))
  GPIO.setup(pin, GPIO.OUT)
  print("test GPIO.output(): {0}".format(pin))
  GPIO.output(pin, GPIO.HIGH)
  value = GPIO.input(pin);
  print("test GPIO.input(): {0}={1}".format(pin, value));

GPIO.cleanup()

Environment

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ cat /etc/dogtag 
BeagleBoard.org Debian Image 2017-10-17
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ cat /etc/debian_version 
9.2
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ uname -a
Linux beaglebone 4.9.57-ti-r71 #1 SMP PREEMPT Thu Oct 19 18:17:06 UTC 2017 armv7l GNU/Linux

Execution

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ sudo python ~/issue178.py 
========================
test GPIO.setup(): P8_7
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio66/value
test GPIO.output(): P8_7
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio66/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio66/value
test GPIO.input(): P8_7=1
========================
test GPIO.setup(): P8_8
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio67/value
test GPIO.output(): P8_8
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio67/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio67/value
test GPIO.input(): P8_8=1
========================
test GPIO.setup(): P8_17
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio27/value
test GPIO.output(): P8_17
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio27/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio27/value
test GPIO.input(): P8_17=1
========================
test GPIO.setup(): P8_32
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio11/value
test GPIO.output(): P8_32
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio11/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio11/value
test GPIO.input(): P8_32=1
========================
test GPIO.setup(): P8_26
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio61/value
test GPIO.output(): P8_26
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio61/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio61/value
test GPIO.input(): P8_26=1

@pdp7
Copy link
Collaborator

pdp7 commented Oct 31, 2017

Success with pytest:

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python/test$ sudo python -mpytest 
================================================ test session starts =================================================
platform linux2 -- Python 2.7.13, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/debian/ssh/adafruit-beaglebone-io-python, inifile:
collected 58 items                                                                                                    

test_adc.py ......
test_gpio_input.py ..
test_gpio_output.py ......
test_gpio_setup.py ..........
test_led.py ..
test_pwm_setup.py ...........................
test_spi.py ..
test_uart.py ...

============================================= 58 passed in 14.40 seconds =============================================

pdp7 added a commit that referenced this issue Oct 31, 2017
These are all the LEDs defined in [source/event_gpio.h](https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/event_gpio.h) which map to entries in `pins_t table[]` in [source/common.c](https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L72)

* 66
  * BeagleBone (not Blue): `{ "TIMER4", "P8_7", 66, -1, -1},`
  * BeagleBone Blue: `{ "RED_LED", "RED", 66, -1, -1}, // LEDs`

* 67
  * BeagleBone (not Blue):  `{ "TIMER7", "P8_8", 67, -1, -1},`
  * BeagleBone Blue:  `{ "GREEN_LED", "GREEN", 67, -1, -1},`

* 27
  * BeagleBone (not Blue): `{ "GPIO0_27", "P8_17", 27, -1, -1},`
  * BeagleBone Blue: `{ "BAT25", "BAT25", 27, -1, -1},`
  * PocketBeagle: `{ "GPIO0_27", "P2_19", 27, -1, -1},`

* 11
  * BeagleBone (not Blue): `{ "UART5_RTSN", "P8_32", 11, -1, -1},`
  * BeagleBone Blue: `{ "BAT50", "BAT50", 11, -1, -1},`

* 61
  * BeagleBone (not Blue): ` { "GPIO1_29", "P8_26", 61, -1, -1},`
  * BeagleBone Blue: ` { "BAT75", "BAT75", 61, -1, -1},`

NOTE: header pin modes are well defined in these PDFs:
* [BBBP8Header.pdf](http://exploringbeaglebone.com/wp-content/uploads/2014/10/BBBP8Header.pdf)
* [BBBP9Header.pdf](http://exploringbeaglebone.com/wp-content/uploads/2014/10/BBBP9Header.pdf)

```
import Adafruit_BBIO.GPIO as GPIO

test_pins = [ "P8_7", "P8_8", "P8_17", "P8_32", "P8_26" ]

for pin in test_pins:
  print("========================")
  print("test GPIO.setup(): {0}".format(pin))
  GPIO.setup(pin, GPIO.OUT)
  print("test GPIO.output(): {0}".format(pin))
  GPIO.output(pin, GPIO.HIGH)
  value = GPIO.input(pin);
  print("test GPIO.input(): {0}={1}".format(pin, value));

GPIO.cleanup()
```

```
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ cat /etc/dogtag
BeagleBoard.org Debian Image 2017-10-17
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ cat /etc/debian_version
9.2
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ uname -a
Linux beaglebone 4.9.57-ti-r71 #1 SMP PREEMPT Thu Oct 19 18:17:06 UTC 2017 armv7l GNU/Linux
```

```
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ sudo python ~/issue178.py
========================
test GPIO.setup(): P8_7
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio66/value
test GPIO.output(): P8_7
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio66/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio66/value
test GPIO.input(): P8_7=1
========================
test GPIO.setup(): P8_8
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio67/value
test GPIO.output(): P8_8
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio67/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio67/value
test GPIO.input(): P8_8=1
========================
test GPIO.setup(): P8_17
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio27/value
test GPIO.output(): P8_17
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio27/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio27/value
test GPIO.input(): P8_17=1
========================
test GPIO.setup(): P8_32
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio11/value
test GPIO.output(): P8_32
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio11/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio11/value
test GPIO.input(): P8_32=1
========================
test GPIO.setup(): P8_26
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio61/value
test GPIO.output(): P8_26
gpio_set_value: uboot_overlay_enabled() is true
gpio_set_value: pocketbeagle() is FASLE
gpio_set_value: beaglebone_blue() is FALSE
gpio_set_value: default gpio path
gpio_set_value: filename=/sys/class/gpio/gpio61/value
gpio open_value_file: default gpio path
gpio open_value_file: filename=/sys/class/gpio/gpio61/value
test GPIO.input(): P8_26=1
```
pdp7 added a commit that referenced this issue Oct 31, 2017
pdp7 added a commit that referenced this issue Oct 31, 2017
RESULTS:

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python/test$ sudo python -m pytest
=================================================== test session starts ====================================================
platform linux2 -- Python 2.7.13, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/debian/ssh/adafruit-beaglebone-io-python, inifile:
collected 58 items

test_adc.py ......
test_gpio_input.py ..
test_gpio_output.py ......
test_gpio_setup.py ..........
test_led.py ..
test_pwm_setup.py ...........................
test_spi.py ..
test_uart.py ...

================================================ 58 passed in 13.31 seconds ================================================

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python/test$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[6c2688b0be448b7bb9ca18849b430d496a84acb4]
eeprom:[A335BNLT000C3014BBBK1316]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2017-10-17]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2017.09-00002-g0f3f1c7907]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.09-rc2-00002-g84a7f2]
kernel:[4.9.57-ti-r71]
nodejs:[v6.11.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg:[bb-cape-overlays]:[4.4.20171013.2-0rcnee1~stretch+20171013]
pkg:[bb-wl18xx-firmware]:[1.20170829-0rcnee1~stretch+20170829]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee0~stretch+20170830]
debian@beaglebone:~/ssh/adafruit-beaglebone-io-python/test$

debian@beaglebone:~/ssh/adafruit-beaglebone-io-python$ sudo python ./test/issue178.py
========================
test GPIO.setup(): USR0
test GPIO.output(): USR0
test GPIO.input(): USR0=1
========================
test GPIO.setup(): USR1
test GPIO.output(): USR1
test GPIO.input(): USR1=1
========================
test GPIO.setup(): USR2
test GPIO.output(): USR2
test GPIO.input(): USR2=1
========================
test GPIO.setup(): USR3
test GPIO.output(): USR3
test GPIO.input(): USR3=1
========================
test GPIO.setup(): RED_LED
test GPIO.output(): RED_LED
test GPIO.input(): RED_LED=1
========================
test GPIO.setup(): GREEN_LED
test GPIO.output(): GREEN_LED
test GPIO.input(): GREEN_LED=1
========================
test GPIO.setup(): BAT25
test GPIO.output(): BAT25
test GPIO.input(): BAT25=1
========================
test GPIO.setup(): BAT50
test GPIO.output(): BAT50
test GPIO.input(): BAT50=1
========================
test GPIO.setup(): BAT75
test GPIO.output(): BAT75
test GPIO.input(): BAT75=1
========================
test GPIO.setup(): P8_7
test GPIO.output(): P8_7
test GPIO.input(): P8_7=1
========================
test GPIO.setup(): P8_8
test GPIO.output(): P8_8
test GPIO.input(): P8_8=1
========================
test GPIO.setup(): P8_17
test GPIO.output(): P8_17
test GPIO.input(): P8_17=1
========================
test GPIO.setup(): P8_32
test GPIO.output(): P8_32
test GPIO.input(): P8_32=1
========================
test GPIO.setup(): P8_26
test GPIO.output(): P8_26
test GPIO.input(): P8_26=1

journalctl -p debug -t python --since "1 min ago"

-- Logs begin at Tue 2017-10-24 20:55:42 UTC, end at Tue 2017-10-31 04:02:47 UTC. --
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: version <unknown> initialized
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 53 couldn't write "/sys/class/gpio/export": 16-Device or resource busy
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 53 not applicable to built-in LEDs
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr0/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 53 0 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr0/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 53 1 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/leds/beaglebone:green:usr0/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 53 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 54 couldn't write "/sys/class/gpio/export": 16-Device or resource busy
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 54 not applicable to built-in LEDs
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr1/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 54 0 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr1/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 54 1 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/leds/beaglebone:green:usr1/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 54 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 55 couldn't write "/sys/class/gpio/export": 16-Device or resource busy
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 55 not applicable to built-in LEDs
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr2/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 55 0 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr2/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 55 1 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/leds/beaglebone:green:usr2/brightness
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 55 OK
Oct 31 04:02:43 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 56 couldn't write "/sys/class/gpio/export": 16-Device or resource busy
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 56 not applicable to built-in LEDs
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr3/brightness
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 56 0 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: USR LED path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/leds/beaglebone:green:usr3/brightness
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 56 1 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/leds/beaglebone:green:usr3/brightness
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 56 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 66 already exported
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 66 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio66/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 66 0 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio66/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 66 1 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/gpio/gpio66/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 66 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 67 already exported
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 67 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio67/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 67 0 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio67/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 67 1 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/gpio/gpio67/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 67 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 27 already exported
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 27 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio27/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 27 0 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio27/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 27 1 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: default gpio path
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/gpio/gpio27/value
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 27 OK
Oct 31 04:02:44 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 11 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 11 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio11/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 11 0 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio11/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 11 1 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/gpio/gpio11/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 11 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 61 already exported
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 61 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio61/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 61 0 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio61/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 61 1 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio open_value_file: filename=/sys/class/gpio/gpio61/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 61 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 66 already exported
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 66 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio66/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 66 0 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio66/value
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 66 1 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 66 OK
Oct 31 04:02:45 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 67 already exported
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 67 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio67/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 67 0 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio67/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 67 1 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 67 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 27 already exported
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 27 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio27/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 27 0 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio27/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 27 1 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 27 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 11 already exported
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 11 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio11/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 11 0 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio11/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 11 1 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 11 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_export: 61 already exported
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_direction: 61 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio61/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 61 0 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: default gpio path
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: filename=/sys/class/gpio/gpio61/value
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_set_value: 61 1 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_get_value: 61 OK
Oct 31 04:02:46 beaglebone python[14351]: Adafruit_BBIO: gpio_unexport: 11 OK
@pdp7
Copy link
Collaborator

pdp7 commented Oct 31, 2017

Merged #183

@ramgu @MarkAYoder @RobertCNelson please try running test/issue178.py

@pdp7
Copy link
Collaborator

pdp7 commented Oct 31, 2017

@ramgu P8_7 is now working OK on BeagleBone Black:

debian@beaglebone:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> GPIO.setup("P8_7", GPIO.OUT)
>>> GPIO.cleanup()
>>> 
debian@beaglebone:~$ cat /proc/device-tree/model 
TI AM335x BeagleBone Black

@pdp7
Copy link
Collaborator

pdp7 commented Nov 1, 2017

I am closing this issue as #183 has been merged. Please re-open if any problems.

@pdp7 pdp7 closed this as completed Nov 1, 2017
pdp7 added a commit that referenced this issue Nov 3, 2017
shortlog of release 1.0.6:

Drew Fustini (39):
      Add -Wno-unit_address_vs_reg to avoid dtc warning
      check if board is BeagleBone Blue or PocketBeagle
      check if BeagleBone Blue before accessing non-standard LEDs
      Add test for GPIO regression #178
      change syslog mask level to DEBUG
      add "Adafruit_BBIO" to syslog()
      update test for issue #178
      remove polarity "hack" for PWM #170
      move pwm_set_polarity() after period is set
      add test for issue #170
      only check kernel overlays if u-boot overlays are not being used
      Attempt to use udev ecap path for pwm path
      add test script for all BeagleBone PWM outputs
      update PWM test for 4.14 kernel udev paths
      minor change to pwm debug logging
      sleep to avoid udev race condition #185

Mark A. Yoder (1):
      Added BAT25, BAT50, BAT75, BAT100 and WIFI LEDs

Peter Lawler (1):
      Missing CR/LF

Robert Nelson (10):
      source/common.c: add initial PocketBeagle values
      source/common.c: PocketBeagle, no slots file, everything built-in
      source/common.c: PocketBeagle, no slots file disable here too
      source/c_pwm.c: HACK: U-Boot pre-setup everything, dont search for specific overlay
      source/c_pwm.c: HACK: PocketBeagle: v4.14.x
      source/c_pwm.c: debug pwm_path/pwm_path_udev
      source/c_pwm.c: pwm: add support for pwmchipX/pwm-X:Y syntax
      source/c_pwm.c: disable pwm_set_polarity (broken in v4.9.x/v4.14.x)
      source/common.c: Blue Fix GP0_3 id
      source/common.c: PocketBeagle Fix P2.24
@mvhall
Copy link

mvhall commented Feb 8, 2018

Has this issue now been marked as solved? I have a 9.1 LXQT version and tried the script to set outputs and inputs. Outputs work, but inputs not.
Also directly exporting the gpio's with the code below gives me an error
OSError: [Errno 16] Device or resource busy
Actually the gpio pin is visible in /sys/class/gpio but with user root and group root. I guess this is the problem causing the file.close() method to give a busy error.
Am I the only one with this problem? Any solution?
----- python code snippet (ran as sudo)----
setupPin = open("/sys/class/gpio/export", "w")
setupPin.write("%d" % (60)) #P9_12
setupPin.close() . <<<< error shows here

setupPin = open("/sys/class/gpio/gpio60/direction", "w")
setupPin.write("in")
setupPin.close()

@pdp7
Copy link
Collaborator

pdp7 commented Feb 8, 2018

@mvhall It would be helpful if you could run strace so that I can better understand what is happening.

Install strace (if it doesn't already exist):

sudo apt-get install strace

Then run strace, replace test.py with the name of your test program:

strace -f -o strace.log python test.py

Paste the contents of strace.log into a GitHub Gist and post the link in a reply here.

@mvhall
Copy link

mvhall commented Feb 9, 2018

Will do so after my holliday. What I forgot to say is that the NHD7 (7" LCD from Newhaven) causes this, without the screen connected it works normal.
The cape overlay seems to be the problem, but not 100% sure.

@mvhall
Copy link

mvhall commented Feb 19, 2018

Hi, meanwhile I discovered that the problem disappears when I add the 'debian' user to the 'gpio' group and running python3 as sudo.
I would still appreciate an explanation of why a non-root user needs to be added to the gpio group, and if this is as designed why it is nowhere described. It is so frustrating as the error I got totally sent me into the wrong direction.
All and all it does not explain why the adafruit_BBIO library does not work, not even when 'debian' is added to the 'gpio' group. Is it the new Cape-loading module that causes this?
My uEnv.txt, DMESG and version info is in the gist below.

<script src="https://gist.github.com/mvhall/0d53e9e018e7a255005b925ba1287e1c.js"></script>

@RobertCNelson
Copy link
Contributor

The gpio subsystem has always required privileged access. It's just recently (in the last year) we've gone thru each subsystem to make sure you don't have to be "root" to access them.. for the gpio, we have a gpio user that udev ties it to on bootup..

Regards,

@mvhall
Copy link

mvhall commented Feb 19, 2018

Thanks Robert, this was not clear to me.
But what is the explanation that the adafruit library works on 9.1 LXQT without the 7" NHD LCD Cape, but not when connected?

Any idea's looking at the gist I've just posted?

@RobertCNelson
Copy link
Contributor

RobertCNelson commented Feb 19, 2018

@mvhall

That combination doesn't work, as 1, i can find my NHD at my desk, and 2 i've been working in it for the last week or so.

If you want to test something:

Step 1, install this version of u-boot

sudo /opt/scripts/tools/developers/update_bootloader.sh --beta

Step 2: install this kernel:

sudo /opt/scripts/tools/update_kernel.sh --bone-channel --exp

Step 3: Update overlays

cd /opt/source/bb.org-overlays/
git pull
make
sudo make install

Step 4: Reboot

sudo reboot

Step 5: Verify:

sudo /opt/scripts/tools/version.sh | grep bootloader
lcd: works []?
ls /sys/devices/platform/ocp/ | grep pinmux []?

Regards,

@RobertCNelson
Copy link
Contributor

RobertCNelson commented Feb 19, 2018

If you get:

debian@beaglebone:~$ dmesg | grep pin
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.217939] pinctrl core: initialized pinctrl subsystem
[    0.491998] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    0.903922] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    1.216144] pinctrl-single 44e10800.pinmux: pin PIN15 already requested by panel; cannot claim for ocp:P8_15_pinmux
[    1.226715] pinctrl-single 44e10800.pinmux: pin-15 (ocp:P8_15_pinmux) status -22
[    1.234156] pinctrl-single 44e10800.pinmux: could not request pin 15 (PIN15) from group pinmux_P8_15_default_pin  on device pinctrl-single
[    1.246653] bone-pinmux-helper ocp:P8_15_pinmux: Error applying setting, reverse things back
[    1.255169] bone-pinmux-helper: probe of ocp:P8_15_pinmux failed with error -22

Rerun:

Step 3: Update overlays

cd /opt/source/bb.org-overlays/
git pull
make
sudo make install

Step 4: Reboot

sudo reboot

beagleboard/bb.org-overlays@a9b20ef

@mvhall
Copy link

mvhall commented Feb 19, 2018

Hi thanks for your quick reply. I will test it tomorrow morning, first creating a new image of 9.1 LXQT.
Then I test it with NH7 LCD I guess?

@RobertCNelson
Copy link
Contributor

If your creating a new image anyways, might as well upgrade to the latest (9.3 lxqt)

https://beagleboard.org/latest-images

Regards,

@mvhall
Copy link

mvhall commented Feb 19, 2018 via email

@RobertCNelson
Copy link
Contributor

yeah do everything with the cape plugged in.

@mvhall
Copy link

mvhall commented Feb 20, 2018

Hi Robert,

I followed your steps with image 9.3LXQT. Needed to remove the LCD as it kept rebooting. After I installed the Bootloader and Overlays (via SSH login), I did a shutdown, installed the LCD Cape (NH7C) and booted.
The GPIOxx ports in /sys/class/gpio were exported.
Manually these (well I tested P9_12) can be set. Config-pin worked as well.
In python3 doing the following worked (got an error before). Note as you explained before, you need to use sudo python3.

import sys
f=open("/sys/class/gpio/export","w")
f.write("%d" % (60))
f.close()

Installed Adafruit_BBIO , and the GPIO.setup("P9_12", GPIO.IN) and GPIO.setup("P9_12", GPIO.OUT) worked, which I checked in /sys/class/gpio/gpio60 by using $cat direction.
No need to add user debian to the gpio group.

So not fully tested, but my initial test which failed before now works.
Oh not to forget: the LCD is working as well :-)
How does updating the information at Adafruit works? Can someone write a clear "test-case/instructions" for fellow developers? I will mail the folks at NewHaven myself to tell them the problem seems to be solved with your instructions above.
Any gist needed here in this thread? Happy to provide the info, got it all documented.
Thank you very much.

@RobertCNelson
Copy link
Contributor

Actually, 9.3LXQT has debian in the gpio group, that's why that worked. ;)

This is really just a new feature, something that's been on the list for awhile. Something we figured out on the PocketBeagle capes. Now it's just a matter of converting all to the "universal rewrite":

https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm
https://github.com/beagleboard/bb.org-overlays/commits/master

it'll be the default when all capes are fully tested.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants