Problems with IMX219 sensors and the CAMARRAY hat with Raspberry Pi 4B 4GB

I have been trying to set up the camarray hat to use with a Raspberry Pi 4B. I have followed all of the start up guides and have implemented the change in the boot/config.txt file so that it now looks like this:

# For more options and information see
# http://rpf.io/configtxt
# 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
start_x=1
camera_auto_detect=1
dtoverlay=imx219,vcm

# Automatically load overlays for detected DSI displays
display_auto_detect=1

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

# Run in 64-bit mode
arm_64bit=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

[all]

[pi4]
dtoverlay=vc4-fkms-v3d
# Run as fast as firmware / board allows
arm_boost=1

[all]
gpu_mem=256
[all]
dtoverlay=gpio-fan,gpiopin=14,temp=80000

But I have also tried this file with start_x=0 and with it commented out, as well as with camera_auto_detect=0 and commented out and with dtoverlay=imx219 commented out, and in every combination.

Running vcgencmd get_camera gives
supported=1 detected=0, libcamera interfaces=1

but running libcamera-hello --tuning-file=/usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Preview window unavailable
[0:08:06.572516364] [1951]  INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
[0:08:06.624435654] [1954]  WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[0:08:06.625343389] [1954]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media0 and ISP device /dev/media1
[0:08:06.625445386] [1954]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[0:08:06.626409861] [1951]  INFO Camera camera.cpp:1033 configuring streams: (0) 1640x1232-YUV420
[0:08:06.627019881] [1954]  INFO RPI vc4.cpp:572 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[0:08:06.628631950] [1954] ERROR V4L2 v4l2_device.cpp:353 'ad5398 focus': Unable to set controls: Remote I/O error
[0:08:07.702528396] [1954]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[14:cap]: Dequeue timer of 1000000.00us has expired!
[0:08:07.702691225] [1954] ERROR RPI pipeline_base.cpp:1356 Camera frontend has timed out!
[0:08:07.702735779] [1954] ERROR RPI pipeline_base.cpp:1357 Please check that your camera sensor connector is attached securely.
[0:08:07.702775760] [1954] ERROR RPI pipeline_base.cpp:1358 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!

I have also tried this directly on the raspberry pi, in which case it gives a completely black screen with the same error messages. I have obviously checked the cables and changed them over, as well as trying with different camera modules, but the result is always the same. I have two of these camarray hats, and they both behave in the same way.

Using libcamera-hello --list-cameras gives

Available cameras
-----------------
0 : imx219 [3280x2464 10-bit RGGB] (/base/soc/i2c0mux/i2c@1/imx219@10)
    Modes: 'SRGGB10_CSI2P' : 640x480 [103.33 fps - (1000, 752)/1280x960 crop]
                             1640x1232 [41.85 fps - (0, 0)/3280x2464 crop]
                             1920x1080 [47.57 fps - (680, 692)/1920x1080 crop]
                             3280x2464 [21.19 fps - (0, 0)/3280x2464 crop]
           'SRGGB8' : 640x480 [103.33 fps - (1000, 752)/1280x960 crop]
                      1640x1232 [41.85 fps - (0, 0)/3280x2464 crop]
                      1920x1080 [47.57 fps - (680, 692)/1920x1080 crop]
                      3280x2464 [21.19 fps - (0, 0)/3280x2464 crop]

I have checked the connections with i2cdetect -y 10 (which I was have seen is the one to check in other forums)

i2cdetect -y 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- UU -- -- --
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- 24 -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I have been trying for over 2 weeks to get these cameras and camarray hat to work, so any help would be much appreciated.

Please change ‘‘dtoverlay=imx219,vcm’’ to ‘‘dtoverlay=imx219’’, then reboot your Raspberry Pi to take effect. When it is starting, you need to run the command “libcamera-still -t 0” to access the camera rather than ‘‘libcamera-hello --tuning-file=/usr/share/libcamera/ipa/rpi/vc4/imx219_af.json’’

You followed the wrong guide which is for motorized imx219 sensor, not for imx219 camarray hat.

I have updated the boot file accordingly. Using libcamera-still -t 0 gives:

scottelli@BlueSwimmer:~ $ libcamera-still -t 0
Preview window unavailable
[0:01:05.311429701] [1010]  INFO Camera camera_manager.cpp:297 libcamera v0.0.0+ 4367-ad9428b4
[0:01:05.365697960] [1015]  WARN RPI vc4.cpp:390 Mismatch between Unicam and CamHelper for embedded data usage!
[0:01:05.366542905] [1015]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c 0mux/i2c@1/imx219@10 to Unicam device /dev/media2 and ISP device /dev/media1 [0:01:05.366601201] [1015]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[0:01:05.368412497] [1010]  INFO Camera camera.cpp:1033 configuring streams: (0)1640x1232-YUV420
[0:01:05.369097831] [1015]  INFO RPI vc4.cpp:572 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[0:01:06.475913478] [1015]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[13:cap]: Dequeue timer of 1000000.00us has expired!
[0:01:06.476017608] [1015] ERROR RPI pipeline_base.cpp:1356 Camera frontend has timed out!
[0:01:06.476040460] [1015] ERROR RPI pipeline_base.cpp:1357 Please check that your camera sensor connector is attached securely.
[0:01:06.476061163] [1015] ERROR RPI pipeline_base.cpp:1358 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!

This error then just repeats indefinitely.