Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interesting issue with dosing schedule
#34
Thanks, just till I can get things changed. Unfortunately I can't answer a lot of your questions, the only thing I can do is replace the TimeAlarm library as I believe that's the cause. That library has full control over the schedules, a function from it is used which sends a time to the library and tells it what function to run when the alarm triggers. I know the correct time is always being sent so its up to the library at that point. Managing all the schedules is a difficult task, a lot of times that need to be tracked etc. It was using about 150 alarm slots (max is 255) the way it was setup so only thing I can see it being is the library didn't trigger that alarm. When I go through the library I can't make sense of it and there's quite a few flags involved.

I've now got my own functions made that will handle all the schedules, it seems to be working good just need to do some final testing and thought for odd scenarios. This is basically how it works now. When the controller is turned on all the schedule times are converted to a unix time stamp, then all time stamps are placed in an array, an array is basically a sheet of paper holding info. Then the array is shorted so all schedule times are in order. It then searches through all the schedules and finds the next schedule time. Once it finds that time it checks to see if that schedule is enabled, if not it moves on to the next schedule. When it finds the next one that's enabled it sets a variable holding the unix time stamp. Then in the main loop that cycles over and over its always comparing the current time with the schedule time and when it passes it runs that schedule. It then searches for the next schedule and repeats itself. When a schedule is adjusted the list is regenerated.

The way its setup now I can't imagine a schedule ever being skipped, I'm quite happy with how its working and feel good about it.
Reply to top


Messages In This Thread
Interesting issue with dosing schedule - by Arne - 06-01-2017, 03:59 AM
RE: Interesting issue with dosing schedule - by Rob F - 06-20-2017, 02:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue with Upgrade to 5.20 aquaalgae 1 2,521 01-12-2020, 09:23 PM
Last Post: Rob F
  Problem with dosing pumps Arne 37 29,551 01-31-2017, 03:00 AM
Last Post: Arne
  Disable dosing pump Arne 2 4,255 01-25-2017, 03:30 AM
Last Post: Arne

Forum Jump:

Current time: 05-04-2024, 03:26 AM