0

LED Sample Test Works Only Once
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LED Sample Test Works Only Once

by fherman on Sun Jul 15, 2018 1:18 am

I am trying a simple test python program on a BeagleBone blue:

import Adafruit_BBIO.GPIO as GPIO
import time
for i in range(4):
GPIO.setup("USR%d" % i, GPIO.OUT)
while True:
for i in range(4):
GPIO.output("USR%d" % i, GPIO.HIGH)
time.sleep(1)
for i in range(4):
GPIO.output("USR%d" % i, GPIO.LOW)
time.sleep(1)

The program works OK once. After I stop it, and then run it again, the LED's stay off. I did try to see if the cleanup() function called after running the loop for just a set number of cycles, but that didn't help.

I also see in the syslog file a complaint each time I run the program:
Jul 14 22:42:05 beaglebone python[1233]: Adafruit_BBIO: gpio_set_direction: 53 not applicable to built-in LEDs
Jul 14 22:42:05 beaglebone python[1233]: Adafruit_BBIO: gpio_set_direction: 54 not applicable to built-in LEDs
Jul 14 22:42:06 beaglebone python[1233]: Adafruit_BBIO: gpio_set_direction: 55 not applicable to built-in LEDs
Jul 14 22:42:06 beaglebone python[1233]: Adafruit_BBIO: gpio_set_direction: 56 not applicable to built-in LEDs

but if I do not have the setup calls in the program, the program errors out.

Is there something that needs to be reset to make the LED test work more than once?
fherman
 
Posts: 2
Joined: Sun Jun 22, 2014 12:13 am

Re: LED Sample Test Works Only Once

by drewfustini on Mon Jul 16, 2018 11:45 am

Hello, I'd like to know more about the setup on your BeagleBone.

Please paste the output of:
Code: Select all | TOGGLE FULL SIZE
sudo /opt/scripts/tools/version.sh

and
Code: Select all | TOGGLE FULL SIZE
cat /boot/uEnv.txt


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):
Code: Select all | TOGGLE FULL SIZE
sudo apt-get install strace

Then run strace, replace test.py with the name of your test program:
Code: Select all | TOGGLE FULL SIZE
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.

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.