Jetson nano crashes when I try to use IMX477 camera

  1. Where did you get the camera module(s)?
    Amazon

  2. Model number of the product(s)?
    Arducam IMX477 Autofocus and Software-Controlled Focus HQ Camera, 12MP 100° FOV Camera Module Compatible with Nvidia Jetson Nano/Xavier NX and NVIDIA Orin NX/AGX Orin, M12 Lens

Waveshare IMX219-160IR Camera for Jetson Nano Infrared Night Vision 3280 × 2464 Resolution 8 Megapixels 160° FOV IMX219 Sensor Suit for Face Recognition Road Mark Detection License Plate Recognition

Yahboom Jetson Nano Developer Kit Nano B01 with 16G-eMMC Based on Official N-VI-Dia Jetson Nano 4GB Core Module

  1. What hardware/platform were you working on?
    Jetson Nano B01

  2. Instructions you have followed. (link/manual/etc.)
    GitHub - JetsonHacksNano/CSI-Camera: Simple example of using a CSI-Camera (like the Raspberry Pi Version 2 camera) with the NVIDIA Jetson Developer Kit
    install OpenCV 3.3 in ubuntu 18.04 · GitHub

  3. Problems you were having?
    When I try to use the IMX477 camera the Jetson nano crashes.

  4. The dmesg log from your hardware?

arjun@arjun-desktop:~$ dmesg | grep -E “imx477|imx219|arducam”
[ 1.316179] imx477 7-001a: tegracam sensor driver:imx477_v2.0.6
[ 1.618164] imx219 8-0010: tegracam sensor driver:imx219_v2.0.6
[ 1.797912] vi 54080000.vi: subdev imx477 7-001a bound
[ 1.798634] vi 54080000.vi: subdev imx219 8-0010 bound
arjun@arjun-desktop:~$

  1. Troubleshooting attempts you’ve made?
    NVIDIA forum and google

  2. What help do you need?
    I need to get the IMX477 working along with the IMX219. The IMX219 works but when I try to use the IMX477, the Jetson nano crashes. Please help. Thank you.

What command did you use, what is the error?

Please also provide dmesg information
sudo dmesg

I am not using a command. I am using a script I found on github. There is no error. The Jetson nano just crashes. I will give the script bellow.

MIT License

Copyright (c) 2019-2022 JetsonHacks

Using a CSI camera (such as the Raspberry Pi Version 2) connected to a

NVIDIA Jetson Nano Developer Kit using OpenCV

Drivers for the camera and OpenCV are included in the base image

import cv2

“”"
gstreamer_pipeline returns a GStreamer pipeline for capturing from the CSI camera
Flip the image by setting the flip_method (most common values: 0 and 2)
display_width and display_height determine the size of each camera pane in the window on the screen
Default 1920x1080 displayd in a 1/4 size window
“”"

def gstreamer_pipeline(
sensor_id=0,
capture_width=1920,
capture_height=1080,
display_width=960,
display_height=540,
framerate=30,
flip_method=0,
):
return (
“nvarguscamerasrc sensor-id=%d !”
"video/x-raw(memory:NVMM), width=(int)%d, height=(int)%d, framerate=(fraction)%d/1 ! "
"nvvidconv flip-method=%d ! "
"video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! "
"videoconvert ! "
“video/x-raw, format=(string)BGR ! appsink”
% (
sensor_id,
capture_width,
capture_height,
framerate,
flip_method,
display_width,
display_height,
)
)

def show_camera():
window_title = “CSI Camera”

# To flip the image, modify the flip_method parameter (0 and 2 are the most common)
print(gstreamer_pipeline(flip_method=0))
video_capture = cv2.VideoCapture(gstreamer_pipeline(flip_method=0), cv2.CAP_GSTREAMER)
if video_capture.isOpened():
    try:
        window_handle = cv2.namedWindow(window_title, cv2.WINDOW_AUTOSIZE)
        while True:
            ret_val, frame = video_capture.read()
            # Check to see if the user closed the window
            # Under GTK+ (Jetson Default), WND_PROP_VISIBLE does not work correctly. Under Qt it does
            # GTK - Substitute WND_PROP_AUTOSIZE to detect if window has been closed by user
            if cv2.getWindowProperty(window_title, cv2.WND_PROP_AUTOSIZE) >= 0:
                cv2.imshow(window_title, frame)
            else:
                break 
            keyCode = cv2.waitKey(10) & 0xFF
            # Stop the program on the ESC key or 'q'
            if keyCode == 27 or keyCode == ord('q'):
                break
    finally:
        video_capture.release()
        cv2.destroyAllWindows()
else:
    print("Error: Unable to open camera")

if name == “main”:
show_camera()

Here is the dmesg for the cameras I am using.

arjun@arjun-desktop:~$ sudo dmesg | grep -E “imx477|imx219|arducam”
[ 1.312939] imx477 7-001a: tegracam sensor driver:imx477_v2.0.6
[ 1.614874] imx219 8-0010: tegracam sensor driver:imx219_v2.0.6
[ 1.802249] vi 54080000.vi: subdev imx477 7-001a bound
[ 1.802916] vi 54080000.vi: subdev imx219 8-0010 bound
arjun@arjun-desktop:~$