New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemError: This module can only be run on a Raspberry Pi! #53

Open
momofoto opened this Issue Feb 21, 2015 · 39 comments

Comments

Projects
None yet
@momofoto

Hi,
I have a Raspberry Pi 2 and am getting the error below when trying to import the RPIO module. Should. Was getting this error when trying to import RPi.GPIO as well until recently, but that imports OK after some recent updates? Only just worked out that these are two different things - being a newbie and all that!

@raspberrypi ~ $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import RPIO
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/RPIO-0.10.1-py2.7-linux-armv7l.egg/RPIO/init.py", line 115, in
import RPIO._GPIO as _GPIO
SystemError: This module can only be run on a Raspberry Pi!

@felix133711

This comment has been minimized.

Show comment
Hide comment
@felix133711

felix133711 Feb 26, 2015

Hi,

same problem :(

Hi,

same problem :(

@netelbcn

This comment has been minimized.

Show comment
Hide comment
@netelbcn

netelbcn Mar 8, 2015

Hi!

Could you solve this error...? I'm now trying to import RPi.GPIO with 0.5.11.egg version, and the same error...

netelbcn commented Mar 8, 2015

Hi!

Could you solve this error...? I'm now trying to import RPi.GPIO with 0.5.11.egg version, and the same error...

@tylerwowen

This comment has been minimized.

Show comment
Hide comment
@tylerwowen

tylerwowen Mar 25, 2015

Hi,

This issue is caused by the hardware changes in Pi 2. Some hardcoded parts are not working on Pi2. I forked it and fixed the problems. Now it is running on my Pi2, but it is not fully tested so I cannot guarantee its quality. So you can clone from my repo and install it. https://github.com/tylerwowen/RPIO

To install

$ git clone https://github.com/tylerwowen/RPIO.git
$ cd RPIO
$ sudo python setup.py install

Hi,

This issue is caused by the hardware changes in Pi 2. Some hardcoded parts are not working on Pi2. I forked it and fixed the problems. Now it is running on my Pi2, but it is not fully tested so I cannot guarantee its quality. So you can clone from my repo and install it. https://github.com/tylerwowen/RPIO

To install

$ git clone https://github.com/tylerwowen/RPIO.git
$ cd RPIO
$ sudo python setup.py install
@netelbcn

This comment has been minimized.

Show comment
Hide comment
@netelbcn

netelbcn Mar 25, 2015

Thanks!!

I finally solved this error deleting all RPi.GPIO files in the system and then installing from scratch the 0.5.11 version.

Anyway, thank you very much!

Thanks!!

I finally solved this error deleting all RPi.GPIO files in the system and then installing from scratch the 0.5.11 version.

Anyway, thank you very much!

@HasiKP

This comment has been minimized.

Show comment
Hide comment
@HasiKP

HasiKP Mar 30, 2015

@netelbcn how do I delete RPI.GPIO files in the system and install 0.5.11 version from scratch

HasiKP commented Mar 30, 2015

@netelbcn how do I delete RPI.GPIO files in the system and install 0.5.11 version from scratch

@netelbcn

This comment has been minimized.

Show comment
Hide comment
@netelbcn

netelbcn Mar 30, 2015

@HasiKP:
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.

@HasiKP:
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.

@yah86

This comment has been minimized.

Show comment
Hide comment
@yah86

yah86 Apr 2, 2015

@tylerwowen

Hi,

I tried using your RPIO library, but the servo methods and PWM methods did not work.

yah86 commented Apr 2, 2015

@tylerwowen

Hi,

I tried using your RPIO library, but the servo methods and PWM methods did not work.

@tylerwowen

This comment has been minimized.

Show comment
Hide comment
@tylerwowen

tylerwowen Apr 2, 2015

@yah86
Sorry for the inconvenience. I didn't modify the part for PWM. I'm busy recently, so I don't think I can fix till next week. You can try to modify files under source/c_pwm to make it work. Basically you just need to change some hardware addresses.

@yah86
Sorry for the inconvenience. I didn't modify the part for PWM. I'm busy recently, so I don't think I can fix till next week. You can try to modify files under source/c_pwm to make it work. Basically you just need to change some hardware addresses.

@yah86

This comment has been minimized.

Show comment
Hide comment
@yah86

yah86 Apr 4, 2015

@tylerwowen

Thanks.
I'll try it.

yah86 commented Apr 4, 2015

@tylerwowen

Thanks.
I'll try it.

@HasiKP

This comment has been minimized.

Show comment
Hide comment
@HasiKP

HasiKP Apr 5, 2015

@netelbcn
thanx
@yah86
did you find a way to use servo methods and the pwm methods

HasiKP commented Apr 5, 2015

@netelbcn
thanx
@yah86
did you find a way to use servo methods and the pwm methods

@yah86

This comment has been minimized.

Show comment
Hide comment
@yah86

yah86 Apr 6, 2015

@HasiKP
I have not yet found its way.
Because I have not yet found the datasheet of BCM2836.

yah86 commented Apr 6, 2015

@HasiKP
I have not yet found its way.
Because I have not yet found the datasheet of BCM2836.

@joan2937

This comment has been minimized.

Show comment
Hide comment
@joan2937

joan2937 Apr 6, 2015

The Pi2 peripherals are exactly the same as the earlier Pis. See the bcm3835 documentation. The peripheral base address has moved from 0x20000000 to 0x3F000000. DMA memory is now at offset 0xC0000000 rather than 0x40000000. For RPIO.GPIO you should be allocating DMA memory via the mailbox interface.

joan2937 commented Apr 6, 2015

The Pi2 peripherals are exactly the same as the earlier Pis. See the bcm3835 documentation. The peripheral base address has moved from 0x20000000 to 0x3F000000. DMA memory is now at offset 0xC0000000 rather than 0x40000000. For RPIO.GPIO you should be allocating DMA memory via the mailbox interface.

@HasiKP

This comment has been minimized.

Show comment
Hide comment
@HasiKP

HasiKP Apr 6, 2015

@joan2937
I'm new to this so its a great help for everyone if you can modify it and share with us.

HasiKP commented Apr 6, 2015

@joan2937
I'm new to this so its a great help for everyone if you can modify it and share with us.

@joan2937

This comment has been minimized.

Show comment
Hide comment
@joan2937

joan2937 Apr 6, 2015

I'm busy with other software and don't actually use RPIO.GPIO. For examples of the needed changes have a look at servoblaster, pi-blaster, or pigpio (they each use PWM/PCM and DMA to generate PWM and servo pulses).

joan2937 commented Apr 6, 2015

I'm busy with other software and don't actually use RPIO.GPIO. For examples of the needed changes have a look at servoblaster, pi-blaster, or pigpio (they each use PWM/PCM and DMA to generate PWM and servo pulses).

@AnkurChoraywal

This comment has been minimized.

Show comment
Hide comment
@AnkurChoraywal

AnkurChoraywal May 1, 2015

@tylerwowen
Have you fixed RPIO PWM and other bugs? Please let know asap!!!

@tylerwowen
Have you fixed RPIO PWM and other bugs? Please let know asap!!!

@r-shayestehpour

This comment has been minimized.

Show comment
Hide comment
@r-shayestehpour

r-shayestehpour May 12, 2015

any updates on this issue?
(RPi 2, GPIO 0.5.11)

any updates on this issue?
(RPi 2, GPIO 0.5.11)

@Vijayenthiran

This comment has been minimized.

Show comment
Hide comment
@Vijayenthiran

Vijayenthiran Aug 5, 2015

Any update on the issue? Having the same problem :(

Any update on the issue? Having the same problem :(

@griffegg

This comment has been minimized.

Show comment
Hide comment
@griffegg

griffegg Aug 14, 2015

Hi, me too. I'm building a robot and without RPIO working I have too much jitter. Do you have a working version for the RPi2 yet? Thanks so much for your efforts!

Hi, me too. I'm building a robot and without RPIO working I have too much jitter. Do you have a working version for the RPi2 yet? Thanks so much for your efforts!

@loganhe0215

This comment has been minimized.

Show comment
Hide comment
@loganhe0215

loganhe0215 Aug 15, 2015

same problem

same problem

@joan2937

This comment has been minimized.

Show comment
Hide comment
@joan2937

joan2937 Aug 15, 2015

There are quite a few alternatives to RPIO.GPIO. For instance, if all you want is servo pulses look at servoblaster. If you want a general Python gpio module including PWM/servo pulses plus much more look at my pigpio here and here.

There are quite a few alternatives to RPIO.GPIO. For instance, if all you want is servo pulses look at servoblaster. If you want a general Python gpio module including PWM/servo pulses plus much more look at my pigpio here and here.

@Vijayenthiran

This comment has been minimized.

Show comment
Hide comment
@Vijayenthiran

Vijayenthiran Aug 15, 2015

@joan2937 Hi, I tried to use servoblaster in Rpi - 2 Model B. Didn't work. Even pi-blaster didn't work. Looks like DMA controller address for Rpi-2 is different from the previous model. Should try your pigpio library. !

@joan2937 Hi, I tried to use servoblaster in Rpi - 2 Model B. Didn't work. Even pi-blaster didn't work. Looks like DMA controller address for Rpi-2 is different from the previous model. Should try your pigpio library. !

@joan2937

This comment has been minimized.

Show comment
Hide comment
@joan2937

joan2937 Aug 15, 2015

@Vijayenthiran servoblaster and pi-blaster (and my pigpio) have been updated to work on the Pi2. The servoblaster github repository has not been updated. You can find a link to the updated software by searching for servoblaster on the rasperrypi.org forums.

@Vijayenthiran servoblaster and pi-blaster (and my pigpio) have been updated to work on the Pi2. The servoblaster github repository has not been updated. You can find a link to the updated software by searching for servoblaster on the rasperrypi.org forums.

@griffegg

This comment has been minimized.

Show comment
Hide comment
@griffegg

griffegg Aug 16, 2015

Thank you so much! I will try them.

Thank you so much! I will try them.

@Vijayenthiran

This comment has been minimized.

Show comment
Hide comment
@Vijayenthiran

Vijayenthiran Aug 16, 2015

Thank you Joan.. Will try them.
On Aug 16, 2015 10:45 PM, "Greg Griffes" notifications@github.com wrote:

Thank you so much! I will try them.


Reply to this email directly or view it on GitHub
#53 (comment).

Thank you Joan.. Will try them.
On Aug 16, 2015 10:45 PM, "Greg Griffes" notifications@github.com wrote:

Thank you so much! I will try them.


Reply to this email directly or view it on GitHub
#53 (comment).

@rdagger

This comment has been minimized.

Show comment
Hide comment
@rdagger

rdagger Aug 18, 2015

Joan, the RPIO.add_channel_pulse(dma_channel, gpio, start, width) method has a start argument that allows you to specify when pulses start during the pwm period. Does pigpio offer this functionality? If not, is it something you would consider adding? Thanks for the great library.

rdagger commented Aug 18, 2015

Joan, the RPIO.add_channel_pulse(dma_channel, gpio, start, width) method has a start argument that allows you to specify when pulses start during the pwm period. Does pigpio offer this functionality? If not, is it something you would consider adding? Thanks for the great library.

@joan2937

This comment has been minimized.

Show comment
Hide comment
@joan2937

joan2937 Aug 18, 2015

Probably best to raise an issue at https://github.com/joan2937/pigpio/tree/master unless it relates directly to RPIO.

Probably best to raise an issue at https://github.com/joan2937/pigpio/tree/master unless it relates directly to RPIO.

@slowmed

This comment has been minimized.

Show comment
Hide comment
@slowmed

slowmed Sep 5, 2015

no update for PWM for rpi2 yet ??

slowmed commented Sep 5, 2015

no update for PWM for rpi2 yet ??

@alexellis

This comment has been minimized.

Show comment
Hide comment
@alexellis

alexellis Dec 18, 2015

I spoke to Eben Upton at PiWars he said that there is a setting for /boot/config.txt which uses the memory addressing from the original PI. This should fix issues for PI2 but at the same time halves your RAM.

I spoke to Eben Upton at PiWars he said that there is a setting for /boot/config.txt which uses the memory addressing from the original PI. This should fix issues for PI2 but at the same time halves your RAM.

@rdagger

This comment has been minimized.

Show comment
Hide comment
@rdagger

rdagger Dec 19, 2015

@alexellis I'm skeptical that it could work. I took a quick look at the library several months ago and the pwm issues were more than just changes in address locations. I don't recall specifically but I remember something about the need for a rewrite using the mailbox interface. Still let us know if you have any luck.

rdagger commented Dec 19, 2015

@alexellis I'm skeptical that it could work. I took a quick look at the library several months ago and the pwm issues were more than just changes in address locations. I don't recall specifically but I remember something about the need for a rewrite using the mailbox interface. Still let us know if you have any luck.

@psssix

This comment has been minimized.

Show comment
Hide comment
@psssix

psssix Jan 4, 2016

Good afternoon. I, too, was faced with this problem. I looked at forks RPIO library, and found the right fork. Good afternoon. I propose to use the current fork:
https://github.com/tylerwowen/RPIO

psssix commented Jan 4, 2016

Good afternoon. I, too, was faced with this problem. I looked at forks RPIO library, and found the right fork. Good afternoon. I propose to use the current fork:
https://github.com/tylerwowen/RPIO

@DonRecardo

This comment has been minimized.

Show comment
Hide comment
@DonRecardo

DonRecardo Mar 10, 2016

I take it thats its because I have a Pi 3 that I also get the msg , only runs on a raspberry Pi

I take it thats its because I have a Pi 3 that I also get the msg , only runs on a raspberry Pi

@ludusrusso

This comment has been minimized.

Show comment
Hide comment
@ludusrusso

ludusrusso Mar 21, 2016

I face the same problem with RasPi3, any solution yet?

I face the same problem with RasPi3, any solution yet?

@limuxy

This comment has been minimized.

Show comment
Hide comment
@limuxy

limuxy Mar 25, 2016

@DonRecardo @ludusrusso I've forked @tylerwowen 's fork and added support for Pi 3, working for my Pi 3 now, get it at https://github.com/limuxy/RPIO
do let me know if you meet any problem

limuxy commented Mar 25, 2016

@DonRecardo @ludusrusso I've forked @tylerwowen 's fork and added support for Pi 3, working for my Pi 3 now, get it at https://github.com/limuxy/RPIO
do let me know if you meet any problem

@DonRecardo

This comment has been minimized.

Show comment
Hide comment
@DonRecardo

DonRecardo Mar 25, 2016

@limuxy Firstly thanks for letting me know you have it sorted which is very good of you .
I dont mean to be a bigger nuisance but being a noob to both linux and R pi I now have another problem . Everything else I have installed I have done with sudo apt-get install , but this package is a zip and I dont really know how to handle it .
I downloaded it and it appears in my download folder but if I double click on it it asks me what program I wish to you to unzip it and I dont know what to use or where to find it , Then when I do get it unzipped
how do I install it ? I can only assume its something like sudo python setup.py ?
I could appreciate some help as what to do

Cheers
Don

EDIT I think I have worked it out for myself . I right clicked on the zip and said extract
I put everything into a directory I made called RPIO
I then went to that directory and did sudo python setup.py install and it seemed to do it ok

Have I done it correctly and do I need to keep the directory RPIO and its contents or has
installing it set it up in another directory somewhere ?

@limuxy Firstly thanks for letting me know you have it sorted which is very good of you .
I dont mean to be a bigger nuisance but being a noob to both linux and R pi I now have another problem . Everything else I have installed I have done with sudo apt-get install , but this package is a zip and I dont really know how to handle it .
I downloaded it and it appears in my download folder but if I double click on it it asks me what program I wish to you to unzip it and I dont know what to use or where to find it , Then when I do get it unzipped
how do I install it ? I can only assume its something like sudo python setup.py ?
I could appreciate some help as what to do

Cheers
Don

EDIT I think I have worked it out for myself . I right clicked on the zip and said extract
I put everything into a directory I made called RPIO
I then went to that directory and did sudo python setup.py install and it seemed to do it ok

Have I done it correctly and do I need to keep the directory RPIO and its contents or has
installing it set it up in another directory somewhere ?

@DonRecardo

This comment has been minimized.

Show comment
Hide comment
@DonRecardo

DonRecardo Mar 25, 2016

@limuxy
I spoke to soon . It wasnt my attempt at an installation that was running . It was trying to run the original install at /usr/local/lib/python3.4/dist-packages and of course thats the one that comes back with
can only be run on a raspberry pi

I have now removed the old version , but still dont know how or where to install your fork of it

@limuxy
I spoke to soon . It wasnt my attempt at an installation that was running . It was trying to run the original install at /usr/local/lib/python3.4/dist-packages and of course thats the one that comes back with
can only be run on a raspberry pi

I have now removed the old version , but still dont know how or where to install your fork of it

@DonRecardo

This comment has been minimized.

Show comment
Hide comment
@DonRecardo

DonRecardo Mar 25, 2016

@limuxy
Well at the risk of being wrong again I will stick my neck out again and say I think its working

After uninstalling the old version of RPIO I again did sudo python setup.py install
and it did its stuff
I then went and had a look and in usr/local/lib/python2.7/dist-packages and RPIO was there
but when I looked in python3.4 it didnt have it in its dist-packages
As I use python3 I thought I must have to get it installed there too so I tried
the same as before but substituted python with python3 as
sudo python3 setup.py install . and I thought I had won as it started its stuff but at the end it said it had errored and on checking python3s dist -packeges it still wasnt there .
but I thought I would give it a try
I stareted python3 up and did
import RPIO ; print(dir(RPIO))
and it gave me doc , loader ........etc
before all I got was "can only run on a raspberry pi"
so it appears to be working ( I think )

Don

@limuxy
Well at the risk of being wrong again I will stick my neck out again and say I think its working

After uninstalling the old version of RPIO I again did sudo python setup.py install
and it did its stuff
I then went and had a look and in usr/local/lib/python2.7/dist-packages and RPIO was there
but when I looked in python3.4 it didnt have it in its dist-packages
As I use python3 I thought I must have to get it installed there too so I tried
the same as before but substituted python with python3 as
sudo python3 setup.py install . and I thought I had won as it started its stuff but at the end it said it had errored and on checking python3s dist -packeges it still wasnt there .
but I thought I would give it a try
I stareted python3 up and did
import RPIO ; print(dir(RPIO))
and it gave me doc , loader ........etc
before all I got was "can only run on a raspberry pi"
so it appears to be working ( I think )

Don

@sanktnelson

This comment has been minimized.

Show comment
Hide comment
@sanktnelson

sanktnelson May 12, 2016

Hi all, I came here with the same problem. tried both versions from @tylerwoven and @limuxy and neither work on my raspberry 2. They both load fine, but add_channel_pulse does not seem to do anything, at least no change on the GPIO pin is visible. Any clues?

Hi all, I came here with the same problem. tried both versions from @tylerwoven and @limuxy and neither work on my raspberry 2. They both load fine, but add_channel_pulse does not seem to do anything, at least no change on the GPIO pin is visible. Any clues?

@VSkublin

This comment has been minimized.

Show comment
Hide comment
@VSkublin

VSkublin Apr 10, 2017

I have faced the same problem, this solution make it work:
First need to be sure that header files and static libraries for python dev. installed properly:
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
Then try to install RPIO branch v2, it will work with RPI3.
cd ~
git clone https://github.com/metachris/RPIO.git --branch v2 --single-branch
cd RPIO
sudo python setup.py install

This helped me to install RPIO for several RPI3s.

VSkublin commented Apr 10, 2017

I have faced the same problem, this solution make it work:
First need to be sure that header files and static libraries for python dev. installed properly:
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
Then try to install RPIO branch v2, it will work with RPI3.
cd ~
git clone https://github.com/metachris/RPIO.git --branch v2 --single-branch
cd RPIO
sudo python setup.py install

This helped me to install RPIO for several RPI3s.

@letroll

This comment has been minimized.

Show comment
Hide comment
@letroll

letroll Aug 15, 2018

same problem on archlinux arm 64bits because cpuinfo have no Hardware part in it's return so the system can't figure it's a raspberry pi

letroll commented Aug 15, 2018

same problem on archlinux arm 64bits because cpuinfo have no Hardware part in it's return so the system can't figure it's a raspberry pi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment