jgearing
Posts: 51
Joined: Sat Mar 03, 2012 6:33 pm

Don't laugh

Fri Jul 27, 2012 8:39 am

A well meaning idiot, AKA my daughter bought me a Pang expansion board for my birthday
(as if I dont have enough problems)
She is now expecting to see my pi running the National grid, or at least the Blackpool illuminations,
having spent a week trying to get a flashing LED I have finally managed to get python 2 running with GPIO as a front end on squeeze
AT the first command I get

>>> GPIO.setup(11, GPIO.OUT)
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'

Does anybody have the foggiest idea what this means and what
i can do about it
Could I be using incompatible GPIOs and Pythons

More in hope than expectation

Thanks
JG

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Don't laugh

Fri Jul 27, 2012 8:46 am

you need to run it with a sudo on the front as your need root permission to access the GPIO I believe
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

jgearing
Posts: 51
Joined: Sat Mar 03, 2012 6:33 pm

Re: Don't laugh

Fri Jul 27, 2012 9:45 am

sorry Steve
All that got me was a syntax error
i may try the latest versions of python and
gpio. There may be a clash somewhere
My plans to take over the Pentagon will have to go on hold
(that should get me a free flight to Gitmo)

ZX81!! there's posh. I could only manage a ZX80. mind you I couldn't work that properly either
No Amiga??

Thanks anyway

JG
















0

khh
Posts: 49
Joined: Thu Jul 26, 2012 12:16 am

Re: Don't laugh

Fri Jul 27, 2012 9:47 am

jgearing wrote:sorry Steve
All that got me was a syntax error
i may try the latest versions of python and
gpio. There may be a clash somewhere
My plans to take over the Pentagon will have to go on hold
(that should get me a free flight to Gitmo)
It's python you have to run as root (that is with sudo in front).
So when you start python, type "sudo python" or "sudo python your-script.py".

jgearing
Posts: 51
Joined: Sat Mar 03, 2012 6:33 pm

Re: Don't laugh

Fri Jul 27, 2012 10:59 am

Thanks all
Finally got there, only took 15 mins to realise that "true" should be "True"
These capitals are a pain
Never mind, never thought I'd be so pleased to see a little red light go on and off
My wife is unimpressed for some reason, strange people women.

thanks again

JG

Return to “Beginners”