(solved) I2c usage via python without sudo

#1

Hi
is there a way to use I2C
SMBUS
without Sudo via python in OSMC?

Thanks T

0 Likes

#2

Some udev rules may help.
Which /dev nodes are you using?

0 Likes

#3

Hi
for i2c

using /dev/i2c-1

self.bus = SMBus(self._port)

thanks

0 Likes

#4

You can change the permissions with a udev rule or run the script with privileges

Sam

0 Likes

#5

ok thanks will try

0 Likes

#6

sudo nano /lib/udev/rules.d/60-i2c-tools.rules
KERNEL==“i2c-0” , GROUP=“i2c”, MODE=“0660”
KERNEL==“i2c-[1-9]*”, GROUP=“i2c”, MODE=“0666”

is working
solved thx

0 Likes