golemparts/rppal

Permission denied on "/dev/gpiomem"

Opened this issue · 8 comments

This is a new error I am just starting to get:

thread 'tokio-runtime-worker' panicked at src/hardware_subscription.rs:150:22:
called `Result::unwrap()` on an `Err` value: Permission denied: /dev/gpiomem

The only thing I can think of that has changed is that I updated a lot of packages on Pi OS recently.

uname -a
Linux rpi400 6.6.58-v8+ #1809 SMP PREEMPT Wed Oct 23 11:53:53 BST 2024 aarch64 GNU/Linux

I'll try and track down the exact call and add it here.

Confirmed that running as root avoids the problem.

Make sure /dev/gpiomem has rw permissions set for the gpio group, and the user you're logged in with is part of the gpio group. It looks like you may be running a different distro, which can cause issues. I suggest installing a fresh image of the latest stable Raspberry Pi OS release.

I'll check those things and get back to you.

It worked fine before on this machine without changing any permissions..., with same distro/install.

All I did is update all packages....maybe that changed something...

@andrewdavidmackenzie were you able to resolve this issue?

No, I assume it is a distro issue...and in my case an update changed the permissions...

Out of curiosity, what distro are you running? Would be good to know in case this pops up again.

Pi OS

uname -a
Linux rpi400 6.6.58-v8+ #1809 SMP PREEMPT Wed Oct 23 11:53:53 BST 2024 aarch64 GNU/Linux

Ah, I missed that you were using a stock Raspberry Pi OS. I would start with a clean install of the latest stable release as you seem to be using an older build. When you initially reported the issue I checked the latest release on a Pi 4 and didn't encounter this issue.

As this isn't a problem caused by RPPAL, and doesn't seem to be happening with the latest Raspberry Pi OS, there isn't much else I can suggest other than manually fixing the permissions if you're determined not to do a clean install. The official forum can give you better Linux support than I am able to.