Raspberry Pi 5 and Arducams

I recheck in the RP3 and the camera and motor are there…

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

but similar to the RP5 , when I remove the camera, RP3 is still reserving c00 … I’m confuse

i dont know then, only thing i can reccommend is to try everything from scratch, reflash and reinstall drivers/tools with the python scripts…
maybe try desktop instead of lite os this time and see what happens. if still not work u need to get help from arducam people

Henri’s original instructions will not work. /boot/config.txt is NOT read from on bookworm. They have a huge disclaimer telling you that /boot/firmware/config.txt is the one to modify. Any of these scripts that rely on /boot/config.txt are going to fail. Even accounting for this, I was unable to get the camera to work on bookworm for pi4.

I have several systems of RPi4s running newest bookworm taking photos with these Arducam64s

True Arducam does not seem to be too interested in providing a tried and tested workflow to make their cameras actually work on the RPis, but us folks in the forums have figured out our own hacks over the year.

I currently use this walkthrough i posted mixed with @henri 's suggestions

I have tried several times to get this to work, on a new Pi 5 8GB, with the latest OS.

I just re-did everything, and incorporated suggestions regarding .boot/config.txt and /boot/firmware/config.txt.

Here are the exact steps and results from my latest attempt:

Raspberry Pi 5 8GB
Flashed SD card with Bookworm 64bit
Released 2023-12-05
Accepted updates, then:
rob@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.0-rpi8-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

Enabled ssh and i2c
Set screen resolution to 2560x1440
Installed Gnome terminal
Rebooted

In /boot, as su:
rm config.txt
ln -s config.txt firmware/config.txt

Then in ~/ardocam00:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh
sudo ./install_pivariety_pkgs.sh -p libcamera_dev
sudo ./install_pivariety_pkgs.sh -p libcamera_apps
sudo apt -y update && sudo apt -y upgrade

added to end of /boot/firmware/config.txt:
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp

sudo reboot

Then:
rob@raspberrypi:~ $ libcamera-still --list-cameras
No cameras available!

From dmesg:
4.349192] dw9807 4-000c: I2C write CTL fail ret = -121
[ 4.359749] arducam_64mp 4-001a: chip id mismatch: 4136!=7b8c
[ 4.359945] dw9807 4-000c: I2C write STATUS address fail ret = -121
[ 4.359950] dw9807 4-000c: dw9807_ramp I2C failure: -121
[ 4.361119] dw9807 4-000c: I2C write STATUS address fail ret = -121
[ 4.361127] dw9807 4-000c: dw9807_ramp I2C failure: -121
[ 4.361267] dw9807 4-000c: I2C write CTL fail ret = -121
[ 4.361469] arducam_64mp: probe of 4-001a failed with error -5

“Set screen resolution to 2560x1440”
in my instructions i never tell you to do that.

  1. try using LITE OS version
  2. try specifing cameras
    [all]
    dtoverlay=vc4-kms-v3d,cma-512
    dtoverlay=arducam-64mp,cam0
    dtoverlay=arducam-64mp,cam1
  3. try this guys instruction flow Full Walkthrough: Setup RPI4 take 64mp photos and Control Focus

@henri
““Set screen resolution to 2560x1440”
in my instructions i never tell you to do that.”

True, but I don’t think that will impact anything. I included that step for completeness :slight_smile:

" * try this guys instruction flow Full Walkthrough: Setup RPI4 take 64mp photos and Control Focus"

I HAVE tried working through those instructions. It clearly is obsolete though; for example, there is no longer the ability to “enable legacy camera” in the config utility. And the directions for editing /boot/config.txt are clearly outdated; it is replaced by /boot/firmware/config.txt. I even tried deleting /boot/config.txt and replacing it with a symlink to /boot/firmware/config.txt in case scripts were trying to edit /boot/config.txt.

There other problems with those instructions, as well - for example:

rob@raspberrypi:~ $ sudo pip3 install numpy --upgrade
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
rob@raspberrypi:~ $ sudo apt install numpy --upgrade
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package numpy
rob@raspberrypi:~ $ sudo apt install numpy
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package numpy

