Raspberry pi camera using with jetson orin nx

I am trying to operate Jetson Orin NX and Raspberry Pi V2 camera together.

I get this error when I run the code below. What is the reason for this and how can it be solved?

[ WARN:0@10.123] global cap_v4l.cpp:1119 tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.

the code:

import cv2

cap = cv2.VideoCapture(0)

if not cap.isOpened():
print(“camera cant started!”)
exit()

while True:

ret, frame = cap.read()

if not ret:
    print("frame none!")
    break

cv2.imshow("Kamera Görüntüsü", frame)

if cv2.waitKey(1) & 0xFF == ord('q'):
    break

cap.release()
cv2.destroyAllWindows()

hello yusufcgyln2001,

please check you’ve camera device register to system correctly.
you may review kernel init messages. i.e. $ dmesg > klogs.txt, and also $ ls /dev/video* for video nodes.

the output when i typed ls /dev/video*
lagari@lagari:~$ ls /dev/video*
/dev/video0

the output about the camera when i typed dmesg

[ 8.341924] imx219 9-0010: tegracam sensor driver:imx219_v2.0.6
[ 8.358596] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[ 8.371488] imx219 9-0010: board setup failed
[ 8.376021] imx219: probe of 9-0010 failed with error -121
[ 8.381717] i2c i2c-2: Added multiplexed i2c bus 9
[ 8.387476] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[ 8.409714] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 10-0010 bound

but when i typed nvgstcapture-1.0 camera image appears
What else could be the problem?

hello yusufcgyln2001,

it means only one of IMX219 camera has register to system. did you have dual camera setup?

I connected only 1 raspberry pi camera to the jetson computer. Why do I need dual setup?

hello yusufcgyln2001,

I just double check whether it’s an acceptable device registration failed.
since Orin NX by default using two camera config, it’s safe to ignore that error.

please also check developer guide, Approaches for Validating and Testing the V4L2 Driver.
if there’s no failure with camera streaming, there’s a bug within your implementation.

cv2.VideoCapture(0) is not for an CSI camera. Typically that is for a USB connected camera.

For a CSI camera, use gstreamer with nvarguscamera. Here’s one example, it’s a little too big to include here: https://github.com/jetsonhacks/CSI-Camera/blob/master/simple_camera.py

1 Like

I think I need to build opencv with gstreamer.

If you’ve built OpenCV from source, you need GStreamer to talk with a CSI camera on the Jetson.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.