Tolting Colt Acres
Pulling my weight
- Jun 7, 2016
- 378
- 153
My scene setting is outdoors. I do not have a 1/25 exposure option in my dropdown. I've avoided attempting to set different day and nite settings as daytime varies around here (New England) from anywhere about 7am->4pm to 4:30am->9:30pm a the winter and summer solstices, respectively, so I'd be in a constant state of adjusting those settings. (although I could write a Linux script to retrieve the sunup and sunset times for each day and then use a curl command to change the times, I suppose, each night at 1am...)
getsunriseset.py:
import ephem
from datetime import datetime
o=ephem.Observer()
o.lat='42.364506'
o.long='-71.038887'
s=ephem.Sun()
s.compute()
print('<ISPMode>')
print(' <mode>schedule</mode>')
print(' <Schedule>')
print(' <scheduleType>day</scheduleType>')
print(' <TimeRange>')
print(' <beginTime>' + str(ephem.localtime(o.next_rising(s))).replace('.', ' ').split()[1] + '</beginTime>')
print(' <endTime>' + str(ephem.localtime(o.next_setting(s))).replace('.', ' ').split()[1] + '</endTime>')
print(' </TimeRange>')
print(' </Schedule>')
print('</ISPMode>')
setsunriseset.sh:
python getsunriseset.py > out
curl -T out http://myadmin:mypass@172.16.100.240/ISAPI/Image/channels/1/ISPMode
rm out
getsunriseset.py:
import ephem
from datetime import datetime
o=ephem.Observer()
o.lat='42.364506'
o.long='-71.038887'
s=ephem.Sun()
s.compute()
print('<ISPMode>')
print(' <mode>schedule</mode>')
print(' <Schedule>')
print(' <scheduleType>day</scheduleType>')
print(' <TimeRange>')
print(' <beginTime>' + str(ephem.localtime(o.next_rising(s))).replace('.', ' ').split()[1] + '</beginTime>')
print(' <endTime>' + str(ephem.localtime(o.next_setting(s))).replace('.', ' ').split()[1] + '</endTime>')
print(' </TimeRange>')
print(' </Schedule>')
print('</ISPMode>')
setsunriseset.sh:
python getsunriseset.py > out
curl -T out http://myadmin:mypass@172.16.100.240/ISAPI/Image/channels/1/ISPMode
rm out