And then there is chip id mismatch reported by dmesg:

rob@raspberrypi:~ $ dmesg | grep ardu
[ 4.408967] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@80000/arducam_64mp@1a
[ 4.487845] arducam_64mp 4-001a: chip id mismatch: 4136!=ff8c
[ 4.507047] arducam_64mp: probe of 4-001a failed with error -5

Also, there seem to be some differences between the Pi4 and the Pi5 regarding i2c layout. Sigh.
…I DID try the directions on a Pi4 as well as on a Pi5, BTW. And actually with two different 64mp camera modules.

I appreciate that you are trying to be helpful, and HAVE helped people in the past; but things clearly have evolved.

well my 64mp cameras work both on pi4 and pi5 bookworm. so i really dont know what is causing your problem, maybe the cameras are different.
post full contents of your /boot/firmware/config.txt

just try lite os and specifing camera

Below is /boot/firmware/config.txt, from the Pi4 (not 5). which I have just re-done from scratch. It was done using the 32bit version of Raspbian, installed on a card using the Imager app, which pulls the latest from the repo.

rob@raspberrypi:~ $ cat </boot/firmware/config.txt

For more options and information see

http://rptl.io/configtxt

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

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

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

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Additional overlays and parameters are documented

/boot/firmware/overlays/README

Automatically load overlays for detected cameras

camera_auto_detect=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Automatically load initramfs files, if found

auto_initramfs=1

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Don’t have the firmware create an initial video= setting in cmdline.txt.

Use the kernel’s default instead.

disable_fw_kms_setup=1

Disable compensation for displays with overscan

disable_overscan=1

Run as fast as firmware / board allows

arm_boost=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]

dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp,cam0
dtoverlay=arducam-64mp,cam1
dtoverlay=arducam-64mp

“well my 64mp cameras work both on pi4 and pi5 bookworm. so i really dont know what is causing your problem, maybe the cameras are different.”

How long ago did you do the install & config? Prior to 2023-11-24???

I am getting this sort of thing in dmesg from both a Pi4 and a Pi5, from two different 64mp camera modules:

dmesg | grep ardu
[ 10.477597] arducam_64mp 0-001a: failed to read chip id 4136, with error -5
[ 10.533975] arducam_64mp: probe of 0-001a failed with error -5
[ 10.641356] arducam_64mp 10-001a: chip id mismatch: 4136!=7b8c
[ 10.679437] arducam_64mp: probe of 10-001a failed with error -5

yeah it was probably before 2023-11-24


pi@pi5:~ $ dmesg | grep ardu
[    3.092821] rp1-cfe 1f00110000.csi: found subdevice /axi/pcie@120000/rp1/i2c@                                                     88000/arducam_64mp@1a
[    3.093658] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@                                                     80000/arducam_64mp@1a
[    3.701284] arducam_64mp 4-001a: Device found Arducam 64MP.
[    3.704511] rp1-cfe 1f00128000.csi: Using sensor arducam_64mp 4-001a for capt                                                     ure
[    3.755428] arducam_64mp 6-001a: Device found Arducam 64MP.
[    3.759765] rp1-cfe 1f00110000.csi: Using sensor arducam_64mp 6-001a for capt                                                     ure

this is my output

also i have

[all]
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp,cam0
dtoverlay=arducam-64mp,cam1

NOT

[all]
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp,cam0
dtoverlay=arducam-64mp,cam1
dtoverlay=arducam-64mp

“yeah it was probably before 2023-11-24”

There were changes made with the OS from that date that are significant, such as the config file - I also think that was when the lkegacy camera option was removed.

It seems quite likely to me that if you tried again with the current release you might run into some problems. I’d avoid upgrading the sd card(s).

There is an archive of earlier releases:
Index of /raspios_lite_armhf/images

Which release did you use? uname -a should tell the release date.

@henri
I downloaded and installed an older / archived version of Bookworm Lite: 2023-10-10-raspios-bookworm-armhf-lite.img.xz.

