Posts: 167
Joined: Tue Sep 11, 2012 2:07 pm
Location: Switzerland
Contact: Website

/dev/i2c-x permission

Wed Dec 19, 2012 6:58 pm

Evenin' (o;

What is the command to make changes to /dev/i2c-X persistent?

After every reboot the permission is reset to 660.
And adding user snmp to group i2c doesn't help either to use an external command reading i2c bus.

Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: /dev/i2c-x permission

Wed Dec 19, 2012 9:25 pm

http://www.reactivated.net/writing_udev ... #ownership

Udev controls the creation of /dev/ nodes each boot.

Udev rules also control what permissions etc they are created with - you can change the group to a suitable one or change permissions to allow read/write to everyone.

Posts: 56
Joined: Thu Nov 22, 2012 5:00 pm

Re: /dev/i2c-x permission

Thu Dec 20, 2012 5:09 am

This took a little searching as a noob to Linux for me to get this working. But here is what I did.

edited the 60-ic2-tools.rules file:

Code: Select all

   sudo nano /lib/udev/rules.d/60-i2c-tools.rules
I seperated out the i2c-0 so it remained MODE 0660, here are the two lines:

Code: Select all

KERNEL=="i2c-0"     , GROUP="i2c", MODE="0660"
KERNEL=="i2c-[1-9]*", GROUP="i2c", MODE="0666"
I rebooted, and the permissions changed to:

Code: Select all

crw-rw---T 1 root i2c 89, 0 Dec 19 21:01 /dev/i2c-0
crw-rw-rwT 1 root i2c 89, 1 Dec 19 21:01 /dev/i2c-1
As soon as I get back to my Raspberry Pi with an I2C device, I can confirm this.
Hope this helps.
NCR 310 - ZX81 - Apple II+ - Dell/Intel - Mac mini... Raspberry Pi!

Posts: 2
Joined: Fri Aug 29, 2014 11:57 am

Re: /dev/i2c-x permission

Fri Aug 29, 2014 12:09 pm

Thank you that worked on Pidora with a model B+

Return to “Troubleshooting”