RuntimeError: Failed to open camera! on Jetson Nano with IMX 477 Motorized Focus Camera

  1. Where did you get the camera module(s)?
    I bought the camera from robu.in (https://robu.in/product/arducam-12mp-imx477-motorized-focus-high-quality-camera-for-jetson-nano/)
  2. Model number of the product(s)?
    SKU: B0273
  3. What hardware/platform were you working on?
    I am working on Jetson Nano 2GB Developer KIT
  4. Instructions you have followed. (link/manual/etc.)
    I have followed the official documentation on the arducam website. Summary of steps followed:
  1. Installed arducam driver using script
    2)Reconfigured CSI pins as mentioned in doc
  1. Problems you were having?
    I was able to access the camera using gstreamer. When I ran python program, it is throwing error as cannot open camera. Also, I was able to set the focus value using i2cset when camera is through gstreamer but I see no change in the blur/focus of the camera.
  2. The dmesg log from your hardware?
    dmesg arducam - Pastebin.com
  3. Troubleshooting attempts you’ve made?
    I have tried other threads and tried them nothing seems to work.
  4. What help do you need?
    I want to access the camera from python and should be able to do autofocus/ change focus programatically.

hi, @Vignesh

Which python program are you using?

What gstreamer command are you using?

hi @yang

This is the link to the command I am using for gstreamer. I could run all the commands without any error.

The python script I am using is https://github.com/ArduCAM/MIPI_Camera/tree/master/Jetson/IMX477/AF_LENS

hi, @Vignesh

Can you provide error information?

hi @yang
Please find the below Image attached. Thanks

hi, @Vignesh

You can view the camera i2c address with the following command:

dmesg | grep imx477

Which driver deb package did you install?

I installed the driver using install_full.sh -m imx477

The Gstreamer pipeline in python code is as below
nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)60/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)640, height=(int)360, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink

whereas, the command I use in the terminal is as below

gst-launch-1.0 nvarguscamerasrc sensor-id=$SENSOR_ID ! "video/x-raw(memory:NVMM),width=1920,height=1080,framerate=$FRAMERATE/1" ! nvvidconv ! nvoverlaysink

Can you see if there is anything that needs to be changed in python program

hi, @Vignesh

There is no problem with the python program, and the focus program can run normally when I test it here.

What version system are you using, you can use the following command to check:

cat /etc/nv_tegra_release

hi, @yang

Here is the output
R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t210ref, EABI: aarch64, DATE: Sat Feb 19 17:05:08 UTC 2022

I could run Focuser.py. I could change the values of the focus if the camera is open else, I am getting a write error. Besides, I was not able to see any difference when I change the focus programmatically. I could see changes in focus if I manually rotate the lens. Could that be a motor fault? How to validate whether the motorized focus is working or not?

hi, @Vignesh

Can you provide log information and dmesg information when the program is running.