OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Some issues and question › Reply To: Some issues and question
robohack
Sorry, but using a UPS is an extremely unreasonable suggestion!
The controller is mounted in a weatherproof box on the outside of a building using a pre-installed outdoor socket — there’s certainly no room for a UPS in that box and no cheap or easy way to connect one at the breaker box either.
Even if the power only went out once a week it would be critical here — I have a minimum of 21 hours of total program run time every day over 32 zones and losing any significant part of a day’s watering in some of those zones can have a significant adverse affect on the plants being cared for. A UPS doesn’t even solve the whole problem — I would also use a manual reboot to restart the system after doing any maintenance, or, e.g. mowing.
Both of the old controllers I’m replacing, one an Irritol Systems 24-zone unit for example, will restart their programs at the current time of day, even if they’ve been off and then turned on. Normally they only restart at the next zone’s start time, of course, not at the zone that should be running at the current time, but they’re much simpler microcontrollers with their firmware frozen in ROM and unmodifiable.
However I still need a reliable controller that “fails safely” in a basic engineering sense — which in this case means it only stops watering for the time the power is out (and maybe up until the time the next programmed zone should start). Even a manual reboot shouldn’t leave me with having to manually configure watering for the rest of the day — this is a computer that’s already supposed to be able to figure out and manage such things!
To me this is a critical feature that I’m stunned wasn’t included from the get-go, especially since existing commercial timers have been doing it for decades. Anyone replacing almost any existing controller will most certainly expect this!
Note that it’s not obvious to a user that the “Preview Programs” the web page isn’t produced on the controller — but either way that’s not important — I just thought it would be an obvious solution since it already seemed to exist already in software and it shows exactly where the execution should continue from. In any case I didn’t mean to keep using the preview — I just meant to use it to find where the current state should be, then to continue on as normal from there.
How about instead just look through the list of program start times, find the ones that should have started “today” (i.e. since the previous midnight), run through all the zones in those program(s) until their elapsed time matches the current time, turn on the zone that should currently be active and run any remaining time for it (or like the old controllers, wait for the next zone that should start, at the time it should start), then continue on with the active program(s) as if the controller had been actually been rebooted just before midnight?
Just do this on reboot, or perhaps if there’s a manual request to do it through the web API, though the primary concern is after any reboot.
None of the other issues are important — only future events need be dealt with, and they should be handled in exactly the same way as if the controller had always been running and a program had started at the actual start time but was otherwise unaffected by any dynamic or user-driven events. Any dynamic events that might have actually occurred between midnight and the current time can be ignored as if they never happened — all it needs to do is “fail safely” on reboot so that it continues on running any stored program(s) from the current time of day.