Installation ToF camera fails on Bookworm (Could not open device node /dev/video0)

Hi Frank,
:rofl: Too hurry to perfect it lol:

Please ignore it. We will perfect the doc later. However, before then, it does not make difference to the firmware update.
Looking forward to your feedback.

:grinning:

Thank you for clarifying, will keep you posted!

regards, Frank.

Hi Dion,

Working on the firmware update, maybe I’m not fluent enough with tar en gzip. But when I do exactly what is stated:

tar xzvf B0410_Tof_Firmware.tar.xz

the response is:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

when I go into the archive with the archiver tool, go into aarch64 directory, I find the firmware_update (52856 jenkins/jenkins). But I also see a README.md stating:

Important: This application needs to run on jetson nano

this is when I lost confidence and decided to not further improvise.

Can you help, give guidance?

Thanks, Frank.

I gave the check on the i2c bus also a try, both in recovery and not in recovery mode gave more or less the same result. Only the order of the lines varies.:

Not in recovery mode:
dmesg | grep arducam
[ 3.383011] arducam-pivariety 4-000c: pivariety_read: Reading register 0x103 failed
[ 3.383026] arducam-pivariety 4-000c: probe failed
[ 3.390266] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@80000/arducam_pivariety@c

in recovery mode:

dmesg | grep arducam
[ 3.694595] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@80000/arducam_pivariety@c
[ 3.871951] arducam-pivariety 4-000c: pivariety_read: Reading register 0x103 failed
[ 3.871971] arducam-pivariety 4-000c: probe failed

Is there another way to check if the device is in recovery mode?

For the tar commands, use tar xvf B0410_Tof_Firmware.tar.xz ie. no z in the args.

dmesg | grep arducam
Does not return anything if the sdk is not installed. So I needed run the install script from github.
This however is not fully compatible with Pi5, as it adds the overlays to /boot/config.txt, but on Pi5 the location is /boot/firmware/config.txt.
After I modified this, I get the same error as nl-frank:

arducam-pivariety 4-000c: pivariety_read: Reading register 0x103 failed

And the firmware tool fails to read anything from the i2c.

[ERROR] Failed to read firmware version
[ERROR] Failed to read sensor id
[INFO] ==================First stage==================

Also tried running the firmware tool on a Pi4 with no luck.

1 Like

After upgrading the arducam-tof-sdk-dev to 0.1.3 on my Pi4, the camera is now not working on Pi4.
The previous version 0.1.2 does not seem to be available anymore. Any ideas?
Could also be the camera failing, but I never managed to update the firmware, so I don’t think that is the case.

1 Like

Hi,
Ignore this note

We update the command now. Sorry for the misleading.
https://docs.arducam.com/Raspberry-Pi-Camera/Tof-camera/Getting-Started/#install-dependencies

Generally speaking, it is in recovery mode when you run the command

sudo ./firmware_update -i 4 -m b0410_tof_firmware

and the terminal prints the firmware version is 0xFFFFFFFE
In other words, it means that the Recovery mode has not been entered if the Firmware Version is not 0xFFFFFFFE.

Not really getting any further:

step 1 : put camera in Recovery mode as instructed
step 2 : sudo apt update -y && sudo apt install -y libtinfo5 → this runs without errors.
step 3 : dmesg | grep arducam → no response anymore, yesterday It did respond, see my post above
step 4 : sudo ./firmware_update -i 4 -m b0410_tof_firmware → [ERROR] /dev/i2c-4: File does not exist.

I guess I need to check if the i2c-4 is correct?
or
dmesg | grep arducam
→ no response.
means the i2c port of the camera is no longer responding?

when trying to update there were no tof_camera libraries installed.

More info:
lsmod | grep i2c

i2c_dev 49152 0ls
i2c_brcmstb 49152 0
i2c_designware_platform 49152 0
i2c_designware_core 49152 1 i2c_designware_platform

ls /dev/i2*
/dev/i2c-1 /dev/i2c-11 /dev/i2c-12

I ran a clean install of Bookworm 64 bit:

ls /dev/i2*
/dev/i2c-11 /dev/i2c-12

dmesg | grep arducam, no response.

sudo ./firmware_update -i 4 -m b0410_tof_firmware
[ERROR] /dev/i2c-4: File does not exist.

If I try I2c 11 or 12

[ERROR] Failed to read firmware version
[ERROR] Failed to read sensor id
[INFO] ==================First stage==================
[ERROR] Failed to write register
[ERROR] Write update flag 2 error, ret: -1
[ERROR] The first stage fails, exit the program.

Looking forward to your response and further guidance,

regards, Frank.

as said above, you need the SDK installed for dmesg to find the device. then building the examples worked well on Pi5 8GB bookworm:

@Dion while Pi5 has two CSI ports, something prevents the ToF cam to work with the Arducam 16 MP (IMX519). It depends on the order of the overlays in config.txt:

dtoverlay=imx519, cam0
dtoverlay=arducam-pivariety,media-controller=0

the lower entry works while the upper entry does not. If I put the ToF entry up, it returns “getFrame WARNING Failed to dequeue buffer”. How can I make both work simultaneously?

@Dion I created a PR for the config.txt path issue in the Installer scripts:

Hi Dion,

