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?
LED Sample Test Works Only Once
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: LED Sample Test Works Only Once
Hello, I'd like to know more about the setup on your BeagleBone.
Please paste the output of:
and
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.
Please paste the output of:
Code: Select all
sudo /opt/scripts/tools/version.sh
Code: Select all
cat /boot/uEnv.txt
Install strace (if it doesn't already exist):
Code: Select all
sudo apt-get install strace
Code: Select all
strace -f -o strace.log python test.py
Please be positive and constructive with your questions and comments.