I'm using the Raspbian (a distribution made for Raspberry Pi, which is based on Debian).
I have some scripts that use i2c.
Normally only root has read and write permissions for i2c.
I'm using this command to add i2c r/w permissions for normal user:
# chmod a+rw /dev/i2c-*
However after reboot, these devices have their default permissions.
What is the best way to make my i2c available for r/w for a normal user permanently?
Is there a more "elegant" way than adding my script to init.d that runs the command above after my Raspberry Pi boots?
.rules
suffix. The files are processed in lexicographical order (i.e., the same as you'd get withls -1
), which is why numbers are used at the beginning, but that's not required. I don't know what takes precedence (rules read first or rules read last) in the case of some kind of conflict -- but you don't need to worry about that in this case. Just make sure the file name is unique, sinceman udev
says "files with identical filenames replace each other". – goldilocks Jul 30 '14 at 22:38