Accessing gpio without using sudo su
Hello, I would like to ask how can i access gpio,I2C without using sudo su? Thanks Kt
Hello,
I would like to ask how can i access gpio,I2C without using sudo su?

Thanks
Kt

#1
Posted 07/17/2015 12:22 PM   
I don't know the incantation for gpio, but for I2C: By default, I2C devices are owned by root. To change this, create a file /etc/udev/rules.d/90-i2c.rules and add the line: sudo gedit /etc/udev/rules.d/90-i2c.rules [code]KERNEL==”i2c-[0-7]”,MODE=”0666″[/code] As an alternative, you can do this straight from a command line: [code]$ sudo bash -c ‘echo \”KERNEL==\”i2c-[0-7]\”,MODE=\”0666\”\” > /etc/udev/rules.d/90-i2c.rules’[/code]
I don't know the incantation for gpio, but for I2C:

By default, I2C devices are owned by root. To change this, create a file /etc/udev/rules.d/90-i2c.rules and add the line:

sudo gedit /etc/udev/rules.d/90-i2c.rules

KERNEL==”i2c-[0-7]”,MODE=”0666″



As an alternative, you can do this straight from a command line:

$ sudo bash -c ‘echo \”KERNEL==\”i2c-[0-7]\”,MODE=\”0666\”\” > /etc/udev/rules.d/90-i2c.rules’

jetsonhacks.com

#2
Posted 07/17/2015 04:07 PM   
Thank you @Kangalow I managed to access I2C without using sudo su. For accessing the GPIO, how can I add the new rules with the different owner? In beaglebone I manged to get this done by following this person named molloyd. In his tutorial he added new rules as follow: [code]KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chown -R molloyd:users /sys/class/gpio'" KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chown -R molloyd:users /sys/devices/virtual/gpio'"[/code] How can I do the same in Jetson Tk1? Thank you
Thank you @Kangalow
I managed to access I2C without using sudo su. For accessing the GPIO, how can I add the new rules with the different owner?
In beaglebone I manged to get this done by following this person named molloyd. In his tutorial he added new rules as follow:

KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c
'chown -R molloyd:users /sys/class/gpio'"
KERNEL=="gpio*", SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c
'chown -R molloyd:users /sys/devices/virtual/gpio'"



How can I do the same in Jetson Tk1?

Thank you

#3
Posted 07/18/2015 03:24 PM   
Scroll To Top

Add Reply