OpenScan-org / OpenScan2

an improved firmware for the OpenScan devices, featuring many more cameras and a greatly improved overall usability
GNU General Public License v3.0
241 stars 27 forks source link

Autofocus not working #74

Open winne27 opened 1 year ago

winne27 commented 1 year ago

The timeout option (-t) in calling libcamera-still in OpenScan.py raises non focusing for imx519. By debugging and testing two solutions were found:

  1. allow in Settings timeout to be higher than 1. With 2 or 3 autofocus will work
  2. remove option -t from line 158 in OpenScan.py

Both worked for me.

apurvakalia commented 1 year ago

Settings does not allow timeout to go beyond 1. How did you set it to 2 or 3? BTW, I see that you have removed -t in OpenScan.py from the other thread

winne27 commented 1 year ago

This limit is set somethere in the nodered configuration. I don't know where.

I was testing it on command line with

sudo libcamera-still -n --sharpness 0 -o /home/pi/OpenScan/tmp/tmp.jpg --shutter 116000 --saturation 1 --contrast 1 --awbgains 0,0 --gain 1 -q 95 --autofocus-mode auto -t 2000

The parameter -t is the timeout in milliseconds. I tested until /home/pi/OpenScan/tmp/tmp.jpg becomes sharp. Removing this option was also successful for me.

apurvakalia commented 1 year ago

I will try it on the command line as well. Removing the option does not seem to help for me. BTW, look at issue #44 on this. Maybe that is the solution...