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

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.


raspberrypi



Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support