Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5001

Python • Re: Python & Portainer

$
0
0
Looks like Homebridge is built on a version of RPI lite. You need to check if that bundle will run on RPI 5.

You need to ask on the Portainer forum about having access to GPIO pins. Why do you think you need to put it in a container? You will still have to make the changes for accessing the pins on RPI 5. If you want isolation use Python Virtual Environment which is the default for 5.
No need to ask Portainer.

You either tell the container how to access the gpio directly if running as a stand alone container or you add the equivalent to the docker compose file.

It's been a while, but there are 2 ways of doing this too. The first is to run the container with root access and using --privileged which not exactly good. The other is to be more specific with the container's docker file/docker compose file so that it uses a different user id and still have the access to gpio. This would involve making sure the group gpio exists in the container, uses the same gid too and grant that to the user the container is running as.

I'll see if I can dig up how exactly I did this way back when.

Here are some links to get the more adventurous readers going in case I can't find what I did.

https://discourse.mozilla.org/t/docker- ... ns/58872/2
https://stackoverflow.com/questions/649 ... -in-docker
https://www.reddit.com/r/docker/comment ... container/
https://stackoverflow.com/questions/300 ... -gpio-pins
https://forums.docker.com/t/missing-r-w ... ins/139429

May be as easy as running the container as uid/gid as a user in the container host that has access to the gpio. Again, it's been a while.

Statistics: Posted by memjr — Tue Jul 30, 2024 6:08 pm



Viewing all articles
Browse latest Browse all 5001

Trending Articles