I have 3 arducam ToF camera’s, I did a few tests, let’s call them cam1, cam2, cam3:
(Thanks to laserborg I made sure I have the driver installed and checked)

cam1 is running very well on a RPi4, I’m not touching this one :slight_smile:
cam2 (out-of-the-box) on RPI4:

dmesg | grep arducam
[ 0.082666] platform fe801000.csi: Fixed dependency cycle(s) with /soc/i2c0mux/i2c@1/arducam_pivariety@c
[ 8.907115] arducam-pivariety 10-000c: firmware version: 0x10002
[ 9.273470] arducam-pivariety 10-000c: Consider updating driver arducam-pivariety to match on endpoints

This cam2 on RPi5 (running Bookworm 64):

dmesg | grep arducam : no response

pip3 list | grep ArduCamDepthCamera-> no response
dpkg -l | grep arducam-tof-sdk-dev:
ii arducam-tof-sdk-dev 0.1.3 arm64 Driver development kit for arducam tof camera
ls /dev/video*
/dev/video19 /dev/video23 /dev/video27 /dev/video31 /dev/video35
/dev/video20 /dev/video24 /dev/video28 /dev/video32 /dev/video36
/dev/video21 /dev/video25 /dev/video29 /dev/video33 /dev/video37
/dev/video22 /dev/video26 /dev/video30 /dev/video34
(many but not video0)

cam3 (I tried to upgrade this one, maybe I killed it while trying?):

on RPI4:
dmesg | grep arducam
[ 0.082015] platform fe801000.csi: Fixed dependency cycle(s) with /soc/i2c0mux/i2c@1/arducam_pivariety@c
[ 10.923172] arducam-pivariety 10-000c: probe failed

This cam 3 on RPi5 (running Bookworm 64):

Same results as cam2.

So somehow these devices do not seem show up on the Pi5, so I cannot upgrade the firmware. If I connect a RPi camera v2, it works fine.
What am I missing? Any suggestions?

Thanks in advance,
Regards, Frank.

I managed to get it to work today.
I connected the camera to the other “cam/disp” port on the Pi5 and the firmware updated without any problems. I didn’t have to connect the recovery wire, it just updated after powering up. I guess shorting the recovery pin simply erases the firmware, and that is the reason it didn’t work on the Pi4 after my first attempt.

I can confirm the finding of laserborg. Using two cameras at the same time is not working.

Hi @laserborg,
Just got back to the office from the Qingming Festival. Appreciate your efforts:-)
I’ll try the imx519 + TOF on Pi 5 this afternoon and update here.

1 Like

Hi @dkjonas @laserborg
I succeeded in making the imx519 + TOF camera work on Pi 5 at the same time.
Set up

  • Raspberry Pi 5 8GB

  • Kernel version: Bullseye OS, 6.6.20

  • Tof camera on Camera 1 port, IMX519 on Camera 0 port.

  • Here is my config file, remember that media-controller is needed on Raspberry Pi 5.

At first, I also could not make tof camera work. It occurred to me that the tof camera should not be loaded at the video 0 node. After checking the v4l devices, I found it is loaded at video node 8.
Hence, I modified the preview_depth.cpp as the screenshot shows, and recompiled the project(./compile.sh). Then everything worked as expected!

Kindly note that you need to use the Raspberry Pi 5 Official Power Supply(27w) if you want to run these two cameras at the same time.

1 Like

I did exactly this and it worked! Many thanks dkjonas!
(Pi5 8G running Bookworm)

I need to keep the camera connected to this port (1), if I connect it back to port 0 it is no longer detected.

But compiling the demos got stuck at the end. Maybe related to the same problem? I can not figure out what was exactly changed from Dion’s description (changing from video node 0 to video node 8)

My project is running in python and I noticed that it used to be:
import ArducamDepthCamera (this is still working)
and now (as in the demo below SDK install)
import ArduCamDepthCamera (this generates an error on import)

If I run the python demos it is generating a screen, but no depth information of any kind.

To be continued,

With the settings Dion provide above, I’m able to run two cameras at the same time.

@Dion, can you share the command to determine the video node index of the tof camera? I would prefer automatically detect it, so I don’t have to recompile if the index changes (i.e. if I add additional usb-cameras)

The change is in line 82. There is added ,8 after CSI, so the line becomes
if (tof.open(Connection::CSI,8))

1 Like

Hi @dkjonas
The video node index is determined by the system instead of the command we set :frowning:
I use the command below to check the tof camera’s node:

media-ctl -p
1 Like

Thanks again dkjonas! I should have looked better :wink:

Short update @Dion

If I check wtih media-ctl -p I get:

entity 16: arducam-pivariety 4-000c (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev2

If I add node 2 to the preview_depth.cpp and compile:

[ 80%] Built target capture_raw
[100%] Built target preview_usb
setVideoMode WARNING TOFCamera: Could not set current frame format
Failed to start cameragetFrame WARNING Failed to dequeue buffer

getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer
getFrame WARNING Failed to dequeue buffer

When I use 0 the demo gets stuck at the end:

entity 1: csi2 (8 pads, 8 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:Y12_1X12/240x180 field:none]
← “arducam-pivariety 4-000c”:0 [ENABLED,IMMUTABLE]

Thank you very much for your patience and support, what could be a good next step to take?

Regards, Frank