brata-hsdc / brata

Automatically exported from code.google.com/p/brata
2 stars 0 forks source link

Station application needs sudo for hardware access #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, accessing the GPIO pins requires root privileges, meaning the entire 
station application needs to run with elevated privileges.

It would be nice if this was eventually reworked to be done the "right" way so 
that the entire application wouldn't need to run with sudo.

Original issue reported on code.google.com by @jawaad-ahmad on 8 Oct 2014 at 1:17

GoogleCodeExporter commented 9 years ago
@ellerychan provided the following for CTS:

I also did this to avoid having to run the display programs with sudo all the 
time: 
sudo chmod o+rw /dev/i2c-1

Original comment by @jawaad-ahmad on 30 Oct 2014 at 1:02

GoogleCodeExporter commented 9 years ago

Original comment by @jawaad-ahmad on 2 Nov 2014 at 4:59

GoogleCodeExporter commented 9 years ago

Original comment by @jawaad-ahmad on 2 Nov 2014 at 5:02

GoogleCodeExporter commented 9 years ago
My previous suggestion to change the permission on the device (sudo chmod o+rw 
/dev/i2c-1) doesn't get preserved across reboots.  However, an easier solution 
is to add the user account to the same group as the device, since the 
permissions are rw-rw----.

So this command does the trick to give access to the display without sudo:
  gpasswd -a i2c

Original comment by @ellerychan on 11 Nov 2014 at 3:25

GoogleCodeExporter commented 9 years ago
Tried this and updated the GUB; however, it looks like pibrella is also being 
loaded, so need to address that as well. Found these but haven't had a chance 
yet to try them out:

http://dissectionbydavid.wordpress.com/2013/10/21/raspberry-pi-using-gpio-wiring
pi-without-root-sudo-access/
http://www.element14.com/community/thread/19995/l/anyone-know-how-to-access-rasp
i-gpio-without-sudo

Is there documentation anywhere telling which pins are used by the Pibrella?

Original comment by @jawaad-ahmad on 6 Dec 2014 at 4:26

GoogleCodeExporter commented 9 years ago
Typo.  The command to add the user (pi) to the i2c group should be:

  sudo gpasswd -a pi i2c

Follow with a reboot to get it to take effect.

  sudo reboot

Original comment by @ellerychan on 11 Dec 2014 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by @jawaad-ahmad on 18 Feb 2015 at 11:35

jawaad-ahmad commented 9 years ago

Continued on brata-hsdc/brata#10.