On Fri, 5 Oct 2018 12:18:39 -0700 (PDT),
hcasalncasal1963@gmail.com declaimed the
following:
Hello
I have been trying to configurate the GPIO’s as inputs , using this code (
I just show the main section).
*import Adafruit_BBIO.GPIO as GPIO.*
*DOOR= "P9_15" *
*GPIO.setup(DOOR, GPIO.IN)*
*print ( “test”)*
However, I get an 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.*
Please cut&paste the actual code and traceback... since line 4 of the
posted code is the print statement...
Also, you seem to have a period at the end of the import statement, and
that shouldn't be there.
What release of the OS are you using?
From an interactive (SSH via PuTTY) session (NOT using cloud9):
Using username "debian".
debian@beaglebone's password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Sep 14 11:44:20 2018 from fe80::c932:bd85:577:9922%eth0
debian@beaglebone:~$ uname -a
Linux beaglebone 4.14.49-ti-r54 #1 SMP PREEMPT Fri Jun 15 22:14:13 UTC 2018
armv7l GNU/Linux
debian@beaglebone:~$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
import Adafruit_BBIO.GPIO as GPIO
DOOR = "P9_15"
GPIO.setup(DOOR, GPIO.IN)
print("test")
test
Also worked in Python 2.x
GPIO.cleanup()
exit
Use exit() or Ctrl-D (i.e. EOF) to exit
exit()
debian@beaglebone:~$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import Adafruit_BBIO.GPIO as GPIO
DOOR = "P9_15"
GPIO.setup(DOOR, GPIO.IN)
print "test"
test
debian@beaglebone:~$
When I configurate the GPIO’s as outputs, I have not problem.
Perhaps because that is the default direction? (I don't recall the
defaults)