+ Post New Thread
Results 1 to 7 of 7
Raspberry Pi, Arduino & Other SBCs Thread, GPIO Python permission issues in Technical; I want a blinking LED! downloaded FPi.GPIO-0.2.0.tar.gz and think I sucessfully installed it run python 2.6 from menu and import ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,720
    Thank Post
    1,451
    Thanked 580 Times in 434 Posts
    Rep Power
    165

    GPIO Python permission issues

    I want a blinking LED!

    downloaded FPi.GPIO-0.2.0.tar.gz and think I sucessfully installed it
    run python 2.6 from menu and

    import RPi.GPIO as GPIO
    give no error

    but GPIO.setup(11, GPIO.OUT)
    gives
    Code:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python2.6/dist-packages/RPi.GPIO-0.2.0-py2.6.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'
    Anyone had this and what's the cure?

    Also what physical pin does pythons 11 map to - is it Pin 3 on the PI GPIO strip (e.g GPIO on the right,2nd pin down on left side pins)???

    Si

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,656
    Thank Post
    324
    Thanked 506 Times in 474 Posts
    Rep Power
    177
    What OS you running it on currently? Will probably need dialout permissions if it's not runnig under sudo etc.

    Steve

  3. #3

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,720
    Thank Post
    1,451
    Thanked 580 Times in 434 Posts
    Rep Power
    165
    the default debian6-19-04-2012
    Si

  4. #4

    teejay's Avatar
    Join Date
    Apr 2008
    Posts
    3,051
    Thank Post
    275
    Thanked 722 Times in 550 Posts
    Rep Power
    326
    Need to start python as root to use the GPIO, so do sudo python first. Haven't figured out a way round that yet but I'm still pretty much a noob at this

  5. #5

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,656
    Thank Post
    324
    Thanked 506 Times in 474 Posts
    Rep Power
    177
    You'll have to double check, as I haven't played with the Pi yet, but in terms of pure apache to debian etc. Normally it runs it under www-data user, who's not a member of dialout group (Which I'm pretty sure you need for access to the "hardware" side).

    Might be worth checking permissions on it, or just run as sudo in first place

    Steve

  6. #6
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,938
    Thank Post
    114
    Thanked 272 Times in 250 Posts
    Rep Power
    104
    Anything to do with the GPIO needs elevated privileges.

  7. Thanks to ChrisH from:

    SimpleSi (8th July 2012)

  8. #7

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,720
    Thank Post
    1,451
    Thanked 580 Times in 434 Posts
    Rep Power
    165
    Yeah - it works OK if I run python using sudo python
    Si

SHARE:
+ Post New Thread

Similar Threads

  1. NTFS Permission Issue
    By buzzard in forum Windows Server 2000/2003
    Replies: 2
    Last Post: 18th March 2009, 04:22 PM
  2. Permissions issue
    By laserblazer in forum Windows
    Replies: 3
    Last Post: 17th November 2008, 01:56 PM
  3. Transfer User Area's - Permissions Issues ??
    By mac_shinobi in forum Wireless Networks
    Replies: 24
    Last Post: 21st May 2008, 12:36 PM
  4. Replies: 5
    Last Post: 3rd January 2008, 02:08 PM
  5. Replies: 3
    Last Post: 9th September 2006, 08:13 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •