sunwait
sunwait copied to clipboard
Sunwait usage question
Hi, I browsed around through the internet about how to use sunwait with cron. I followed one of the source and make the sunwait as well as cp the made sunwait into usr/local/bin
- The
sunwait -p
seem no longer work? - The
sunwait report [latitude] [longitude]
is woking.
In case of I want to edit the crontab as below for everyday at 5AM, wait until astronomical twilight begin, then stop my overnight running system via http, the crontab should be as below?
00 05 * * * /usr/local/bin/sunwait wait astronomical rise [latitude] [longitude] ; curl -X POST http://<ip>/api/stop
Please advise. Thank you very much.
I understand that sunwait -p used to be the way with older versions worked but now it's called the 'poll' option.
Example cron task that I use to restart a camera motion daemon at sunrise/sunset on a Raspberry Pi 4:
@reboot /home/pi/scripts/pi_sunwait wait rise 51.360258N -0.147890E; sudo service motion restart @reboot /home/pi/scripts/pi_sunwait wait set 51.360258N -0.147890E; sudo service motion restart