I then followed the instructions from above:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh 
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps

However, this happened when executing ./install_pivariety_pkgs.sh -p libcamera_apps:

rob@raspberrypi:~/arducam $ ./install_pivariety_pkgs.sh -p libcamera_apps
dpkg-query: no packages found matching raspberrypi-kernel
dpkg: error: --compare-versions takes three arguments:

Type dpkg --help for help about installing and deinstalling packages [*];
Use ‘apt’ or ‘aptitude’ for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through ‘less’ or ‘more’ !

Hardware Revision: d04170
Kernel Version: 6.1.0-rpi4-rpi-v8
OS Codename: bookworm
ARCH: aarch64

Set i2c
touch: cannot touch ‘/etc/modprobe.d/raspi-blacklist.conf’: Permission denied
sed: can’t read /etc/modprobe.d/raspi-blacklist.conf: No such file or directory
./install_pivariety_pkgs.sh: line 294: /etc/modules: Permission denied
DTOVERLAY[warn]: no matching platform found
kernel:6.1.0-rpi4-rpi-v8
kernel version is: 6.1.54
–2024-02-21 17:27:32-- https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/libcamera_apps_bookworm_links.txt
Resolving github.com (github.com)… 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/2da703d9-f8d9-4c7b-8909-eb9b1142f62c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240222%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240222T002732Z&X-Amz-Expires=300&X-Amz-Signature=66e81807087877711a8f955acbd3d9a3937b600b077442ff3ede1c1a6136d4b0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3Dlibcamera_apps_bookworm_links.txt&response-content-type=application%2Foctet-stream [following]
–2024-02-21 17:27:32-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/2da703d9-f8d9-4c7b-8909-eb9b1142f62c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240222%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240222T002732Z&X-Amz-Expires=300&X-Amz-Signature=66e81807087877711a8f955acbd3d9a3937b600b077442ff3ede1c1a6136d4b0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3Dlibcamera_apps_bookworm_links.txt&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)… 185.199.111.133, 185.199.108.133, 185.199.109.133, …
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1448 (1.4K) [application/octet-stream]
Saving to: ‘libcamera_apps_bookworm_links.txt’

libcamera_apps_bookworm_links 100%[=================================================>] 1.41K --.-KB/s in 0.003s

2024-02-21 17:27:32 (444 KB/s) - ‘libcamera_apps_bookworm_links.txt’ saved [1448/1448]

–2024-02-21 17:27:32-- https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/libcamera-apps-v0.0.5/rpicam-apps_1.4.3-2_armhf.deb
Resolving github.com (github.com)… 140.82.113.3
Connecting to github.com (github.com)|140.82.113.3|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/088cc651-80b0-4cc2-9dab-f6e512dfff13?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240222%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240222T002733Z&X-Amz-Expires=300&X-Amz-Signature=92dac91d729baa5e64d82ab09f752035c68f8cd8f9a92dbc2c701f220eaa278c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3Drpicam-apps_1.4.3-2_armhf.deb&response-content-type=application%2Foctet-stream [following]
–2024-02-21 17:27:33-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/088cc651-80b0-4cc2-9dab-f6e512dfff13?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240222%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240222T002733Z&X-Amz-Expires=300&X-Amz-Signature=92dac91d729baa5e64d82ab09f752035c68f8cd8f9a92dbc2c701f220eaa278c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3Drpicam-apps_1.4.3-2_armhf.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)… 185.199.110.133, 185.199.111.133, 185.199.108.133, …
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 317000 (310K) [application/octet-stream]
Saving to: ‘rpicam-apps_1.4.3-2_armhf.deb’

rpicam-apps_1.4.3-2_armhf.deb 100%[=================================================>] 309.57K --.-KB/s in 0.08s

2024-02-21 17:27:33 (3.74 MB/s) - ‘rpicam-apps_1.4.3-2_armhf.deb’ saved [317000/317000]

