LED Sample Test Works Only Once

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
fherman
 
Posts: 2
Joined: Sun Jun 22, 2014 12:13 am

LED Sample Test Works Only Once

Post by fherman »

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?

User avatar
drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: LED Sample Test Works Only Once

Post by drewfustini »

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

Please paste the output of:

Code: Select all

sudo /opt/scripts/tools/version.sh
and

Code: Select all

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

sudo apt-get install strace
Then run strace, replace test.py with the name of your test program:

Code: Select all

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”