Balena Cam / Raspberry P - V4L: can't open camera

Noob here so please be gentle.

I’m trying to get my streaming camera project running. I’m using a RaspberryPI Zero W with a picam. I had the camera running on V4L and rasbian buster so I know that the hardware is working. Using tutorials I’ve switched to BalenaOS + Balenacam. However I am getting two errors at the moment and can’t seem to figure out how to fix this issue:

VIDEOIO ERROR: V4L: can’t open camera by index 0

Failed to open default camera. Exiting…

Thanks in advance.

Hi there. On the RaspberryPI you need to set a couple of config options to use the camera. You can find them here:

Let me know if that works for you.

Hey thanks for the response. So I think you’re talking about:


which I thought were both set via the fleet commands?

It all looks correct.

What version of balenaOS are you running? Is there any other app logs that might be useful? If you enable support access to the device and send us a link we can take a look and see what might the problem.

Hey @ereski I granted support for 1 day, I can grant for longer if needed!

Thank you

Hey @Polytrigon, I just sent a private message to you to ask for the UUID of this device so we could investigate further. Please reply to my private message when you have the chance.

Hi @Polytrigon,

After checking the configuration on the device that you granted us access to, I saw that the RESIN_HOST_CONFIG_gpu_mem is set to 16.
According to the balenaCam instructions you should delete that configuration variable and only leave the BALENA_HOST_CONFIG_gpu_mem_XXX ones defined.
Can you try that and check whether that fixes the VIDEOIO error?

Let me point you to that section of the balenaCam readme:

Kind regards,

I disabled the resin host gpu memory, doesn’t look like it fixed it.

Hi @Polytrigon,
After checking you device configuration I saw that RESIN_HOST_CONFIG_gpu_mem is set to 16.
As per the instructions of the balenaCam project, I would suggest you to try deleting that configuration variable and only leave the BALENA_HOST_CONFIG_gpu_mem_XXX variants defined and check whether that fixes the issue.

Let me point you to the balenaCam instructions that I mentioned above:

Kind regards,

Hi @Polytrigon,

can you re-enable support access for the device?

Best regards,

Hello again,

after going through a similar issue which you can find here: Slimdown balenaOS for smaller hosts . The solutions that I mention are the same, assuming that your pi zero is probably running balenaOS version 2.32. So if you downgrade libraspberrypi-bin and uncomment this line then balenaCam should work.

Kind Regards,