How to make Camarray hat work with latest Raspberry OS?

  1. Where did you get the camera module(s)?
    ArduCam 64MP Autofocus Quad-Camera Kit | MYBOTSHOP.DE, 374,95 €

  2. Model number of the product(s)?
    Four ArduCam 64Mp Autofocus cameras UC-923, M1305 S, 810 IMX written on board and chip
    SKU: MBS-SES-256
    GTIN: 0618455044205

  3. What hardware/platform were you working on?
    RPI 4, Compute Module 4

  4. Instructions you have followed. (link/manual/etc.)
    https://www.arducam.com/downloads/64mp-autofocus-quad-camera-kit.pdf

  5. Problems you were having?
    I have not been able to get the latest OS to detect cameras but the 01/28/2022 OS did detect cameras, i can see preview and shoot pictures. But this OS only detects all 4 cameras as 1 camera, would like to control them separately.

  6. The dmesg log from your hardware?
    pi@raspberrypi:~ $ dmesg | grep -E “imx477|imx219|arducam”
    [ 8.922032] arducam_64mp 0-001a: failed to read chip id 682, with error -5
    [ 8.935997] arducam_64mp: probe of 0-001a failed with error -5
    [ 8.949747] arducam_64mp 10-001a: Device found Arducam 64MP.
    [ 8.967236] arducam_64mp 10-001a: Consider updating driver arducam_64mp to match on endpoints

  7. Troubleshooting attempts you’ve made?
    I tried for serveral days with different guides and trial and error what to write to the /boot/config.txt on latest RPI OS but couldnt even get it to detect cameras at all, eventually flashed CM4 with OS version described in offical product pdf and was able to get something to work.

  8. What help do you need?
    I need help getting the cameras detected separately on this older os. and getting things to work on latest RPI OS.

This is my boot config:

Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

uncomment for composite PAL

#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

camera_auto_detect=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1
dtoverlay=arducam_64mp
dtoverlay=arducam_64mp,cam0

[all]
dtoverlay=vc4-kms-v3d,cma-512

[pi4]

Run as fast as firmware / board allows

arm_boost=1

[all]
dtoverlay=arducam_64mp

This is my System _related info:
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL=
SUPPORT_URL=“”
BUG_REPORT_URL="
pi@raspberrypi:~ $ cat /proc/meminfo
MemTotal: 1916712 kB
MemFree: 1273260 kB
MemAvailable: 1563044 kB
Buffers: 20160 kB
Cached: 410588 kB
SwapCached: 0 kB
Active: 87396 kB
Inactive: 393524 kB
Active(anon): 776 kB
Inactive(anon): 125468 kB
Active(file): 86620 kB
Inactive(file): 268056 kB
Unevictable: 65128 kB
Mlocked: 16 kB
HighTotal: 1232896 kB
HighFree: 692104 kB
LowTotal: 683816 kB
LowFree: 581156 kB
SwapTotal: 102396 kB
SwapFree: 102396 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 115356 kB
Mapped: 138920 kB
Shmem: 76072 kB
KReclaimable: 16568 kB
Slab: 37400 kB
SReclaimable: 16568 kB
SUnreclaim: 20832 kB
KernelStack: 2000 kB
PageTables: 4856 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1060752 kB
Committed_AS: 1158072 kB
VmallocTotal: 245760 kB
VmallocUsed: 5868 kB
VmallocChunk: 0 kB
Percpu: 576 kB
CmaTotal: 524288 kB
CmaFree: 480908 kB
pi@raspberrypi:~ $ cat /boot/config.txt

For more options and information see

Some settings may impact device functionality. See link above for details

uncomment if you get no picture on HDMI for a default “safe” mode

#hdmi_safe=1

uncomment the following to adjust overscan. Use positive numbers if console

goes off screen, and negative if there is too much border

#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

uncomment to force a console size. By default it will be display’s size minus

overscan.

#framebuffer_width=1280
#framebuffer_height=720

uncomment if hdmi display is not detected and composite is being output

#hdmi_force_hotplug=1

uncomment to force a specific HDMI mode (this will force VGA)

#hdmi_group=1
#hdmi_mode=1

uncomment to force a HDMI mode rather than DVI. This can make audio work in

DMT (computer monitor) modes

#hdmi_drive=2

uncomment to increase signal to HDMI, if you have interference, blanking, or

no display

#config_hdmi_boost=4

uncomment for composite PAL

#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

