adafruit / Adafruit-Raspberry-Pi-Python-Code

Adafruit library code for Raspberry Pi
1.43k stars 686 forks source link

adafruit_charLCD/RPI.GPIO RuntimeError: No access to /dev/mem. Try running as root! #138

Closed ghost closed 4 years ago

ghost commented 8 years ago

Hello ! that works with sudo, but how to use Adafruit_CharLCD as a regular user ? I tried "adduser pi kmem" and "chmod g+w /dev/mem" but no success thanks for your support Alban I use a raspberrypi B release2 512MB

my raspbian version is : Linux raspberrypi981acf 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l

my rpi.gpio version is : /usr/lib/python3/dist-packages/RPi/GPIO.cpython-32mu.so /usr/lib/python3/dist-packages/RPi.GPIO-0.5.11.egg-info /usr/lib/python2.7/dist-packages/RPi/GPIO.so /usr/lib/python2.7/dist-packages/RPi.GPIO-0.5.11.egg-info /usr/lib/python2.6/dist-packages/RPi/GPIO.so /usr/lib/python2.6/dist-packages/RPi.GPIO-0.5.11.egg-info

pi@raspberrypi981acf ~/Adafruit_Python_CharLCD/examples $ ./char_lcd.py Traceback (most recent call last): File "./char_lcd.py", line 36, in lcd_columns, lcd_rows, lcd_backlight) File "/usr/local/lib/python2.7/dist-packages/Adafruit_CharLCD-1.0.0-py2.7.egg/Adafruit_CharLCD/Adafruit_CharLCD.py", line 143, in init gpio.setup(pin, GPIO.OUT) File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-0.9.3-py2.7.egg/Adafruit_GPIO/GPIO.py", line 188, in setup pull_up_down=self._pud_mapping[pull_up_down]) RuntimeError: No access to /dev/mem. Try running as root!

ladyada commented 4 years ago

Thank you for the Issue! This library has been deprecated in favor of our python3 Blinka library. We have replaced all of the libraries that use this repo with CircuitPython libraries that are Python3 compatible, and support a wide variety of single board/linux computers!

Visit https://circuitpython.org/blinka for more information

CircuitPython has support for almost 200 different drivers, and a as well as FT232H support for Mac/Win/Linux!