#======= fetch focus and zoom from camera ===========
aim browser at address...
http://192.168.xx.xx/cgi-bin/devVideoInput.cgi?action=getFocusStatus
will be asked for username and password for camera. Then cgi response will show desired info.
#======= day script ===========
import requests
from requests.auth import HTTPDigestAuth
import time
#street east ====================
try:
#day profile
url = 'http://192.168.xx.xx/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(3)
#day autofocus mode
url = 'http://192.168.xx.xx/cgi-bin/configManager.cgi?action=setConfig&VideoInFocus[0][0].Mode=2'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(2)
#set zoom and focus for day position
url = 'http://192.168.xx.xx/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.663889&zoom=0.272879'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(10)
#perform autofocus
url = 'http://192.168.xx.xx/cgi-bin/devVideoInput.cgi?action=autoFocus'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(10)
except:
a = 1
#======= night script ===========
import requests
from requests.auth import HTTPDigestAuth
import time
#street east ====================
try:
#night profile
url = 'http://http://192.168.xx.xx/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(10)
#night manual focus mode
url = 'http://http://192.168.xx.xx/cgi-bin/configManager.cgi?action=setConfig&VideoInFocus[0][1].Mode=4'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(2)
#zoom and focus for night position
url = 'http://192.168.xx.xx/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.680000&zoom=0.300333'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
time.sleep(5)
#repeat zoom and focus for night position to increase reliability
url = 'http://192.168.xx.xx/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.680000&zoom=0.300333'
requests.get(url, auth=HTTPDigestAuth('username', 'password'))
except:
a = 1