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
Comments
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. |
I will need to add in logic to check for BeagleBone Blue and PocketBeagle: TI AM335x BeagleBone Blue
TI AM335x PocketBeagle
|
I've created branch fix-issue-178 (5e2e785) |
No more BeagleBone Black regression for
|
@MarkAYoder could you test becbc95 on the BeagleBone Blue? @RobertCNelson what considerations should I have for the PocketBeagle? thanks! |
Hello. I'm totally stocked on this. With two little differences:
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 Then I met with the issue #165. It seems to be the newest!. I ran the solution proposed by some: RobertCNelson guy, which is:
Nothing. It didn't work. I'm stucked guys. Please help me. |
@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. |
Thanks pdp7. I'm sorry I got confused. Before doing so I'll check an idea. May be it solves the problem. |
for reference:
which map to entries in
NOTE: header pin modes are well defined in these PDFs: |
Test program
Environment
Execution
|
Success with pytest:
|
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 ```
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
Merged #183 @ramgu @MarkAYoder @RobertCNelson please try running test/issue178.py |
@ramgu
|
I am closing this issue as #183 has been merged. Please re-open if any problems. |
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
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. setupPin = open("/sys/class/gpio/gpio60/direction", "w") |
@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):
Then run strace, replace test.py with the name of your test program:
Paste the contents of strace.log into a GitHub Gist and post the link in a reply here. |
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. |
Hi, meanwhile I discovered that the problem disappears when I add the 'debian' user to the 'gpio' group and running python3 as sudo. |
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, |
Thanks Robert, this was not clear to me. Any idea's looking at the gist I've just posted? |
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
Step 2: install this kernel:
Step 3: Update overlays
Step 4: Reboot
Step 5: Verify:
Regards, |
If you get:
Rerun: Step 3: Update overlays
Step 4: Reboot
|
Hi thanks for your quick reply. I will test it tomorrow morning, first creating a new image of 9.1 LXQT. |
If your creating a new image anyways, might as well upgrade to the latest (9.3 lxqt) https://beagleboard.org/latest-images Regards, |
Sweet, that wasn't there a few weeks ago. Ok will do so, with the NH7 Cape? Oh sorry answer is already in your step 5.
2018-02-19 21:32 GMT+01:00 Robert Nelson <notifications@github.com>:
… If your creating a new image anyways, might as well upgrade to the latest
(9.3 lxqt)
https://beagleboard.org/latest-images
Regards,
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#178 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFvoSdew4INktM6UadncYMQt6Bd1G1D9ks5tWdpUgaJpZM4QDq6A>
.
--
met vriendelijke groeten,
Maurice van Hall
*OC*
Kruisstraat 80
5502 JH Veldhoven
M: 6 24 66 11 52
|
yeah do everything with the cape plugged in. |
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.
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. So not fully tested, but my initial test which failed before now works. |
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 it'll be the default when all capes are fully tested. Regards, |
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
orpython3 -version
): python 2.7.9Error 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()
**
The text was updated successfully, but these errors were encountered: