-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Error] Can't access Raspberry Pi 4 GPIO's in container without sudo #1297
Comments
Hi @DPaess the user inside the container does not have the same groups as outside |
I already tried that, inside the container we have ubuntu which uses dialout group to acess gpio pins but adding the user to this group is not solving the problem as you can see below: |
@DPaess is the problem persisting? One thing you should check is that the |
I'm trying to deploy a distrobox container in Raspberry Pi 4 with Raspberry Pi OS using a distrobox container with the following command:
distrobox-create --root --image docker.io/library/ros:humble-ros-base-jammy --name humbleV1 --home ~/containers/humbleV1
. Inside the container I make sure to install (or update) lgpio and gpiozero. I've set up a python script,teste.py, to test it which consists of simple 3 linesfrom gpiozero import LED \n led = LED(17) \n led.toggle()
. When I run this script withsudo teste.py
it works but when I don't use sudo it doesn't work, and I can't use sudo because I need to run this script via ROS2. Any ideias? I tried some flags of distrobox (unshare-process,unshare-netns,unshare-devsys) and messing with group access but it didn't work. The error is in the image bellow ( it sometimes runs another one that cant find pin factory but it changes to this after setting pin factory with the commandexport GPIOZERO_PIN_FACTORY=lgpio
)The text was updated successfully, but these errors were encountered: