Arducam ToF camera C/C++ samples on Raspberry Pi return "initialization failed" with no details

Hi everyone, I just got a Time of Flight Camera for Raspberry Pi (#B0410) and I can’t get a single sample to work. Every time I run one of the example commands it just prints “initialization failed” and nothing else. No stack trace, no extra info, just that one line. I’m running it on a Raspberry Pi. Has anyone hit this before? Honestly not sure what I’m missing here.

Hey, sorry to hear that. Let’s narrow it down. A couple of quick questions: have you gone through the setup steps in our repo here? GitHub - ArduCAM/Arducam_tof_camera · GitHub — Also, which example are you running (the C or the C++ one), and can you paste the full terminal output? If possible, a photo of how the camera is wired to the Pi would help a lot too, since a loose connection can produce exactly this kind of error.

Yeah, I’ve been through that repo more than once. I even deleted it and re-cloned it fresh to make sure I had a clean copy. I’m running the individual examples in both C and C++. Both just return “initialization failed”. Things I’ve already tried:

  • Fresh re-install of the OS on the Raspberry Pi
  • Deleting and re-cloning the repo
  • Changing the permissions on the folders and files
  • Running the individual C and C++ examples
  • Unplugging everything and reconnecting it, double-checking all the connections

Still the same result every time.

Thanks, that rules out a few things. When you say “initialization failed” — is that literally the only line printed, or is there anything before or after it in the terminal? Can you paste the exact command you used and the complete output? Also, which OS image/version are you on, and are you connecting the camera over the CSI ribbon connector? Photos of the hardware connection really would help here.

It literally just prints “initialization failed”. That’s the entire output — nothing before it, nothing after it. I’m on a freshly flashed Raspberry Pi OS and yes it’s connected through the CSI connector. There’s a slight twist in the ribbon cable and I’m wondering if that could be the issue, but I’ve reseated it several times and it still fails every run. Running out of ideas on my end.

OK, two things I need from you so we can actually pinpoint this:

  1. Screenshots of the error log in the terminal, including the command you ran and the full output.
  2. Pictures of the hardware connection — both ends of the ribbon cable and where it plugs into the Pi.

Without seeing the actual log and the wiring we can’t tell whether it’s a bus/permission issue or a physical connection problem. Also, make sure you’ve completed every step in the repo README (including enabling the required interfaces) before running the samples.

Alright, attaching the terminal output and a couple of photos of the connections now. The output is the same as before — just “initialization failed” and no more detail. I’ve confirmed both of us programming the cameras are seeing the same thing on our setups, so it doesn’t seem to be machine-specific. Let me know what you spot.

Thanks for the log and the photos. Here’s where we stand: setup follows the repo, all samples (both C and C++) return the same “initialization failed” with no additional output, and the problem persists across a fresh OS install, a clean re-clone of the repo, permission changes, and reconnecting the hardware. So far we can’t pinpoint the root cause from this alone. Please make sure you’ve gone through every step at GitHub - ArduCAM/Arducam_tof_camera · GitHub (especially enabling the required interfaces), and keep the terminal screenshots and wiring photos coming. Once we can see the exact log alongside the connection photos, we can analyze further and locate the problem.