Setting Autofocus on Jetson Nano with IMX219-AF

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

  2. Model number of the product(s)?
    Arducam IMX219-AF Programmable/Auto Focus Camera Module for NVIDIA Jetson Nano

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

  4. Instructions you have followed. (link/manual/etc.)
    Successfully ran at ArduCAM repo

  5. Problems you were having?
    I found a good focus value using this python program. I noted that the i2cset command to get this focus was i2cset -y 6 0x0c 21 224, however when running this i2cset command from my c++ program, I noticed the focus actually got worse.

  6. The dmesg log from your hardware?

  7. Troubleshooting attempts you’ve made?
    Modified my program to set the focus in different ways

  8. What help do you need?
    Why does the focus end up worse when I run the same focus command?

Also, what should the ideal focus value be for a target 6.5 inches away? It seems the python program is using values from 10 to 1000. What do these correspond to in real world distances?


You need to make sure to set the focus value after the camera is turned on.

It represents the range of movement of the electric motor and is not mapped to the focal length.