Closed thnk2wn closed 4 years ago
I'm assuming I need to adjust the creation of my container with potential volume mounts or Dockerfile steps like:
RUN apt-get install libraspberrypi-bin -y
RUN usermod -a -G video root
Not sure what all dependencies this library has for the camera in terms of file / directory access, permissions etc. to account for when running containerized but I can look at the source. From the error though it looks like it's just shelling out to another process rather than a direct embedded library calls so maybe going through Unosquare just for this one camera method call is overkill.
It appeared to be just shelling to raspistill
so I was able to make it work by adding ENV PATH="/opt/vc/bin:${PATH}"
to the Dockerfile
and adding -v /opt/vc/bin:/opt/vc/bin
to docker run
.
The complete docker run looks like below.
docker run \
--privileged \
-v /opt/vc/lib:/opt/vc/lib \
-v /opt/vc/bin:/opt/vc/bin \
-v /home/pi/camera-output:/home/pi/camera-output \
-d \
--name $name \
$username/$name:latest
Describe the bug Using
Pi.Init<BootstrapWiringPi>();
followed bybyte[] imageBytes = Pi.Camera.CaptureImageJpeg(1024, 768);
and I get the following error:To Reproduce Steps to reproduce the behavior:
Devices
section.Expected behavior Picture bytes to be obtained.
Screenshots If applicable, add screenshots to help explain your problem.
Devices
Additional context The camera is enabled and I was able to test it via
raspistill -o image.jpg
. Is there something else I have to install or configure on the device to use this? Ideas?