Open DPaess opened 8 months ago
Hi @DPaess
the user inside the container does not have the same groups as outside so you should add yourself to the same groups also inside, in this case, to access the GPIO
Hi @DPaess
the user inside the container does not have the same groups as outside so you should add yourself to the same groups also inside, in this case, to access the GPIO
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 dialout
group has the same GID both inside AND outside the container, then it should work
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
)