Balena Octoprint not connecting to pi camera

Hi,
I’m trying to get a pi camera working with balena-octoprint. I’ve changed the gpu memory and start_x to the right values stated in the balena docs to connect the pi camera.

The command “vcgencmd get_camera” is returning “supported=1 detected=1” but I don’t know how to get the octoprint to use the camera.

I deployed this repository for my application:

I notice there is someone asking about connecting a pi camera in the issues tab of that repository.

Can anyone direct me to my next steps?

Thanks,
Gregor

Hi Gregor, I don’t have a 3D printer, so I haven’t tried this repo / project, but I do have a quick question…what purpose does a camera serve in a 3D-printer project? I am just curious.

I assume its to keep an eye on the printer from a remote location, is that correct?

And thus, being that I don’t have a printer and haven’t tried, I’m not entirely sure, but do you need to flip this to true in the repo and re-deploy, perhaps: https://github.com/balenalabs-incubator/balena-octoprint/blob/master/octoprint/config.yaml#L3

By using a camera you can observe the progress of the print and intervene if something goes wrong. Very practical.

Thanks for the replies, I changed to the Full version of Balena Octoprint in the hopes it would solve my issue. https://github.com/MatthewCroughan/octobalena

It adds a lot of extra features, which have been working well.

So far I have not been able to get it working with the camera. However, I will check the config file in this repository and see if that could be the solution.

Edit: I have now checked and this is the config file for this new repo:
image

I’ll keep trying and if I get it working I’ll reply back here.

Thanks,
Gregor

Do you need to set these variables, perhaps? https://github.com/MatthewCroughan/octobalena#octoprint-service-variables

Hi @dtischler,

Yeah, I set the variables. However, I’m not convinced that my CAMERA_DEV = /dev/video0 is right as I’m not sure how to check which device the camera module is attached to.

Thanks,
Gregor

Hi Gregor

Can you open a shell in your container and check if the device exists ? Something like ls -lh /dev/video0.

Hi @zvin

I ran this command and got the following:

crw-rw---- 1 root 44 81, 7 Dec 4 20:50 /dev/video0

If I run ls -lh /dev/ I get a massive list including many video(n) devices.

Thanks,
Gregor

Hi Gregor I’ve just been testing Octobalena here and couldn’t get the webcam working either - I’d recommend adding an issue to the repo to ask the maintainers; I know it’s worked out of the box for me in the past, and it shouldn’t be this difficult. Perhaps something has broken within the project or maybe there’s some incompatibility with the latest OS.

Hi,

Thanks for the reply. That’s a shame that there isn’t an easy fix. I posted an issue on the GitHub page about a week ago regarding this, so hopefully, the maintainers will see it.

Once I get a solution, I’ll update this post with the details.

Thanks for your help,
Gregor

Thank you Gregor, please let us know