Dear sirs
I am a beginner and I have a new beaglebone black board . I begun to write my first code to read a pushbutton . I defined the pin P9_15 as input , using the following code( I show only the partial code):
import Adafruit_BBIO.GPIO as GPIO.
DOOR= "P9_15"
GPIO.setup(DOOR, GPIO.IN)
.
.
.
However , when I run the code, I get the following error message:
Traceback (most recent call last):
File "/var/lib/cloud9/examples/alarm.py", line 4, in <module>
GPIO.setup(DOOR, GPIO.IN)
ValueError: Set gpio mode failed, missing file or invalid permissions.
Would someone please help me to find what is the problem?
Additionally, How can I do to update the time and date in BBB?
I would like to use the BBB to develop a Telemetry system.
Thank you
Hugo
Problems to define a GPIO pin as input in Begalebone black
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
- silver2row
- Posts: 180
- Joined: Sat Jan 30, 2016 3:42 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello,
Seth here. Try to use this command if you have the correct image: sudo config-pin P9.15 gpio.
Seth
P.S. The time and date can be updated w/ sudo dpkg-reconfigure tzdata. You will get an easy interface to interact w/.
Seth here. Try to use this command if you have the correct image: sudo config-pin P9.15 gpio.
Seth
P.S. The time and date can be updated w/ sudo dpkg-reconfigure tzdata. You will get an easy interface to interact w/.
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hi
Thank you for your help
I am using the cloud9 terminal to write the commands ( I hope that it is the correct).
I used the commands , but the system response to me with the following error message:
debian@beaglebone:/var/lib/cloud9$ sudo config-pin P9.15 gpio
P9_15 pinmux file not found!
Pin has no cape: P9_15[/b]
And when I use the command to update the time and date, the system change the information, but it isn't the correct.
debian@beaglebone:/var/lib/cloud9$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/Guayaquil'
Local time is now: Sat Sep 29 01:13:44 -05 2018.
Universal Time is now: Sat Sep 29 06:13:44 UTC 2018.
regards
Hugo
Thank you for your help
I am using the cloud9 terminal to write the commands ( I hope that it is the correct).
I used the commands , but the system response to me with the following error message:
debian@beaglebone:/var/lib/cloud9$ sudo config-pin P9.15 gpio
P9_15 pinmux file not found!
Pin has no cape: P9_15[/b]
And when I use the command to update the time and date, the system change the information, but it isn't the correct.
debian@beaglebone:/var/lib/cloud9$ sudo dpkg-reconfigure tzdata
Current default time zone: 'America/Guayaquil'
Local time is now: Sat Sep 29 01:13:44 -05 2018.
Universal Time is now: Sat Sep 29 06:13:44 UTC 2018.
regards
Hugo
- silver2row
- Posts: 180
- Joined: Sat Jan 30, 2016 3:42 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello,
Please give me this info. so I can help more:
...
If you are using an outdated kernel and image, this may be your issue and I will not be able to help you past this idea w/ those older images/kernels.
Seth
Please give me this info. so I can help more:
Code: Select all
uname -a
Code: Select all
cat /etc/dogtag
Seth
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello
This is the information :
Operating System: Debian GNU /Linux 9 (stretch)
Kernel : Linux 4.14.67-ti-r73
Regards
Hugo
This is the information :
Operating System: Debian GNU /Linux 9 (stretch)
Kernel : Linux 4.14.67-ti-r73
Regards
Hugo
- silver2row
- Posts: 180
- Joined: Sat Jan 30, 2016 3:42 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello Hugo,
Seth here. Um...try this: https://debian.beagleboard.org/images/b ... 4gb.img.xz. This should give you the config-pin utility for your use.
If this does not work, please let me know. I have this image on my current BBBW and it has the config-pin utility on it.
Seth
P.S. That image is from beagleboard.org/latest-images and it is the console image (w/out the GUI).
Seth here. Um...try this: https://debian.beagleboard.org/images/b ... 4gb.img.xz. This should give you the config-pin utility for your use.
If this does not work, please let me know. I have this image on my current BBBW and it has the config-pin utility on it.
Seth
P.S. That image is from beagleboard.org/latest-images and it is the console image (w/out the GUI).
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hi Hugo,NICOCASAL wrote:Hello
This is the information :
Operating System: Debian GNU /Linux 9 (stretch)
Kernel : Linux 4.14.67-ti-r73
Regards
Hugo
It is import to run this command and paste the output in the reply:
sudo /opt/scripts/tools/version.sh
This script will output the versions of software running on your BeagleBone including the version of the u-boot bootloader. Older versions of u-boot booloader on the eMMC can cause issues.
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Thanks to both .
As I mentioned before , I am beginner and I don´t know so much how to write the different commands.
In this case , Can you please indicate me where I should to write the command (sudo /opt/scripts/tools/version.sh)?
I am using Cloud9 and Putty.
regards
Hugo
As I mentioned before , I am beginner and I don´t know so much how to write the different commands.
In this case , Can you please indicate me where I should to write the command (sudo /opt/scripts/tools/version.sh)?
I am using Cloud9 and Putty.
regards
Hugo
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello
I updated the image version with the command "https://debian.beagleboard.org/images/b ... 4gb.img.xz." . Using "hostnamectl " command , seems that I get the same version that I downloaded the first time.
"Operating System: Debian GNU /Linux 9 (stretch)"
I updated the image version with the command "https://debian.beagleboard.org/images/b ... 4gb.img.xz." . Using "hostnamectl " command , seems that I get the same version that I downloaded the first time.
"Operating System: Debian GNU /Linux 9 (stretch)"
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello
I updated the image version with the command "https://debian.beagleboard.org/images/b ... 4gb.img.xz." . Using "hostnamectl " command , I believe that I got the same version that I downloaded the first time.
"Operating System: Debian GNU /Linux 9 (stretch)"
I updated the image version with the command "https://debian.beagleboard.org/images/b ... 4gb.img.xz." . Using "hostnamectl " command , I believe that I got the same version that I downloaded the first time.
"Operating System: Debian GNU /Linux 9 (stretch)"
- silver2row
- Posts: 180
- Joined: Sat Jan 30, 2016 3:42 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello,
Use the /home/debian/ dir. to use that command. Try that! That should work for posting all the info. the other fellow needs to determine your issue. So, go to your /home/debian/ dir. and put in the command he mentioned.
Seth
P.S. He is probably correct. You probably have an old bootloader version on your eMMC. Listen to him over me. I am sure he can help you the fastest.
Use the /home/debian/ dir. to use that command. Try that! That should work for posting all the info. the other fellow needs to determine your issue. So, go to your /home/debian/ dir. and put in the command he mentioned.
Seth
P.S. He is probably correct. You probably have an old bootloader version on your eMMC. Listen to him over me. I am sure he can help you the fastest.
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
instead of hostnamectl, please run this command:NICOCASAL wrote:Hello
I updated the image version with the command "https://debian.beagleboard.org/images/b ... 4gb.img.xz." . Using "hostnamectl " command , I believe that I got the same version that I downloaded the first time.
"Operating System: Debian GNU /Linux 9 (stretch)"
sudo /opt/scripts/tools/version.sh
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello
I followed his recommendation and it seems that the use of the command was successful. Is there a way to verify that it was correct?
Just to verify if this command corrected the problems I have had. Try this code, but the system answers this error
"import Adafruit_BBIO.GPIO as GPIO
GPIO.setup("P9_15", GPIO.IN)
print( "test")"
Traceback (most recent call last):
File "/var/lib/cloud9/examples/prueba1.py", line 4, in <module>
GPIO.setup("P9_15", GPIO.IN)
ValueError: Set gpio mode failed, missing file or invalid permissions.
I will be making an error when writing the code?
Thanks
Hugo
I followed his recommendation and it seems that the use of the command was successful. Is there a way to verify that it was correct?
Just to verify if this command corrected the problems I have had. Try this code, but the system answers this error
"import Adafruit_BBIO.GPIO as GPIO
GPIO.setup("P9_15", GPIO.IN)
print( "test")"
Traceback (most recent call last):
File "/var/lib/cloud9/examples/prueba1.py", line 4, in <module>
GPIO.setup("P9_15", GPIO.IN)
ValueError: Set gpio mode failed, missing file or invalid permissions.
I will be making an error when writing the code?
Thanks
Hugo
- NICOCASAL
- Posts: 14
- Joined: Sun Sep 30, 2018 1:52 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
Hello
Would you please suggest me something to advance and solve the issue that I have?
In my telemetry project will need approximately 25 BBB. I have reading the Adafruit libraries in Python and I believe that is possible for me to write the program to my application. I require to use the digital and analog inputs and outputs , send emails, and probably to use the LCD display, however I don´t know enough Linux to configurate the el BBB with the following neccesary services.
1. Permanent internet connection , even , when the BBB power on and power off.
2. I need that different codes programed in the BBB, run automatically when the board boot( running at startup)
3. Update the software( the libraries)
I have been using the followings commands :
( for internet permanent connection) :
# crontab -e
@reboot /sbin/ route add default gw 192.168.7.1
(Update the software) :
# apt -get update && apt-get upgrade
#pip install --upgrade PyBBIO Adafruit _BBIO
(multiproccesing)
#crontab -e
@reboot /usr/bin/python/to/my_program.py
Do you believe these commands are the corrects?
I believe that Beaglebone black is a great computer and I am sure that is it I need
Thank you in advance for your help
Hugo
Would you please suggest me something to advance and solve the issue that I have?
In my telemetry project will need approximately 25 BBB. I have reading the Adafruit libraries in Python and I believe that is possible for me to write the program to my application. I require to use the digital and analog inputs and outputs , send emails, and probably to use the LCD display, however I don´t know enough Linux to configurate the el BBB with the following neccesary services.
1. Permanent internet connection , even , when the BBB power on and power off.
2. I need that different codes programed in the BBB, run automatically when the board boot( running at startup)
3. Update the software( the libraries)
I have been using the followings commands :
( for internet permanent connection) :
# crontab -e
@reboot /sbin/ route add default gw 192.168.7.1
(Update the software) :
# apt -get update && apt-get upgrade
#pip install --upgrade PyBBIO Adafruit _BBIO
(multiproccesing)
#crontab -e
@reboot /usr/bin/python/to/my_program.py
Do you believe these commands are the corrects?
I believe that Beaglebone black is a great computer and I am sure that is it I need
Thank you in advance for your help
Hugo
- drewfustini
- Posts: 944
- Joined: Sat Dec 26, 2015 1:19 pm
Re: Problems to define a GPIO pin as input in Begalebone bl
It is important to see the output of this script to determine your BeagleBone is configured correctly.
sudo /opt/scripts/tools/version.sh
You indicated that this generated an error when trying to run. Please take a screenshot of the error and attach it to the reply.
sudo /opt/scripts/tools/version.sh
You indicated that this generated an error when trying to run. Please take a screenshot of the error and attach it to the reply.
Please be positive and constructive with your questions and comments.