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:
Have each Google search write a file containing the sunrise and sunset variables that it obtained from Google.
If the Google search fails, fall back to the contents of the file.
If the file read fails, fall back to the table (alternative: Remove the table and simply fail out completely).
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: