Chance has us capture trades toting supplies down our new stairs to do the last bits of front yard repair.
I hooked up a webcam with a single shell command line and the python simple server, each run in screen. images
My first subject was my own front yard recently landscaped with more stonework and native plants replacing grass.
See Kitchen Cam
This is the first self-timer script I wrote, initially as a single command line, which worked first time. Sweet.
while true; do n=`date +%M` echo $n -- `date` raspistill -w 640 -h 480 -o temp.jpg mv temp.jpg $n.jpg sleep 20 done
Within days, improvements followed.
I noticed that raspistill was already doing the temp file thing to make file system updates atomic.
raspistill -w 640 -h 480 -o $n.jpg
I added time of day to each picture. The extra dots made this slightly easier to read over foliage.
n=`date +%M` h=`date +%H` raspistill -w 640 -h 480 -o $n.jpg -a "..$h:$n.."
I sought some simple way to categorize images based on content and remember longer the more exceptional. I chose compressed file size. images
s=`perl -e "print int(log(-s <$m.jpg>)*100)"` cp $m.jpg various/$s.jpg
I started watching dawn arrive. A night exposure option and slow shutter speed captured what I could see and in better color. This due to my own rod/cone limitations.
raspistill ... -ex night -ss 6000000
I thought of modifying the script to switch shutter speeds based on my Sensor Server light meter. I extracted from that old codebase a call that would work. chart
curl -s 'http://home.c2.com:4567/ss' | \ jq '.a2010/10.23>50'
Constants in this computation include a2010 for the photocell channel, 10.23 calibration to bring this to a percentage of full daylight and 50 for the percentage of light where long exposure lost more highlight detail than shadow detail gained.
I was running both the self-timer and the web server in screen jobs but this would not survive reboots. I switched to using cron to launch the server on boot and time the once a minute exposures.
@reboot (cd stills; python -m SimpleHTTPServer 8000&) * * * * * (cd stills; sh cron.sh)
m=`date +%M` h=`date +%H` raspistill -w 640 -h 480 -o $m.jpg -a "..$h.$m.." s=`perl -e "print int(log(-s <$m.jpg>)*100)"` cp $m.jpg various/$s.jpg