tfabris / CrowCam

A set of Bash scripts to control and maintain a YouTube live cam from a Synology NAS.
GNU General Public License v3.0
4 stars 3 forks source link

Need better way of handling sunrise/sunset fallback times. #13

Closed tfabris closed 5 years ago

tfabris commented 5 years ago

CrowCam Controller uses a Google search to look up sunrise/sunset times. If the Google lookup fails due to network problems, then it will fall back to a hard-coded table of values. The hard-coded table is approximate, and can be as much as an hour off at certain times of year.

On 2019-04-04, the camera encountered a problem in the early morning, during the cusp between the fallback-table sunrise and the google-search-obtained sunrise.

It failed the Google lookup, fell back to the hard coded table, and the table said that the camera should be turned on. So it turned on the camera, only to have the Google lookup succeed on its next try a minute later. The Google time said that the camera should be off, so it turned the camera off again. Several minutes later, the Google time caught up to sunrise, and turned the camera back on again. Fun times.

Proposed solution:

tfabris commented 5 years ago

Addressed with the current check-in. However it has not been placed on the server and run in production yet. When that happens, close this issue.

tfabris commented 5 years ago

Code is in production and seems to be working. Closing this issue.