In order to change between CAM/DIS you can follow these instructions - https://www.balena.io/fin/1.1/docs/developers/#Dual-camera-mode. You need to replace the dt-blob.bin file in the root directory of the fin, with the one provided in the link, when mounting the boot partition.
You can remove the plastic sticker on top of the switch; the CAM/DSI requires a physical toggling of the switch to set the desired mode. Please ensure that your device is powered off when you do this as performing this action whilst powered on may damage the device.
For now, I am trying to look for / learn to write an app to run on balenaOS/balenaFin that enables both CAM0&1 with python and opencv as that is my end goal.
Have you installed the RPi foundations usbboot drivers? You can find instructions for the same here.
I think that’s the step that missing. Please let me know if that works
Also, I just realised that Etcher should have prompted you to install the drivers.
Did that happen already? Or did you not get that prompt? If so it might be an issue with your Etcher and please let me know the version of your Etcher that you are running
Switched cv2.VideoCapture(0) in server.py to cv2.VideoCapture(1) to get the feed of the second camera. I also changed the Fleet Configuration. Got the following output:
balena-cam select timeout
balena-cam VIDIOC_DQBUF: Resource temporarily unavailable
balena-cam Failed to open default camera. Exiting…
balena-cam Video device is ready
balena-cam select timeout
balena-cam VIDIOC_DQBUF: Resource temporarily unavailable
balena-cam Failed to open default camera. Exiting…
Service exited ‘balena-cam’
Restarting service ‘balena-cam’
Note: changing to cv2.VideoCapture(-1) as was suggested on some stack exchange posts gives me CAM0 feed. So not successful in getting CAM1 feed so far.
Another note: perhaps it would be a good idea for balena-cloud to have an option asking if the user wants the second cam enabled and then download an already configured balenaOS image.
Have you followed the steps given here for enabling the dual camera mode? You can’t do it with the default device tree file that comes with the balenaOS image. So changing the dtbo is necessary.
To do that you can mount the fin as a storage device and then make the required changes (i.e. replace the dtbo file with the one linked in the above link). It is not just about drivers, but also about what each pin is configured to do. You will also have to toggle the switch that is there on the bottom of the fin (See documentation link above).
Once you do all of this, you should be able to use 2 cameras together. To come back to your other question - have you been able to mount the fin as a storage yet? I see that you have installed the drivers through the prompt that Etcher gave you.
If not, we have to first fix that so that we can move on to the dual cameras bit.
Yes. I did all that. If by dtbo file you mean ‘dt-blob.bin’ then yes. I also toggled the switch. I haven’t been able to mount the fin as storage so I edited the img file before flashing. I followed all the steps in your link.
Okay - this should definitely not be happening then.
Can you share your dockerfile as well as your code? You can share the barebones part that deals with the camera. No need to share the entire application
If possible, please share support access to the device from balenaCloud so that I can take a better look at it. Once you enable support access, share the UUID of the device as a direct message to me so that I can take a closer look at the application.
Hi
I am trying to check the device, but looks like the support access has been disabled. Can you reenable it and ensure that cameras are connected to the cam0 and cam1 ports?
I checked the device again right now - was able to see the device on the dashboard but it’s coming up as offline. Can you check if it’s powered on and if so it is connected to the Internet?
We’ve checked and you have the dt-blob.bin file. Both cams are also coming up when we run dmesg. Can you switch to a public url and confirm that both cams are working now?
Yes. It is working fine with CAM0. Switching to CAM1 gets this:
Restarting service ‘balena-cam sha256:’
Video device is not ready
Trying to load bcm2835-v4l2 driver…
Video device is not ready
Trying to load bcm2835-v4l2 driver…
Service exited 'balena-cam sha256:’
Restarting service ‘balena-cam sha256:*****************************************’