Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 53 lines (39 sloc) 1.546 kb
fa96c1b @johnmckerrell First commit for github
authored
1 /**
2 * YAHMS - Yet Another Home Management System
3 *
4 * (C) John McKerrell 2011
5 * Probably some open source license when I get around to choosing one
6 */
7
8 /**
9 Do we have the current time or is it a while since we updated?
10 Update the time - similar choice of sync vs async as below
11
12 Do we have any config, or is the config too old?
13 Download a config
14 ?? Does this happen asynchronously or not? First time it might as well be sync but otherwise perhaps not
15 What does config contain?
16 Instructions on which digital pins are: Xbee Serial, Input, Output
17 "On blocks" - blocks of time that a relay should be set to on
18 +1 Hour - could simply be an extra On block
19 Not sure about advance blocks - perhaps also an On block, these and +1 hour could be a special type that you only have one of, so a later +1 or advance discards the previous
20
21 Read in all of the local samples
22 Check the Xbee for any samples
23
24 Iterate over outputs, check whether we’re inside an On block, update pin status accordingly
25
26 Check the last time we sent back a sample, if it’s been too long then send the latest values, don’t send a sample that’s too old
27 */
28
29 #include <Client.h>
30 #include <Ethernet.h>
31 #include <IPAddress.h>
32
6f6aaec @johnmckerrell Making code work with stock Arduino 1.0.1
authored
33 #include <SoftwareSerial.h>
fa96c1b @johnmckerrell First commit for github
authored
34 #include <XBee.h>
35
36 #include <Time.h>
37
38 #include <HttpClient.h>
39 #include <EEPROM.h>
40
41 #include <math.h>
42
43 #include "YAHMS_Defines.h"
44
45 extern byte mac[];
46 extern XBee xbee;
6f6aaec @johnmckerrell Making code work with stock Arduino 1.0.1
authored
47 extern SoftwareSerial *xbeeSerial;
fa96c1b @johnmckerrell First commit for github
authored
48 extern char outputPins[];
49 extern byte settings[];
275c1b0 @johnmckerrell Restructured control blocks to use only EEPROM
authored
50 extern boolean configPresent;
fa96c1b @johnmckerrell First commit for github
authored
51
52 void CheckAndUpdateConfig();
Something went wrong with that request. Please try again.