Arducam 64mp PiCamera2 Not working

  1. Where did you get the camera module(s)?
    Arducam Kickstarter/Pre-order
  2. Model number of the product(s)?
    Arducam 64MP Camera
  3. What hardware/platform were you working on?
    Raspberry Pi Model 4 / Bullseye Release: 4/4/2022
  4. Instructions you have followed. (link/manual/etc.)
    How To Use Arducam 64MP Camera On Rapberry Pi - Arducam
    How To Use Arducam 64MP Camera On Rapberry Pi - Arducam
  5. Problems you were having?
    Camera install and initializes properly.
    dmesg | grep arducam checks out
    ls /dev/video0 returns /dev/video0
    dtoverlay=vc4-kms-v3d,cma-512 added to /boot/config.txt
    libcamera-still -t 0 returns preview window with image
  6. The dmesg log from your hardware?
    arducam_64mp 10-001a: Device found Arducam 64MP.
  7. Troubleshooting attempts you’ve made?
    Updating the system, which breaks camera drivers. Camera stops working after updating the Pi OS???
  8. What help do you need?
    I tried running simple py preview script:
    #!/usr/bin/python3

Normally the QtGlPreview implementation is recommended as it benefits

from GPU hardware acceleration.

import time
from picamera2 import Picamera2, Preview
picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)
preview_config = picam2.create_preview_configuration()
picam2.configure(preview_config)
picam2.start()
time.sleep(5)

I get this:
[0:12:43.535689593] [1872] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3730-67300b62
[0:12:43.541972436] [1873] WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for ‘arducam_64mp’
[0:12:43.542057676] [1873] WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[0:12:43.569298653] [1873] WARN RPI raspberrypi.cpp:1274 Mismatch between Unicam and CamHelper for embedded data usage!
[0:12:43.569856240] [1873] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:12:43.570106478] [1873] INFO RPI raspberrypi.cpp:1398 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media1
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python3.9/threading.py”, line 954, in _bootstrap_inner
self.run()
File “/usr/lib/python3.9/threading.py”, line 892, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.9/dist-packages/picamera2/previews/qt_previews.py”, line 22, in thread_func
self.qpicamera2 = self.make_picamera2_widget(picam2, width=self.width, height=self.height, transform=self.transform)
File “/usr/local/lib/python3.9/dist-packages/picamera2/previews/qt_previews.py”, line 74, in make_picamera2_widget
from picamera2.previews.qt import QGlPicamera2
File “/usr/local/lib/python3.9/dist-packages/picamera2/previews/qt.py”, line 1, in
from .q_gl_picamera2 import EglState, QGlPicamera2
File “/usr/local/lib/python3.9/dist-packages/picamera2/previews/q_gl_picamera2.py”, line 13, in
import OpenGL
ModuleNotFoundError: No module named ‘OpenGL’

@vmilanovic

Your python is missing the corresponding library.
3
you need

python3 -m pip install pyopengl

picamera needs a lot of dependencies, you can refer to the requirements they wrote

Hi Edward,
thanks for pointing it out. I did fresh installs and got PiCamera2 working fully with Pi cameras v1 and v2. Upon installing the Arducam 64MP drivers, I’ve got the next error:
AttributeError: type object ‘libcamera._libcamera.ColorSpace’ has no attribute ‘Sycc’

As this it the recent change in PiCamera2 and documented here:
https://github.com/raspberrypi/picamera2/issues/295

you might need to update the drivers to reflect the recent changes in libcamera

Thanks again!

@vmilanovic

Thanks for the info, this is very helpful, this is indeed the next phase of what we are going to do, until then, please lower the picamera2 version to use.

If you are still struggling with this, there’s a hack to make it run on 0.3.3 and arducam’s libcamera fork

from libcamera import ColorSpace
ColorSpace.Sycc = ColorSpace.Jpeg

from picamera2 import Picamera2
from picamera2.previews.qt import QGlPicamera2
…

Thanks. I already used sycc to jpeg, didn’t know I can do it for qt as well. Hopefully, Arducam will release the new drivers soon.

@vmilanovic

The new version will be updated in the next two days.

I am also unable to use my ArduCam 64mp hooked to the quad camera HAT
Here is an image of the errors and warnings I am getting:

@rtkimz

  1. It is possible that the signal receiving the data is unstable.

Solution idea: swap the csi to the mipi port and try to reinsert it again.

  1. ports A and B, and C and D. In each of these two groups, at least one camera needs to be good, although it is highly unlikely that there is a problem with any of the cameras in either group.

