Granting I2C Device Permissions Using Group i2c

The original method for graning I2C device permissions relied on group i2c. The instructions for using group i2c are retained for reference.

On Debian, Ubuntu, and likely other Debian derived distributions, most of the work has already been done. Package ddcutil requires package i2c-tools. Installation of package i2c-tools creates group i2c (if it does not alreay exist), and assigns that group to the /dev/i2c devices using a udev rule.

All that is necessary is to add users who will use ddcutil to group i2c:

$ sudo usermod <user-name> -aG i2c

On other than Debian derived distributions, additional steps may be necessary.

If group i2c does not already exist, the following command will create it:

$ sudo groupadd --system i2c

Then add your userid to group i2c as above.

A sample udev rule for giving group i2c RW permission on the /dev/i2c devices can be found in distributed file 45-ddcutil-i2c.rules. Its exact location varies by distribution, but commonly the file is found in directory /usr/share/ddcutil/data. The file can be copied to /etc/udev/rules.d, but do check that this rule does not conflict with others in that directory.

$ sudo cp /usr/share/ddcutil/data/45-ddcutil-i2c.rules /etc/udev/rules.d

For testing, it may be simpler to give everyone permission to write to /dev/i2c-* for the current boot:

$ sudo chmod a+rw /dev/i2c-*