Hit:1 Index of /debian bookworm InRelease
Hit:2 Index of /raspbian bookworm InRelease
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
88 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Note, selecting ‘rpicam-apps’ instead of ‘./rpicam-apps_1.4.3-2_armhf.deb’
The following NEW packages will be installed:
rpicam-apps
0 upgraded, 1 newly installed, 0 to remove and 88 not upgraded.
Need to get 0 B/317 kB of archives.
After this operation, 1,448 kB of additional disk space will be used.
Get:1 /home/rob/arducam/rpicam-apps_1.4.3-2_armhf.deb rpicam-apps armhf 1.4.3-2 [317 kB]
Selecting previously unselected package rpicam-apps.
(Reading database … 77344 files and directories currently installed.)
Preparing to unpack …/rpicam-apps_1.4.3-2_armhf.deb …
Unpacking rpicam-apps (1.4.3-2) …
dpkg: error processing archive /home/rob/arducam/rpicam-apps_1.4.3-2_armhf.deb (–unpack):
trying to overwrite ‘/usr/bin/camera-bug-report’, which is also in package libcamera-apps-lite 1.2.1-1+bookworm+1
Errors were encountered while processing:
/home/rob/arducam/rpicam-apps_1.4.3-2_armhf.deb
N: Download is performed unsandboxed as root as file ‘/home/rob/arducam/rpicam-apps_1.4.3-2_armhf.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I re-did with sudo… and got the same error E: Sub-process /usr/bin/dpkg returned an error code (1)

from chatgpt:

It seems like there are some issues reported by the system regarding an Arducam 64MP camera. Here’s a breakdown of what each line means:

  1. [ 10.477597] arducam_64mp 0-001a: failed to read chip id 4136, with error -5: This line indicates that there was an attempt to read the chip ID of the Arducam 64MP camera with an address of 0-001a, but it failed with error code -5, which typically indicates an I/O error.
  2. [ 10.533975] arducam_64mp: probe of 0-001a failed with error -5: This line indicates that the probing (initialization) of the Arducam 64MP camera at address 0-001a failed with the same error code -5.
  3. [ 10.641356] arducam_64mp 10-001a: chip id mismatch: 4136!=7b8c: This line indicates that there’s a chip ID mismatch. The expected chip ID is 4136, but it’s reading 7b8c. This suggests that there might be a hardware or firmware issue with the camera.
  4. [ 10.679437] arducam_64mp: probe of 10-001a failed with error -5: This line indicates that the probing (initialization) of the Arducam 64MP camera at address 10-001a (which seems different from the previous address) failed with the same error code -5.

In summary, these messages suggest that the system is encountering errors while trying to communicate with the Arducam 64MP camera. This could be due to various reasons such as hardware issues, connection problems, or compatibility issues. You might want to double-check the connections, ensure the camera is properly configured, and consult the documentation or support resources for the Arducam camera for further troubleshooting.

@henri
hey henri, i have bookworm 64 bit downloaded on my rpi5, and followed your instructions. But I keep getting no camera available as shown in the pictures. I really frustrated as I’ve been fidgeting with this for over 6 hours now with no progress. I’d appreciate if you could help me with this. the ribbon cable is setup correctly. Black side facing power source on pi, and black side facing bottom of arducam on the other. Please help and let me know, thanks.

@henri
im using the 64 mp arducam. I am using bookworm 64 bit instead of bookworm lite. Do you think that is the problem?

@henri when i check the logs using “dmesg” i scrolled down and found this in rad:

[ 3.356847] arducam_64mp 4-001a: failed to read chip id 4136, with error -5
[ 3.357047] arducam_64mp: probe of 4-001a failed with error -5
[ 3.414787] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 3.424012] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

put more debug logs into driver source code and try to recompile it and see more precisely why it fails.

also make sure the cable is connected properly on the camera side. the metal parts have to be against the metal parts. u can kinda troulbeshoot if its a connection issue in such way that see if u get the same error if u completely disconnect the camera from RPI.

I think i have had same error during one year i have worked with rpi and arducams, i dont exactly remember how i fixed it but in the beginning i do remember that i connected the cable wrongly and then spent hours or days troubleshooting why the camera is not working.