GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

GPIO problems....

Fri Nov 01, 2013 11:41 am

Hi All,

I am trying to set up the GPIO pins on a Raspberry-Pi not connected to the internet is this possible as the scripts all seem to access a url http://pypi.python.org/packages/source/ ... .21.tar.gz
as I didn't want to connect my Pi to the outside world is there a binary I can download and then install as I don't want to hook my Pi to the net (plus if my plan works I want to create a set of self-contained system!)

Glenn

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO problems....

Fri Nov 01, 2013 12:16 pm

Could you provide more specific detail of what you are trying to do. The Operating System you are using and the scripting or programming language might help. And a link to any resources or tutorials you are following.

Why do you need to run scripts that access the internet? With recent (approx. this calendar year) versions of the Raspbian Operating System the support you need to access gpio pins from python ( the module RPi.GPIO ) is installed with the operating system by default. So if that's what you are using it should work 'Out of the Box.'

If needed, yes, it IS possible to download packages on some other system and transfer them to the RPi for installation, but it's not straightforward so let's avoid that if possible...
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Fri Nov 01, 2013 12:52 pm

Sorry, should have been more specific posted while trying things :? Problem is

[email protected] ~/Desktop/RPi.GPIO-0.5.3a $ sudo python setup.py install
running install
running build
running build_py
running build_ext
building 'RPi.GPIO' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv6l-2.7/source/py_gpio.o
source/py_gpio.c:23:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

I am using Raspian Wheezy (can't actually get the version out of the command line!, maybe I sould give up!!)

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Fri Nov 01, 2013 12:54 pm

Can you point me to a download of Raspian Wheezy that has the GPIO installed in it...

gordon77
Posts: 4310
Joined: Sun Aug 05, 2012 3:12 pm

Re: GPIO problems....

Fri Nov 01, 2013 1:17 pm

The latest Raspian download has GPIO already in it.

http://www.raspberrypi.org/downloads

I just added 'import RPi.GPIO as GPIO' to my python program and it worked

Gordon77

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Fri Nov 01, 2013 1:26 pm

Great, thank for that, am now downloading it! :D

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Fri Nov 01, 2013 10:50 pm

Is there an issue with the Raspian Wheezy down load, Tried 4 or 5 times and get a corrupt image that won't boot ?

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO problems....

Sat Nov 02, 2013 9:23 am

Two lines of attack here...

Firstly, I am currently downloading that .zip file to make sure it is accessible and intact. (It always has been whenever I have checked for people in the past, but it rules out a possible problem.) I'll report back on that.

Secondly. Do you need to download a whole new Operating System?
Maybe the RPi.gpio module is installed already? (Just because a tutorial says you have to install it as a first step does not mean the tutorial is accurate... )
Have you tried -

Code: Select all

[email protected] ~ $ python
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as gpio
>>>
If Python comes back with the >>> prompt and no error message, the module is installed already.
[Note that to actually run code that accesses the gpio pins you have to invoke python with "sudo python" ]

If it isn't there, or if your Raspbian installation is more than a few months old and might need refreshing, then simply doing an automatic online upgrade of the system might do the trick -

Code: Select all

sudo apt-get update
followed by

Code: Select all

sudo apt-get upgrade
[Your RPi will need an internet connection for this to work - I understand you don't want to RUN them in that mode, but perhaps you can connect temporarily to get set up?]

After the update/upgrade, retry the python/import test.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO problems....

Sat Nov 02, 2013 10:01 am

GlennP wrote:Is there an issue with the Raspian Wheezy down load, Tried 4 or 5 times and get a corrupt image that won't boot ?
I've just downloaded it. (at about 09.30 am utc, in the UK) The size of the downloaded .zip file is 605,227,145 bytes (ie nearly 600Mb) and it took about 20 minutes. Its SHA-1 checksum matches the one on the Downloads page.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Sat Nov 02, 2013 10:22 am

Hmmm, I need to download a new image as the card I was using had a very out dated version of the OS and the other larger card I stuck RISC OS on for an experiment using BBC basic. The zip is file 328,964 K, the torrent file is another way but I don't seem to access to my torrent client anymore.
Glenn

GlennP
Posts: 11
Joined: Fri Nov 01, 2013 11:31 am

Re: GPIO problems....

Sat Nov 02, 2013 12:16 pm

Umm, the last few times I have tried to download the zip file, it comes in under half the size of yours despite saying it is 577MB, is there a mirror site or can you give some guidance on using the torrent, please? :?:

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: GPIO problems....

Sat Nov 02, 2013 12:31 pm

I don't fully understand, but I think that the service presented as downloads.raspberrypi.org is already itself mirrored. (If you look up the DNS entry for that name you get a list of 5 different network addresses which I assume it uses in rotation to share the load?)

I'm not a 'torrent' user, but my understanding is that you fire up a Torrent client program on your PC, feed it the link from the downloads page, and it goes off and gets the file for you.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Return to “General discussion”