Raspi GPIO Python error
Strange: the Raspi GPIO Python module (http://pypi.python.org/
Error when using as a normal user:
pi@raspberrypi ~ $ python
Python 2.7.3rc2 (default, Apr 23 2012, 04:52:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> GPIO.setup(11, GPIO.IN)
Traceback (most recent call last):
File "
File "/usr/local/lib/python2.7/dist-packages/RPi.GPIO-0.2.0-py2.7.egg/RPi/GPIO/__init__.py", line 102, in setup
with open(/sys/class/gpio/export, w) as f:
IOError: [Errno 13] Permission denied: /sys/class/gpio/export
>>>
Ugly workaround:
pi@raspberrypi ~ $ sudo python
Python 2.7.3rc2 (default, Apr 23 2012, 04:52:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> GPIO.setup(11, GPIO.IN)
>>> input_value = GPIO.input(11)
>>> print input_value
False
>>>
pi@raspberrypi ~ $
Hopefully Ill find a nicer solution. I couldnt anything via Google so far ...
download file now