Balena with camera on CM4


I am building a new project with a camera (v1-ov5647) and a CM4.

What I would like to do is:

  1. Take a picture using libcamera-jpeg
  2. Take a picture using picamera2

I managed to found several examples using Raspberry 3 online but I didn’t managed to make any of them work:

I also tried to manually install libcamera following Getting Started — libcamera without success.

@pmous Would you have any lead on how to proceed?

Thanks in advance.

1 Like

Hello @antoineschmider did you try this branch made by @alanb128 ?


Yes I did but I ended up with the same issue as Main branch does not build · Issue #111 · balena-labs-projects/balena-cam · GitHub.

@antoineschmider i will test later and i will let you know my results!

@mpous have you had a chance to look at it yet?

Hello @antoineschmider i tested myself with a Raspberry Pi 4 and these changes on the PR worked for me Fix balena cam by khancyr · Pull Request #97 · balena-labs-projects/balena-cam · GitHub

let me know if this works for your camera on CM4!

Hello @mpous,

Thanks I managed to make it work!

I see that we are using the image for Raspberry 3 instead of the one for CM4.

From my understanding this is because the camera code is compiled for 32bit devices, right?

What is the impact of using another devices image?

Indeed @antoineschmider this needs to run on 32bit container! However using balena, on a 64bit OS you can run 64bits and 32 bits containers in parallel without any problem!

What other device image would you like to use?

I am using the raspberrypicm4-ioboard-python image from balenalib in parallel and it works like a charm.

Thanks again for you support.

1 Like

Glad to read this @antoineschmider

Let us know if we can help you more!