-
Notifications
You must be signed in to change notification settings - Fork 228
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
Make vcgencmd and PiSupport bundled plugin work on RaspberryPi hosts #207
Comments
for raspberry pi 4 32-bit I had to set up following volumes: |
For those running DietPi on a RPI3B+ 64bit, this is a working setup: version: '3.8'
services:
octoprint:
image: octoprint/octoprint:1.8.1
restart: unless-stopped
privileged: true
ports:
- 80:80
volumes:
- octoprint:/octoprint
- /usr/bin/vcgencmd:/usr/bin/vcgencmd
- /usr/lib/arm-linux-gnueabihf/libvcos.so.0:/usr/lib/arm-linux-gnueabihf/libvcos.so.0
- /usr/lib/arm-linux-gnueabihf/libvchiq_arm.so.0:/usr/lib/arm-linux-gnueabihf/libvchiq_arm.so.0
logging:
options:
max-size: "10m"
volumes:
octoprint: This has a pre-existing octoprint volume which you create simply like -- Edit I also added root to the video group on the host, I don't know if this is mandatory or not but I did it anyways. |
Thank you for sharing Caroga, your solution worked for me. vcgencmd now works and now warnings reported on this issue. I am running a Raspi 4B with bullseye.
|
Hi I'm running Octoprint 1.86.1 on an Rpi4 in a docker container. Ubuntu 22.0.4.2 LTS. /usr/bin/vcgencmd: /usr/bin/vcgencmd But I get the following errors in Octoprint log: vgencmd get_throttled works fine if I run it on the host. Any idea how to fix this? |
I'm also running octoprint in Docker on Ubuntu 22.04.2 LTS. After bind mounting
It looks like the issue is different versions of libc used by Raspbian/Debian vs. Ubuntu. Looking at all the libraries that
At this point the only "viable" option I see is reflashing using Raspbian/RaspberryPiOS instead of Ubuntu and use the bind mount. Not THAT much of a problem since I'm mounting Unless perhaps someone has a statically-linked version of |
Here's the process to get |
I ended up flashing Raspbian Buster. I wanted the version to be the same as the one in the Docker image to prevent .so version issues. My main gripe is that it's 32-bit only (which, now that I think about it, might have been the issue with Ubuntu) This is my
Everything else is commented out. I set With this, |
i don't believe this works anymore for Bookworm release. Can anyone else confirm that too |
I'm seeing the opposite - still working. On a 4GB Raspberry Pi 4 Model B Rev 1.1 running Debian GNU/Linux 12 (bookworm) installed from:
Fetch temperature:
Script with a few calls to other
Running that script:
Or fetching the amount of RAM:
I think the basic |
hmm ok. Unless i'm forwarding the wrong files from the host to the container. I'm running 32bit.
|
Well, to be clear:
|
have you tried using bind with source / destination for single files in docker? I could try going to 64bit but i was avoiding that due to the nature of not wanting to deal with other non-supported 64 bit stuff. |
No. But I will keep that in mind for next time. Up until now I have had two workarounds. Wherever possible I use folders. If I can't and a file is essential, I make sure to tag it |
That actually works quite well. I will put that on my to-do list over at IOTstack to revisit the remaining file mappings in the various service definition templates and swap those over. Thanks! |
Is your feature request related to a problem? Please describe.
When using Octoprint-docker on a RPi, the bundled Plugin PiSupport doesn't load because it doesn't detect a RasperryPi. This means there will be no warning about undervoltage, throttling etc.
Describe the solution you'd like
Add information to the docs how to get the plugin and detection to work or integrate a solution that makes this "workaround" unnecessary.
Possible Solution
add to docker-compose.yml:
With the privileged setting active, octoprint is able to determine the host as a Pi and enable the plugin. Adding the 3 other mounts gives it access to vcgencm (which doesn't work without privileged as well).
The paths for the files are only valid for aarch64, unsure where exactly they are on the 32 bit version of rpi os (google results suggest /opt/vc/lib and /opt/vc/bin)
Other options
Maybe integrate vcgencmd into the image directly to avoid privilege setting or find a way without privileged mode.
Google results suggest that adding/installing raspberrypi packages can do the trick (example: "RUN apk add raspberrypi" in Dockerfile which adds rpi support to alpine images).
Additional context
The privilege mode might not be desirable. Cap_add SYS_ADMIN is not enough.
The text was updated successfully, but these errors were encountered: