GPIO - Raspberry Pi Forums
hello,
beginner in both python , raspberry pi. yesterday bought raspberry pi model b+. trying turn on , off led. wrote program using stani's python editor ide. showing error
gpio.setup(2,gpio,out)
runtime error: no access /dev/mem. try running root.
script terminated.
please tell me root cause of error. , mention how solve it.
thank you
joshy t r
beginner in both python , raspberry pi. yesterday bought raspberry pi model b+. trying turn on , off led. wrote program using stani's python editor ide. showing error
gpio.setup(2,gpio,out)
runtime error: no access /dev/mem. try running root.
script terminated.
please tell me root cause of error. , mention how solve it.
thank you
joshy t r
you using rpi.gpio python module requires root privileges. rpi.gpio accesses gpio via physical memory addresses. access physical memory need root privileges allows read other users data.
root privileges start script using sudo, e.g. rather ./script.py use sudo script.py, rather python script.py use sudo python script.py.
if using idle guess you'll have start idle root privileges, e.g. sudo idle.
root privileges start script using sudo, e.g. rather ./script.py use sudo script.py, rather python script.py use sudo python script.py.
if using idle guess you'll have start idle root privileges, e.g. sudo idle.
raspberrypi
Comments
Post a Comment