sunrise/sunset script for planex (pci) CS-W04G, EDImax etc
Posted: Tue Mar 16, 2010 12:14 am
if you have one of these cams you have probably seen this where, if the camera is set to "outdoors" during the day it's fine till night time you can't see anything unless you switch it to 50hz or 60hz but on this setting during the day everything is pretty much white.
I'm new to Linux there might be a better way to do this but this is working for me. I didn't write this, i pulled the info need from different sights.
http://ubuntu.online02.com/node/36
http://ic1500.wikispaces.com/HTML+Hacks
only requirement is having curl installed.
i have this file in my cron.daily folder and it gets the sunrise and sunset times for the jobs to run.
this is the day.sh
night.sh
I'm putting this here in case someone is searching for info on these cameras sense they are pretty much the same camera.
HawkingTechnology HNC230G official site (sold in North America)
EdiMax IC-1500 official page (sold in Central & East Europe)
AmberTek GC-J15W
IP Camera Roline, RWIC-54, W-LAN54 (reportedly sold in Russia)
LogiLink WC0001 official page (Sold in Western Europe, Germany)
LogiLink WC0002 official page (Sold in Europe)
planex (pci) CS-W04G
I'm new to Linux there might be a better way to do this but this is working for me. I didn't write this, i pulled the info need from different sights.
http://ubuntu.online02.com/node/36
http://ic1500.wikispaces.com/HTML+Hacks
only requirement is having curl installed.
i have this file in my cron.daily folder and it gets the sunrise and sunset times for the jobs to run.
Code: Select all
#!/bin/sh
#
# Gets sunset / sunrise tables from aa.usno.navy.mil
# http://ubuntu.online02.com/node/36
# Run with cron after midnight but before sunrise (4am) to get the times for the day
#
YEAR=$(date +%Y)
MONTH=$(date +%m)
DAY=$(date +%d)
STATE="LA"
CITY="new orleans"
wget http://aa.usno.navy.mil/cgi-bin/aa_pap.pl --post-data="xxy=$YEAR&xxm=$MONTH&xxd=$DAY&st=$STATE&place=$CITY" -O /tmp/suntable.htm
SUNRISE=$(cat /tmp/suntable.htm | grep Sunrise | sed 's/Sunrise //' | sed 's/\.//g' | sed 's/ //g')
SUNSET=$(cat /tmp/suntable.htm | grep Sunset | sed 's/Sunset //' | sed 's/\.//g' | sed 's/ //g')
echo Sunrise: $SUNRISE
echo Sunset: $SUNSET
# Run commands at sunrise or sunset
at -f /day.sh $SUNRISE
at -f /night.sh $SUNSET
Code: Select all
curl "http://username:password@192.168.1.204:8881/form/camera?resolution=0&quality=3&framerate=25&frequency=0&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
curl "http://username:password@192.168.1.200:8887/form/camera?resolution=0&quality=3&framerate=25&frequency=0&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
curl "http://username:password@192.168.1.202:8883/form/camera?resolution=0&quality=3&framerate=25&frequency=0&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
Code: Select all
curl "http://username:password@192.168.1.204:8881/form/camera?resolution=0&quality=3&framerate=25&frequency=60&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
curl "http://username:password@192.168.1.200:8887/form/camera?resolution=0&quality=3&framerate=25&frequency=60&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
curl "http://username:password@192.168.1.202:8883/form/camera?resolution=0&quality=3&framerate=25&frequency=60&autoexposure=ON&b_value=35&c_value=50&s_value=50&h_value=50&w_value=10&enet_source=camera_left.asp"
HawkingTechnology HNC230G official site (sold in North America)
EdiMax IC-1500 official page (sold in Central & East Europe)
AmberTek GC-J15W
IP Camera Roline, RWIC-54, W-LAN54 (reportedly sold in Russia)
LogiLink WC0001 official page (Sold in Western Europe, Germany)
LogiLink WC0002 official page (Sold in Europe)
planex (pci) CS-W04G