QUICK question ! How to save Focus value after restart PI

Hi, my pi needs to restart every day atuomatically in order to save power. Im using solar panel power it.
I use manual focus and my value is 535, i can save it. But after every restart, it resets its value.
What i should do to let pi forever remeber this value? Thanks a lot

@tianfengkai

Both the camera and motors will be re-initialized after reboot.
So this value is not saved across reboot.

What command do you use to use the camera, if you are using libcamera-still, there is a parameter to set the focal length value into it. Try “lens-position”

I used the len-position, no matter what value i put, it only shows a very blurd image, so im not sure what i should do. In manual focus, the value is 543.

The other thing is that can i zoom in zoom out 64mp cam? I didnt find the releavant information.

The thrid thing is that im shoting the insects, i think the insects are quite small, i need put near to trap. However, the insects are all over the trap, and it focus only on the center of few insects, if i put several 16mp camera together is it possible to make everything clear? (Many 64mp on one is expensive). I mean, can several imx519 16mpcam together and give me one image. Like it can shot two images but use algorithm to combine as one image. Thanks a lot
@Edward


I dont think lens position can help… do you have any idea? @Edward

@tianfengkai

It depends on your needs, if you buy more than one imx519, then you also need more than one Raspberry Pi, as far as I know, only cm4 can support 2 camera data at the same time, it cannot do more cameras.

There is currently no support for this.

It should not be, what are all the commands you use, if possible, can you record a video of your debugging process for me?

I dont think i can upload the video on this chat.
Im using the phone

@Edward I dont think i can upload the video on this chat.
Im using the phone

@tianfengkai

Please try this

libcamera-still -t 0 --autofocus-mode manual --lens-position 5

@Edward


its blurd , however,

This value in focus manually its clear

@Edward i checked focus controller value and lens position, i think if its more than 15, then focus controller value will be more than 1051.these two value are not same thing

Also, do you know why everytime its show good brightness in

However, after i take picture, everytime its dark nonmatter auto focus or manual focus


@tianfengkai

Yes, this is a mapped value, you need to test to find the best value.

libcamera does automatic exposure and automatic gain, and will adapt to the image effect.
You can set it to manual if you don’t need it.

There are details in the libcamera help

libcamera-still -h

So you mean there is no other way to set the manual focus score? The lens-position is only range from 0-15, i tried, none of this works

@tianfengkai

Another way:

You can directly control the motor with v4l2