Troubles with reading my GPIO device

Yesterday I did the new upgrade to OSMC 2022-3 with Kodi 19.4. Everything worked fine (despite my “slightly” non standard osmc usecase running many non-kodi services).

But there was one exception: After the upgrade I could no longer access the GPIO ports of my raspi3 from within the smarthome environment fhem. The problem was triggered by the udev rule /etc/udev/rules.d/996-fix-gpiomem.rules which is in conflict with /lib/udev/rules.d/60-rpi.gpio-common.rules. The latter udev rule is part of the package rpi.gpio-common

After removing /etc/udev/rules.d/996-fix-gpiomem.rules GPIO access works again after reboot.

Additionally the user fhem should be member of group dialout. That membership was lost when I did my first osmc installation, but I didn’t notice that till today (because fhem to my surprise worked even if not member of group dialout). Does osmc installation change group memberships (aside from adding user osmc to some groups as necessary)?

My suggestion: Please do no longer provide 996-fix-gpiomem.rules. Instead either recomment to intall rpi.gpio-common or install it automatically (it contains only the 60-rpi.gpio-common.rules udev granting access to GPIO).

Regards, Michael

We don’t ship this package by default, so I’m not sure where it came from.
Our goal is to provide the correct GPIO rules for the standard OSMC installation, which I believe we are doing.

The package rpi.gpio-common seems to be a standard debian package to adjust the access rights of GPIO ports, see

And exactly that package did the trick for my raspi3 to get access onto GPIO ports without any additional changes. On the other side, using your fix udev rule did fail for me.

Thus my suggestion: instead of providing a special udev rule you could go with the standard debian package to fix GPIO access. The only thing that I know about this package is, that it is working fine for me and that it only installs one udev rule.

Regards, Michael

It does indeed seem to only install one rule:

/lib/udev/rules.d/60-rpi.gpio-common.rules
/usr/share/doc/rpi.gpio-common/README.Debian
/usr/share/doc/rpi.gpio-common/README.txt
/usr/share/doc/rpi.gpio-common/changelog.Debian.armhf.gz
/usr/share/doc/rpi.gpio-common/changelog.Debian.gz
/usr/share/doc/rpi.gpio-common/changelog.gz
/usr/share/doc/rpi.gpio-common/copyright

What was wrong with our rule to begin with that you decided to install this?

Cheers

Sam

I got error messages from my fhem installation

2022.02.13 11:24:19 1: PERL WARNING: Can't exec "export": Datei oder Verzeichnis nicht gefunden at ./FHEM/51_RPI_GPIO.pm line 647.

trying to tell me: “I’m unable to access the GPIO ports.” I had to modify your udev rule to contain

... chown -R root:osmc /sys/devices/virtual/*gpio* && chmod -R 770 /sys/devices/virtual/*gpio*; ...

i.e. I had to insert the four stars. And I had to add the user fhem into the group osmc. With the Debian package the “standard” group dialout is used being compatible with fhem. And I didn’t need to tweak the udev rule from Debian.

It was a longer “journey” for me to discover that simple solution. Of course I’m an ol’ UNIX user (using it for over 35 years), but udev is new to me.

Regards, Michael