Hi everyone, I’m trying to set up a ToF camera and could really use some help with the drivers for it. Environment is a Raspberry Pi 4 Model B running Ubuntu 20.04 (not Raspberry Pi OS). I can’t find any driver or setup guide for this OS. Original subject was “Way to integrate ToF camera with Ubuntu 20.04”. Has anyone gotten this working?
Hello, happy to help. Can you share a bit more so I know what we’re dealing with? Specifically: which ToF camera model you have, the exact Ubuntu image/kernel you’re running (output of uname -a), and how the camera is physically connected (CSI port?). Also let me know what you’ve tried so far.
It’s the Arducam ToF camera. I’ve got it plugged into the CSI connector on the Pi 4B. Ubuntu 20.04, kernel is 5.4.0-1042-raspi I believe. I haven’t run any code yet because I honestly don’t know which driver to load. Nothing shows up so there aren’t really any logs to share.
Thanks. Normally on Raspberry Pi OS this camera uses a kernel driver plus a device tree overlay, so let’s first see what the OS actually detects. Can you run these and paste the output?
uname -a
ls /dev/video*
lsmod | grep -i tof
dmesg | tail -40
If there’s no /dev/video* device, that tells us the driver isn’t binding at all.
Ran all of them after a fresh boot:
$ uname -a
Linux ubuntu 5.4.0-1042-raspi #46-Ubuntu SMP aarch64 GNU/Linux
$ ls /dev/video*
ls: cannot access '/dev/video*': No such file or directory
$ lsmod | grep -i tof
(no output)
$ dmesg | tail -40
(no mention of the camera)
So it looks like the board isn’t being recognized at all.
Right, no /dev/video* plus nothing in dmesg means no driver is bound. On Raspberry Pi OS you’d add a dtoverlay=... line to the config and reboot, and the module name is specific. Ubuntu handles the kernel/config differently. Did you try adding an overlay and did you attempt sudo modprobe <module>?
I tried adding a dtoverlay line but I’m not even sure of the correct overlay name for Ubuntu. And when I try modprobe I just get “Module not found”:
$ sudo modprobe arducam_tof
modprobe: FATAL: Module arducam_tof not found in directory /lib/modules/5.4.0-1042-raspi
I tried a couple of module names from the Raspberry Pi OS instructions and none of them load.
Got it, thanks for the output. Since the module isn’t present in your kernel module directory at all, this may be a support/availability issue rather than a config mistake on your side. Let me check with the team on the Ubuntu support status for the ToF camera. Give me a little time to confirm.
Any update on this? Still stuck, can’t get anything to come up.
Sorry for the delay. I heard back: currently the ToF camera is not compatible with Ubuntu OS. There’s no driver/module available for Ubuntu 20.04 — it’s only supported on the official Raspberry Pi OS right now. So there isn’t a driver package I can give you for that environment. Also worth noting our support is running slower than usual right now due to the Spring Festival holiday, so responses may take longer.
That’s a bit disappointing. So there’s genuinely nothing I can do to get it running on Ubuntu 20.04 at the moment?
Correct, there’s no workaround we can offer yet — the module simply doesn’t exist for the Ubuntu kernel, so no overlay or modprobe will make it appear. The best path right now is to wait for news from Arducam regarding Ubuntu compatibility for the ToF camera. If you need the camera working immediately, running the official Raspberry Pi OS image on the Pi 4B is currently the supported setup. I’ll pass this along to the team and update here when there’s news — if anything comes back in the meantime I’ll send it to you via private message.