Arducam IMX519 autofocus camera poor image quality and permission error on Jetson Orin Nano

Hi, hoping someone can help. I’ve got an Arducam 12MP 477P Motorized Focus High Quality Camera (the one listed for Jetson Nano/Xavier NX/AGX Orin/Orin Nano/Orin NX) on a Jetson Orin Nano Developer Kit, and I’m having driver trouble. sudo python3 JetsonCamera.py works, but plain python3 JetsonCamera.py fails with an error that the camera cannot be opened. I’m also testing a UCTRONICS IMX477 12MP with an M12 lens. Datamatrix/text capture quality is fine at ~25 cm but really bad past ~40 cm, and I need to capture at ~1 m. I also want to control shutter speed — is there documentation for the camera control libraries? And separately, does the Arducam IMX519 autofocus module (B0371) work on the Orin Nano?

Environment: NVIDIA Jetson Orin Nano Developer Kit, uname -r = 5.10.192-tegra-35.5.0-20240613202628.

Let’s sort the driver issue first. Can you run the driver installer with the IMX477 option and paste the full output?

./install_full.sh -m imx477

The kernel string you posted will matter here, so keep that handy.

Here’s the installer output. It starts with a warning, detects the board, then downloads a links file:

advanceai@ubuntu:~/Downloads$ ./install_full.sh -m imx477
./install_full.sh: line 19: warning: command substitution: ignored null byte in input
NVIDIA Orin Nano Developer Kit
--2024-07-18 21:31:40--  https://github.com/ArduCAM/MIPI_Camera/releases/download/v0.0.3/imx477_links.txt
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/... [following]
Resolving objects.githubusercontent.com... 185.199.111.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17678 (17K) [application/octet-stream]
Saving to: 'imx477_links.txt'
imx477_links.txt 100%[=============================>] 17.26K --.-KB/s in 0.003s
2024-07-18 21:31:41 (6.23 MB/s) - 'imx477_links.txt' saved [17678/17678]

Good, the links file downloaded fine, so networking isn’t the problem. What did it print right after that download finished?

Right after the download it fails with:

Cannot find the corresponding deb package, please send the following information to [email protected]
Kernel version:  5.10.192-tegra-35.5.0-20240613202628
Jetson type:  NVIDIA Orin Nano Developer Kit

That’s the clue. The kernel string 5.10.192-tegra-35.5.0 corresponds to L4T 35.5.0, but the IMX477 driver package was debugged for L4T 36.3.0 (JetPack 6.0). On that unsupported L4T/kernel version the deb-package lookup reports the Jetson type as UNKNOWN, so no matching package exists. Flash the Orin Nano to L4T 36.3.0 (JetPack 6.0), then rerun the installer.

I reflashed with JetPack 6.0 / L4T 36.3.0 and the installer completed this time — the camera works now. I’m in ~/MIPI_Camera/Jetson/IMX477/AF_LENS and the directory has Autofocus.py, Focuser.py, JetsonCamera.py, and FocuserExample.py. I’ve been using FocuserExample.py for the datamatrix/text captures. But the sudo problem is still there: sudo python3 JetsonCamera.py opens the camera, python3 JetsonCamera.py without sudo says the camera cannot be opened.

That non-sudo failure is a permissions/environment issue. The cleanest fix is to create a Python virtual environment and run the script from inside it — that avoids needing sudo just to open the camera.

Thanks, that got it running without sudo. Back to the image quality: with FocuserExample.py the datamatrix/text is good at ~25 cm but soft/unusable past ~40 cm, and I need ~1 m. Is this just a lens thing or does the script need work?

A bit of both. The M12 lens focus is adjusted by screwing the lens, so at 1 m you’ll likely need to refocus. Also, FocuserExample.py is a basic example — the focus routine in it usually needs to be refined for a specific working distance. Adjust the M12 lens mechanically and tune the FocuserExample.py settings for your 1 m setup.

One more thing: how do I actually control shutter speed? Is there documentation for the camera control libraries (exposure/gain etc.)?

Exposure/gain is the one you want for shutter control. The adjustment reference is here:

https://docs.arducam.com/Nvidia-Jetson-Camera/Native-Camera/Toubleshoot/#4-how-to-adjust-the-exposure-gain

And to come back to my earlier question — can anyone confirm the Arducam IMX519 autofocus camera module (B0371) works on the Jetson Orin Nano?

Yes, the IMX519 autofocus camera is supported on the Jetson Orin Nano. Quick start guide is here:

https://docs.arducam.com/Nvidia-Jetson-Camera/Native-Camera/Quick-Start-Guide/#16mp-imx519-camera

and there’s a focus example at:

To recap where things landed: the IMX477 Cannot find the corresponding deb package error was the L4T version — flashing JetPack 6.0 (L4T 36.3.0) fixed it. Non-sudo camera access works through a Python venv. The 1 m focus problem is manual M12 lens adjustment plus refining FocuserExample.py, and exposure/gain (shutter) control is covered in the troubleshooting doc I linked.