0

I've followed the instructions in the answers on GPIO/RPIO. I still get the following error:

Traceback (most recent call last):
  File "/home/pi/Documents/Python_Ed/RPIO_server_test.py", line 1, in <module>
    from RPIO import PWM
  File "/usr/local/lib/python3.4/dist-packages/RPIO-2.0.0_beta1-py3.4-linux-armv7l.egg/RPIO/__init__.py", line 115, in <module>
    import RPIO._GPIO as _GPIO
RuntimeError: No access to /dev/mem. Try running as root!

My program is as follows:

from RPIO import PWM

servo = PWM.Servo()

# Set servo on GPIO17 to 1200µs (1.2ms)
servo.set_servo(17, 1200)

# Set servo on GPIO17 to 2000µs (2.0ms)
servo.set_servo(17, 2000)

# Clear servo on GPIO17
servo.stop_servo(17)

This is on Python 3.4.2 on a Raspberry Pi 3 Model B v1.2.

This is result on Python 2.7.9:

Traceback (most recent call last):
  File "/home/pi/Documents/Python_Ed/RPIO_server_test2.7.py", line 1, in <module>
    from RPIO import PWM
  File "build/bdist.linux-armv7l/egg/RPIO/__init__.py", line 115, in <module>
  File "build/bdist.linux-armv7l/egg/RPIO/_GPIO.py", line 7, in <module>
  File "build/bdist.linux-armv7l/egg/RPIO/_GPIO.py", line 6, in __bootstrap__
RuntimeError: No access to /dev/mem. Try running as root!

Any ideas?

3
  • I also tried from command line. and I get ioctl_set_msg failed: -1. BTW, I am kinda a newbie. Jan 12 '18 at 0:27
  • 1
    "Try running as root!"
    – Milliways
    Jan 12 '18 at 0:50
  • I suspect you are not following the instructions. As @Milliways points out the error message also tells you what to try.
    – joan
    Jan 12 '18 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.