camera_auto_detect=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1
dtoverlay=arducam_64mp
dtoverlay=arducam_64mp,cam0

[all]
dtoverlay=vc4-kms-v3d,cma-512

[pi4]

Run as fast as firmware / board allows

arm_boost=1

[all]
dtoverlay=arducam_64mp
pi@raspberrypi:~ $ dmesg | grep -E “imx477|imx219|arducam”
[ 8.922032] arducam_64mp 0-001a: failed to read chip id 682, with error -5
[ 8.935997] arducam_64mp: probe of 0-001a failed with error -5
[ 8.949747] arducam_64mp 10-001a: Device found Arducam 64MP.
[ 8.967236] arducam_64mp 10-001a: Consider updating driver arducam_64mp to match on endpoints
pi@raspberrypi:~ $

This is a log i made to explain what i have done:
Hardware:
RPI4
Compute Module 4 (Arducam UC-512 Rev.D1)
Four ArduCam 64Mp Autofocus cameras UC-923, M1305 S, 810 IMX written on board and chip
SKU: MBS-SES-256
GTIN: 0618455044205

Software:
raspios bullseye
kernel 5.10.96-v7l+

  1. Flashed 01/28/2022 OS from raspery website
    the same version that was used for the guide
  2. Connected 4 cameras to hat and connected the hat to RPI4, CAM0
  3. Booted, DID NOT make RPI update
  4. Enabled SSH with raspi-config just in case
  5. Installed gnome-screenshot after which mouse and keybaord stopped working so i used ssh
  6. Followed the guide
    until
    pi@raspberrypi:~ $ libcamera-still --list-cameras
    No cameras available!

After boot
pi@raspberrypi:~ $ libcamera-still --list-cameras
No cameras available!

After connecting hat to CAM1 and disconnecting USB hub to connect mouse and keyboard so i can use them then rebooting software was able to detect 1 camera.

pi@raspberrypi:~ $ dmesg | grep arducam
[ 8.169458] arducam_64mp: loading out-of-tree module taints kernel.
[ 8.182665] arducam_64mp 0-001a: failed to read chip id 682, with error -5
[ 8.184122] arducam_64mp: probe of 0-001a failed with error -5
[ 8.197400] arducam_64mp 10-001a: Device found Arducam 64MP.
[ 8.198083] arducam_64mp 10-001a: Consider updating driver arducam_64mp to match on endpoints
pi@raspberrypi:~ $ libcamera-still --list-cameras
No cameras available!
pi@raspberrypi:~ $ raspistill
ERROR: the system should be configured for the legacy camera stack
pi@raspberrypi:~ $ raspi-still
-bash: raspi-still: command not found
pi@raspberrypi:~ $ ls /dev/video*
/dev/video0 /dev/video10 /dev/video12 /dev/video14 /dev/video16 /dev/video20 /dev/video22
/dev/video1 /dev/video11 /dev/video13 /dev/video15 /dev/video18 /dev/video21 /dev/video23
pi@raspberrypi:~ $

It only shows one camera detected but when i launch preview I can see preview of all 4 cameras.
libcamera-still -t 0 --viewfinder-width 2312 --viewfinder-height 1736

@henri

The design purpose of hat is that multiple cameras work at the same time, and one device node is divided into four channels.

https://docs.arducam.com/Raspberry-Pi-Camera/Multi-Camera-CamArray/Multi-Camera-CamArray/

ok, tx. could you reccommend me some other high resolution cameras or hats or camera adapters that i could use the same cameras with so i can control cameras separately? or do you know if it is possible to connect these same cameras directly into RPI 4 with different cable since there are 2 camera ports on RPI4, CAM0 and CAM1? actually i only need 2 cameras not 4 and main purpose is to capture pictures.

@henri

You can look at this:
https://docs.arducam.com/Raspberry-Pi-Camera/Multi-Camera-CamArray/Quick-Start-Guide-for-Multi-Adapter-Board/

This board supports you to connect different cameras and can be used alone.

However, it needs to be reminded that only one camera can be used, and two cameras cannot be opened at the same time.

The cameras all share video0, the main principle is the multiplexer driver, after all the Raspberry Pi only has one camera interface, which is also a limitation of the hardware itself.

If you want to run two cameras at the same time and turn them on at the same time, the Raspberry Pi also has a cm4 option.

Tx, I managed to fix my issue by connecting the hat to CAM0 on RPI4. From CAM0 the ic2 commands work so i can just use
ic2set commands to use each camera separately.

@henri

Glad to hear that