Figured I would post this in case it is helpful for anyone determining how often they need to refocus.(It turns out that my camera really does not loose focus very often.) You have to have AutoHotKey installed. Place the code in a text file with an .ahk extension. The code will check the current focus, compare it to your desired focus, and write to a log file whether the program needed to change the focus on the camera or if you were already in focus. I plan to run this every hour for a week and then I'll know when I typically loose focus and just run it during those times. You will need to modify the code to include your specific focus and zoom levels, mine are 0.778333 and 0.865225 respectively. You'll also need to enter your own IP and USERNAME and PASSWORD. (I'm not a programmer and so it's probably not the most elegant way to do it, but it works
The Log file it creates will look like:
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Reset
Nov-15 11:01PM Focus Unchnaged
Nov-16 05:41AM Focus Unchanged
The AutoHotKey Code:
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP/cgi-bin/devVideoInput.cgi?action=getFocusStatus
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Focus_Status.txt
}
Sleep, 2000
FormatTime, time, A_now, MMM-d hh:mmtt
FileReadLine, FocusRawData, LPR_Focus_Status.txt, 1
StringTrimLeft, CurrentFocus, FocusRawData, 13
ifEqual, CurrentFocus, 0.778333
{
FileAppend, %Time% Focus Unchanged `n, LPR_Focus_Log.txt
Exitapp
}
else {
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP...tion=adjustFocus&focus=0.778333&zoom=0.865225
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Test_and_Set_Response.txt
FileAppend, %Time% Focus Reset `n, LPR_Focus_Log.txt
}
}