Quad Camera B0388 Focus

  1. Where did you get the camera module(s)?
    Arducam

  2. Model number of the product(s)?
    B0388

  3. What hardware/platform were you working on?
    Raspberry Pi

  4. Instructions you have followed. (link/manual/etc.)
    Arducam quickstart page

  5. Problems you were having?
    Setting focus

  6. The dmesg log from your hardware?

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?

I’m trying to setup my quad camera so that each camera has a different focus and them I’m takeing a syhcronous image. I’ve tried setting each camera to single mode using an i2c command, setting the focus of the camera and moving ot the next camera. Then when I have finished I’m setting the mode to quad cam and taking an image but it doesn’t seem to store the focus between switching to different modes. I’ve tried both starting and stopping the picamera instance and not doing so. This is my code:

from picamera2 import Picamera2
from smbus2 import SMBus
import time

quad = 4
camera = (0x02, 0x12, 0x22, 0x32, 0x00)
focus = (0.0, 2.5, 5.0, 10.0)
bus = SMBus(11)

def select_camera(number):
bus.write_byte_data(0x24, 0x24, camera[number])

for cam_num in range(4):
select_camera(cam_num)
time.sleep(1)
picam2 = Picamera2(0)
picam2.start()
picam2.set_controls({“AfMode”: 0, “LensPosition”: focus[cam_num]})

picam2.stop()
picam2.close()

select_camera(quad)
picam2 = Picamera2(0)
picam2.start()
picam2.capture_file(“image.png”)
picam2.stop()
picam2.close()

Is there a low level way of achieving this with i2c calls; preferably without needing to stop and start picamera. I’m doing this because I need to set a very fine focus with the system.

Thanks.

Regards,

Neil