Solution. Try single channel

# Set to single channel 0

i2cset -y 10 0x24 0x24 0x02

# Set to single channel 1

i2cset -y 10 0x24 0x24 0x12

# Set to single channel 2

i2cset -y 10 0x24 0x24 0x22

# Set to single channel 3

i2cset -y 10 0x24 0x24 0x32

Switch one at a time and try libcamera-still -t 0 again to see if one channel produces an image.

First, I only have one camera hooked up. Am I supposed to have more than one hooked up?
Second, I re-seated the camera-mipi port cable but that did not seem to help.
Third, when I try to run i2cset, my system says “command not found.” Is there something else I am supposed to install?

Thank you

@rtkimz

  1. You need at least 2 of them. Ports A and B, and C and D. In each of these two groups, at least one good camera is required. Did you purchase the set or did you purchase them separately?
  2. Understanding
  3. sudo apt install i2c-tools

Edward!

  1. I purchased the complete set (4 cams + quad HAT). I unpacked and plugged a second camera in.
  2. All my connections are good
  3. Installed the i2c-tools and set it to use the first camera

It worked!
Now, I would like to do some more stuff but was hoping you could point me to the documentation so that I can doodle with it before asking more questions. Some of the things I would like to do:

  1. Turn OFF autofocus for all cameras
  2. Take a picture with all 4 cameras at the exact same time! (I would like to do this with the press of an button at some point in time.
  3. Label the pictures I take with with the datetime and a letter that lets me know which camera took the image (A = cam0, B-cam1, etc) like 2022-10-21_16200000A.png and 2022-10-21_16200000B.png, etc

Is it updated yet to support newest PiCamera2?

Thanks

@rtkimz

The four cameras are sharing the clock, so you can treat him as one camera.

  1. The camera is not auto-focused by default
  2. Switch back to four channels.
i2cset -y 10 0x24 0x24 0x00

If you cannot turn on the camera in a four-channel situation, it means that one of the cameras is defective, please use the single-channel command to troubleshoot it in turn.See which camera is not able to produce a picture alone.
3. I’m sorry, as I said at the beginning, they share the clock and are not separate.

@vmilanovic

We have finished updating.
Please upgrade:

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
sudo pip3 install picamera --upgrade

After performing the upgrade, I’m now able to complete the first example script in the picamera2 manual, section 2.3. The camera is activated, and the test.jpg image is captured!
(I’m using a Pi 4b, 4g mem, a single Arducam 64mp camera, bullseye)

But, when I run the 3rd line below, I get some errors.

from picamera2 import Picamera2, Preview
import time
picam2 = Picamera2()
[0:15:37.489578871] [1709] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3897-c3c878a9
[0:15:37.502673938] [1714] WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for ‘arducam_64mp’
[0:15:37.502810373] [1714] WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[0:15:37.552368109] [1714] WARN RPI raspberrypi.cpp:1280 Mismatch between Unicam and CamHelper for embedded data usage!
[0:15:37.553809695] [1714] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:15:37.554120804] [1714] INFO RPI raspberrypi.cpp:1404 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media4 and ISP device /dev/media2
camera_config = picam2.create_preview_configuration()
picam2.configure(camera_config)
[0:16:24.136443951] [1709] INFO Camera camera.cpp:1035 configuring streams: (0) 640x480-XBGR8888
[0:16:24.137373610] [1714] INFO RPI raspberrypi.cpp:765 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 1280x720-SBGGR10_1X10 - Selected unicam format: 1280x720-pBAA

Appreciate any feedback regarding the errors and warnings!

PS, here’s my /boot/config.txt:

dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
arm_64bit=1
disable_overscan=1
[cm4]
otg_mode=1
[all]
dtoverlay=arducam_64mp
dtoverlay=vc4-kms-v3d,cma-512
gpu_mem=128
[pi4]
arm_boost=1

@biggetit

These errors are not usable and we will optimize them later.
The rest of your usage should be normal.

I don’t understand what you mean by the errors being not usable, but thanks for the reply.

I did try some of the other examples in the Picamera2 examples folder, and they seemed to work fine. The face detection one worked!

@biggetit

What I mean is that these errors do not affect your use.

I’m sorry if these errors bother you, but please don’t worry, we’ll optimize them to avoid causing trouble to users in the future.

I see, thanks for the update. I just wanted to make sure they weren’t something I was doing wrong.