You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the LED blink code for a USR led on the PocketBeagle with the latest image (bone-debian-9.5-iot-armhf-2018-08-30-4gb.img.xz), the LED is left in a bad state upon exit (i.e. LED looks partially lit). At that point, you are unable to use that LED until you perform a hard reboot of the PocketBeagle. Here is the information to recreate the issue on the PocketBeagle:
debian@beaglebone:/var/lib/cloud9/file_io$ uname -a
Linux beaglebone 4.14.67-ti-r73 #1 SMP PREEMPT Thu Aug 30 00:08:52 UTC 2018 armv7l GNU/Linux
debian@beaglebone:/var/lib/cloud9/file_io$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import Adafruit_BBIO.GPIO as GPIO
GPIO.file
'/usr/local/lib/python2.7/dist-packages/Adafruit_BBIO-1.0.10-py2.7-linux-armv7l.egg/Adafruit_BBIO/GPIO.so'
exit()
debian@beaglebone:/var/lib/cloud9/file_io$ cat bbio_led.py
import Adafruit_BBIO.GPIO as GPIO
import time
LED = "USR3"
GPIO.setup(LED, GPIO.OUT)
while True:
GPIO.output(LED, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(LED, GPIO.LOW)
time.sleep(0.5)
The issue is in the gpio_export() function of source/event_gpio.c. If you check that the GPIO is an LED before executing the export commands, like what is done in gpio_set_direction, then this fixes the issue.
I will send a pull request with the fix. This is a quick update that copies the LED detection code from gpio_set_direction. Eventually, the code should be refactored to consolidate the LED detection into a separate function or macro.
Keep up the good work and thanks for all the support that this library provides.
The text was updated successfully, but these errors were encountered:
I was able to test this successfully on BeagleBone Blue and turn on and off all 4 USR LEDs, in addition to the other built-in LEDs.
import Adafruit_BBIO.GPIO as GPIO
import time
# test built in LEDs on BeagleBone Blue
LED = [ "USR0" , "USR1", "USR2", "USR3", "RED_LED", "GREEN_LED", "BAT25", "BAT50", "BAT75", "BAT100", "WIFI" ]
for i in LED:
print("{0}: setup".format(i))
GPIO.setup(i, GPIO.OUT)
while True:
for i in LED:
print("{0}: on".format(i))
GPIO.output(i, GPIO.HIGH)
time.sleep(0.5)
print("{0}: off".format(i))
GPIO.output(i, GPIO.LOW)
time.sleep(0.5)
When running the LED blink code for a USR led on the PocketBeagle with the latest image (bone-debian-9.5-iot-armhf-2018-08-30-4gb.img.xz), the LED is left in a bad state upon exit (i.e. LED looks partially lit). At that point, you are unable to use that LED until you perform a hard reboot of the PocketBeagle. Here is the information to recreate the issue on the PocketBeagle:
debian@beaglebone:/var/lib/cloud9/file_io$ uname -a
Linux beaglebone 4.14.67-ti-r73 #1 SMP PREEMPT Thu Aug 30 00:08:52 UTC 2018 armv7l GNU/Linux
debian@beaglebone:/var/lib/cloud9/file_io$ python
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
debian@beaglebone:/var/lib/cloud9/file_io$ cat bbio_led.py
import Adafruit_BBIO.GPIO as GPIO
import time
LED = "USR3"
GPIO.setup(LED, GPIO.OUT)
while True:
GPIO.output(LED, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(LED, GPIO.LOW)
time.sleep(0.5)
The issue is in the gpio_export() function of source/event_gpio.c. If you check that the GPIO is an LED before executing the export commands, like what is done in gpio_set_direction, then this fixes the issue.
I will send a pull request with the fix. This is a quick update that copies the LED detection code from gpio_set_direction. Eventually, the code should be refactored to consolidate the LED detection into a separate function or macro.
Keep up the good work and thanks for all the support that this library provides.
The text was updated successfully, but these errors were encountered: