Using alarmtime but scheduling from SD card

I am working on a complex heating control system, and for version 2 I would like to use the alarm time function, but rather than have the schedule times hard coded I would like to pull them from an sd card, with a view to editing them from a webpage in future versions?

but after lots of googleing I cant see a way to read values from an sd card that effect the way the scheduled tasks run. This needs only be at boot up if they needed to be written to variables, but it would ideally be an unrestricted number of them (i.e. not coded to restrict to say 12 events)

Any help greatly appreciated.

I am using the Arduino Mega, and the Ethernet shield with an SD card slot.

Stuart.

Lets see if I understand correctly, you want a sort of crontab file on disk and a cron scheduler?

A crontab file is in essence a file containing two fields, a time-identifier and a command to execute. The cron daemon reads the whole crontab and selects the next command to execute and goes to sleep until time. It starts the command and after that is selects the next command to execute and sleeps etc.

In a multitasking environment CRON is quite easy to implement, in a single task environment you must be aware that starvation of commands is possible.

ooh, It's along time since I used Cron jobs.. prob 1998 at lucent tech..

Yes I suppose i am trying to do that, but you have given me an idea, If I had two schedules using the timealarm library http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263305457/30 one for the current alarm and one for the next alarm, each time an alarm is run, it also reads the SD card to find the next alarm time and command and puts it into the schedule.

(apologies if I am not explaining the very well)

something like this:

on boot: Read first alarm from schedule on SD card that is due to happen in the future, add this alarm and it's actions to ALARM 1

on ALARM 1 (based on time and Day of week) Do action, Read next alarm from SD card that is due to happen in the future, Change ALARM 2 to reflect the records time, DOW and actions.

on ALARM 2 (based on time and Day of week) Do action, Read next alarm from SD card that is due to happen in the future, Change ALARM 1 to reflect the records time, DOW and actions.

(This is all based on the idea that you can't change an alarm that's currently ringing, which may be incorrect, in which case only 1 ALARM is required)

Does that help?

TIA, Stuart.

Any help greatly appreciated.

Does that help?

Maybe not the final solution, but a good start to get the thinking right! The cron syntax is at least weldefined!