Page 2 of 2

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Feb 20, 2015 10:02 pm
by meltwater
Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.

Thanks for the great work on this!

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Feb 20, 2015 10:13 pm
by DirkS
meltwater wrote:Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.
It's been there for a couple of days now...

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Feb 20, 2015 11:37 pm
by meltwater
DirkS wrote:
meltwater wrote:Just to report that RPi.GPIO 0.5.11 works with the higher pin numbers. I take it that it will make its way into the repository at some stage.
It's been there for a couple of days now...
That's good news...chances are it went live, just after I last checked! :)

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Mar 06, 2015 6:59 pm
by Houtkamp
Has anyone figured out a way to use GPIO yet, or is it still messed up?

It would be great to be able to use this feature...

Bill

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Mar 06, 2015 7:20 pm
by DirkS
Houtkamp wrote:Has anyone figured out a way to use GPIO yet, or is it still messed up?

It would be great to be able to use this feature...

Bill
Which feature?
AFAIK updated RPi.GPIO has been fixed *and* in the repo for about 2 weeks now.
If you still have problems you should report them athttp://sourceforge.net/p/raspberry-gpio-python/tickets/

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Mar 06, 2015 7:49 pm
by DougieLawson
sudo apt-get update && sudo apt-get upgrade
Will get the latest RPi.GPIO library.

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Sun Mar 08, 2015 9:13 pm
by netelbcn
Hi,

I'm trying to import the RPi.GPIO library, and I have the same error message however I hsve the RPi.GPIO-0.5.11.egg version.

Could you help to me in order to solve this issue?

Thanks!

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Sun Mar 08, 2015 9:29 pm
by texy
netelbcn wrote:Hi,

I'm trying to import the RPi.GPIO library, and I have the same error message however I hsve the RPi.GPIO-0.5.11.egg version.

Could you help to me in order to solve this issue?

Thanks!
....see Dougie's post above.

Texy

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Mar 09, 2015 9:34 am
by netelbcn
texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Mar 09, 2015 9:40 am
by texy
netelbcn wrote:texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!
Please can you post the error message.
Texy

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Mar 09, 2015 9:48 am
by DougieLawson
Uninstall the version that dpkg/apt-get knows about.
sudo apt-get purge python{,3}-rpi.gpio

Scan your filesystem for all copies of RPi.GPIO
find /usr -name "*RPi*"
remove everything that you find

sudo apt-get install python{,3}-rpi.gpio
to put back a good version.

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Mar 09, 2015 12:17 pm
by hayderOICO
netelbcn wrote:texy, I did these steps:
DougieLawson wrote:sudo apt-get update && sudo apt-get upgrade
And I have now the 0.5.11 versión of the RPi.GPIO library, but I still have the same error (after reboot)

Thanks!
I believe you may still have the old versions lurking about in your usr/local/lib/python* find and delete them!

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Tue Mar 10, 2015 11:12 am
by netelbcn
DougieLawson wrote:Uninstall the version that dpkg/apt-get knows about.
sudo apt-get purge python{,3}-rpi.gpio

Scan your filesystem for all copies of RPi.GPIO
find /usr -name "*RPi*"
remove everything that you find

sudo apt-get install python{,3}-rpi.gpio
to put back a good version.
I followed these steps, and now it works fine!

Thanks a lot!!

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Jun 05, 2015 6:42 am
by Liam Senior
Hi all, i have a Pi2 and i am still getting the

Code: Select all

    import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!
error despite following the fix mentioned above. Help?

-many thanks

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Jun 05, 2015 11:59 am
by texy
Liam Senior wrote:Hi all, i have a Pi2 and i am still getting the

Code: Select all

    import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!
error despite following the fix mentioned above. Help?

-many thanks
Which os are you using, and how old is it?
Texy

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Fri Jun 05, 2015 4:59 pm
by DougieLawson
What do you get from

Code: Select all

#!/usr/bin/python
import RPi.GPIO
print RPi.GPIO.VERSION

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Sat Jun 06, 2015 6:11 am
by Liam Senior
OS is raspbian (05-05), RPi.GPIO is 0.5.11, I have python.dev installed if that makes a difference

-many thanks

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Sat Jun 06, 2015 9:22 am
by DougieLawson
You've got an old version of RPi.GPIO hiding in the bowels of your filesystem.

sudo apt-get purge python{,3}-rpi.gpio
find . -name "*RPi.GPIO*" | xargs sudo rm
sudo apt-get install python{,3}-rpi.gpio

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Jun 08, 2015 2:37 am
by Liam Senior
DougieLawson wrote:You've got an old version of RPi.GPIO hiding in the bowels of your filesystem.

sudo apt-get purge python{,3}-rpi.gpio
find . -name "*RPi.GPIO*" | xargs sudo rm
sudo apt-get install python{,3}-rpi.gpio
Tried it several times with no luck, program still not running

-many thanks

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Mon Jun 08, 2015 7:37 am
by joan
Is device tree enabled?

grep device /boot/config.txt

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Tue Jun 09, 2015 6:06 am
by Liam Senior
joan wrote:Is device tree enabled?

grep device /boot/config.txt
Tried with both enabled and disabled, no luck

-many thanks

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Tue Jun 09, 2015 7:28 am
by DougieLawson
Liam Senior wrote:
joan wrote:Is device tree enabled?

grep device /boot/config.txt
Tried with both enabled and disabled, no luck

-many thanks
Are you looking at the right config.txt? If using NOOBS boot the system while holding the [SHIFT] key to get the NOOBS recovery system running, it has a config editor.

Re: import RPi.GPIO as GPIO RuntimeError

Posted: Tue Jun 09, 2015 7:34 am
by joan
Liam Senior wrote: ...
Tried with both enabled and disabled, no luck
...
It does not resolve your issue but you need to enable device tree for recent versions of RPi.GPIO. It is broken on non device tree systems.