PiDog: How to troubleshoot "no cameras available"

Hello - Just built my PiDog and everything works great… except… the camera. I believe my camera is not being recognized. I’m not sure how to troubleshoot or resolve the issue.

From this other similar post here is my info:

1.Raspberry Pi camera is properly connected and oriented correctly?
I believe so. Pictures attached below

2.What version of the operating system are you currently using?
Debian GNU/Linux 12 (bookworm)

3.Please run libcamera-hello to test if the camera is working
This is what I get:

~/pidog/examples $ sudo libcamera-hello
[0:39:57.420566437] [2624]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Made X/EGL preview window
ERROR: *** no cameras available ***

4.When you run the example code, if there are any errors, please provide a complete screenshot of the error for us to analyze and resolve the issue.

~/pidog/examples $ sudo python3 7_face_track.py 
vilib 0.3.12 launching ...
picamera2 0.3.24
config_file: /home/brian/.config/pidog/pidog.conf
robot_hat init ... done
imu_sh3001 init ... done
rgb_strip init ... done
dual_touch init ... done
sound_direction init ... done
sound_effect init ... pinctrl set 20 op dh
done
ultrasonic init ... done
Imgshow start ...

Web display on:
Exception in thread vilib:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.11/dist-packages/vilib/vilib.py", line 235, in camera
    picam2 = Picamera2()
             ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 257, in __init__
    camera_num = self.global_camera_info()[camera_num]['Num']
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
IndexError: list index out of range
      http://10.76.1.168:9000/mjpg

Starting web streaming ...
 * Serving Flask app 'vilib.vilib'
 * Debug mode: off
start
Stopping and returning to the initial position ...  0, 0 
Quit

Pics:

I’m not sure but I take a look to the tutorial video on YouTube and I think you install cable to camera upside-down. Look at the blue side need to face the black clip on rpi board and on camera board.


Hi @Weirdyguy - first, thanks for responding so quickly!
Second, you are correct. I now switched the cable orientation into the camera (but not from the Raspberry Pi), and the camera is now recognized and works.
Thanks!
I was fooled by the instruction sheet, which shows NO twist to the cable as it runs from the RPi to the camera. But indeed it needs one twist to change orientation.
Awesome, thank you!

I notice that the cable ending with 90° go connect to camera and the flat ending goes to rpi. If you take a look at the video tutorial.
https://docs.sunfounder.com/projects/pidog/en/latest/assemble_video.html

Second video at 1:43 and third video at 10:30.

Have fun! :wink:

1 Like