Raspberry Pi Zero W 2 Camera Support

I have been working on a project based on the RasPi Zero W for some time. It was generally working quite well. I moved the project over to using the Zero W 2 (pin compatible, so pretty easy). Everything has worked as originally, but i have been having trouble getting the camera up and functioning.

I believe I have:

  • The right DT Overlays
  • The right environment settings
  • The right installed packages

But I am running into a bug that looks very stimilar to this traceback found in this bug report.

I don’t understand the image packaging process that balena goes through well enough to know if the issues from bullseye have been pulled into BalenaOS, but I thought this might be a good place to ask.

Is anyone here using a Zero W 2 and able to use the picamera interface?

I don’t know which Docker Image you are using for your container, but chances are high that you did not pin it to the older Raspbian/Debian Buster version, rolled it out onto your new RPi Zero W 2 and it downloaded the latest Debian version during the build process (Bullseye). Beginning with Bullseye (the now current version), Raspberry Pi Foundation overhauled the complete Camera Subsystem in favor of libcamera. This means the library picamera and other tools (like raspicam, raspivid etc) do not work anymore - Raspberry Pi Documentation - Camera - so you will need to use a Buster image if you want your software to work with or rewrite your application.

Hello and thanks for the advice.
The additional rub that I am running into is that the 64bit version seems to be mutually incompatible with the buster picamera interface.

I am willing to use the openCV/ffmpeg stacks to do similar things (my needs are pretty simple), but as it stands, I can’t find a working example/permutation in the many I have tried to date.

Here is one broken example:

Your findings are correct. picamera is only supported in the legacy buster release with 32 bit.
The picamera stack will probably never be 64 bit compatible, now that it has been discontinued and is not worked on anymore (only libcamera) - so you will not be able to build it for 64 bit at all:

So the only thing you can do - and what I would advice would be to switch entirely to libcamera to be future proof. Otherwise you will run into issues some months or years from here when no security updates for buster will be provided anymore.