ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
By default, yes, GPIO requires superuser, but you can easily change this by doing:
sudo su -
usermod -a -G gpio <youruser>
echo 'SUBSYSTEM==\"gpio*\", PROGRAM=\"/bin/sh -c 'chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio; chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio'\"' > /etc/udev/rules.d/99-com.rules
i.e. Add your user to the gpio group and then create a udev rule to automatically give that group permission to access the GPIO hardware.