Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

Committer:
andrewboyson
Date:
Tue Feb 23 20:35:07 2021 +0000
Revision:
105:1899f7ed17ec
Parent:
104:46ce1aaf8be7
Child:
106:41ed3ea0bbba
Added ability to set the minimum flow rate and removed the correction to delta T relative to speed. Adding the round circuit time and linked to speed. Next task is to linearize the flow.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 24:e3ed1b52c6e6 1 #include <stdlib.h>
andrewboyson 24:e3ed1b52c6e6 2 #include <string.h>
andrewboyson 24:e3ed1b52c6e6 3 #include "http.h"
andrewboyson 24:e3ed1b52c6e6 4 #include "boiler.h"
andrewboyson 24:e3ed1b52c6e6 5
andrewboyson 49:9491c966dc60 6 void WebBoilerQuery(char* pQuery)
andrewboyson 24:e3ed1b52c6e6 7 {
andrewboyson 24:e3ed1b52c6e6 8 while (pQuery)
andrewboyson 24:e3ed1b52c6e6 9 {
andrewboyson 24:e3ed1b52c6e6 10 char* pName;
andrewboyson 24:e3ed1b52c6e6 11 char* pValue;
andrewboyson 26:85e3becbebc9 12 pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
andrewboyson 105:1899f7ed17ec 13
andrewboyson 105:1899f7ed17ec 14
andrewboyson 105:1899f7ed17ec 15 if (HttpSameStr(pName, "boilercallenable"))
andrewboyson 105:1899f7ed17ec 16 {
andrewboyson 105:1899f7ed17ec 17 BoilerCallEnable = !BoilerCallEnable;
andrewboyson 105:1899f7ed17ec 18 }
andrewboyson 105:1899f7ed17ec 19
andrewboyson 105:1899f7ed17ec 20 if (HttpSameStr(pName, "fullspeedsecs" ))
andrewboyson 105:1899f7ed17ec 21 {
andrewboyson 105:1899f7ed17ec 22 int value = HttpQueryValueAsInt(pValue);
andrewboyson 105:1899f7ed17ec 23 BoilerSetFullSpeedSecs(value);
andrewboyson 105:1899f7ed17ec 24 return;
andrewboyson 105:1899f7ed17ec 25 }
andrewboyson 91:8b192efd0288 26 if (HttpSameStr(pName, "tanksetpoint" ))
andrewboyson 91:8b192efd0288 27 {
andrewboyson 91:8b192efd0288 28 int value = HttpQueryValueAsInt(pValue);
andrewboyson 91:8b192efd0288 29 BoilerSetTankSetPoint(value);
andrewboyson 91:8b192efd0288 30 return;
andrewboyson 91:8b192efd0288 31 }
andrewboyson 91:8b192efd0288 32 if (HttpSameStr(pName, "tankhysteresis"))
andrewboyson 91:8b192efd0288 33 {
andrewboyson 91:8b192efd0288 34 int value = HttpQueryValueAsInt(pValue);
andrewboyson 91:8b192efd0288 35 BoilerSetTankHysteresis(value);
andrewboyson 91:8b192efd0288 36 return;
andrewboyson 91:8b192efd0288 37 }
andrewboyson 91:8b192efd0288 38 if (HttpSameStr(pName, "boilerresidual"))
andrewboyson 91:8b192efd0288 39 {
andrewboyson 91:8b192efd0288 40 double value = HttpQueryValueAsDouble(pValue);
andrewboyson 105:1899f7ed17ec 41 BoilerSetRunOnDeltaT((int)(value * 16));
andrewboyson 91:8b192efd0288 42 return;
andrewboyson 91:8b192efd0288 43 }
andrewboyson 91:8b192efd0288 44 if (HttpSameStr(pName, "boilerrunon" ))
andrewboyson 91:8b192efd0288 45 {
andrewboyson 91:8b192efd0288 46 int value = HttpQueryValueAsInt(pValue);
andrewboyson 91:8b192efd0288 47 BoilerSetRunOnTime(value);
andrewboyson 91:8b192efd0288 48 return;
andrewboyson 91:8b192efd0288 49 }
andrewboyson 104:46ce1aaf8be7 50 if (HttpSameStr(pName, "pumpspeedcalling"))
andrewboyson 104:46ce1aaf8be7 51 {
andrewboyson 105:1899f7ed17ec 52 if (!pValue) return;
andrewboyson 105:1899f7ed17ec 53 switch (pValue[0])
andrewboyson 105:1899f7ed17ec 54 {
andrewboyson 105:1899f7ed17ec 55 case 0 : return;
andrewboyson 105:1899f7ed17ec 56 case 'a':
andrewboyson 105:1899f7ed17ec 57 case 'A': BoilerSetPumpSpeedCalling(-1); return;
andrewboyson 105:1899f7ed17ec 58 case 't':
andrewboyson 105:1899f7ed17ec 59 case 'T': BoilerSetPumpSpeedCalling(-2); return;
andrewboyson 105:1899f7ed17ec 60 }
andrewboyson 104:46ce1aaf8be7 61 int value = HttpQueryValueAsInt(pValue);
andrewboyson 104:46ce1aaf8be7 62 BoilerSetPumpSpeedCalling(value);
andrewboyson 104:46ce1aaf8be7 63 return;
andrewboyson 104:46ce1aaf8be7 64 }
andrewboyson 104:46ce1aaf8be7 65 if (HttpSameStr(pName, "pumpspeedrunon"))
andrewboyson 104:46ce1aaf8be7 66 {
andrewboyson 104:46ce1aaf8be7 67 int value = HttpQueryValueAsInt(pValue);
andrewboyson 104:46ce1aaf8be7 68 BoilerSetPumpSpeedRunOn(value);
andrewboyson 104:46ce1aaf8be7 69 return;
andrewboyson 104:46ce1aaf8be7 70 }
andrewboyson 104:46ce1aaf8be7 71 if (HttpSameStr(pName, "boileroutputtarget"))
andrewboyson 104:46ce1aaf8be7 72 {
andrewboyson 104:46ce1aaf8be7 73 int value = HttpQueryValueAsInt(pValue);
andrewboyson 104:46ce1aaf8be7 74 BoilerSetOutputTarget(value);
andrewboyson 104:46ce1aaf8be7 75 return;
andrewboyson 104:46ce1aaf8be7 76 }
andrewboyson 104:46ce1aaf8be7 77 if (HttpSameStr(pName, "blrriseat0"))
andrewboyson 104:46ce1aaf8be7 78 {
andrewboyson 104:46ce1aaf8be7 79 double value = HttpQueryValueAsDouble(pValue);
andrewboyson 105:1899f7ed17ec 80 BoilerSetMinimumFlow(value);
andrewboyson 104:46ce1aaf8be7 81 return;
andrewboyson 104:46ce1aaf8be7 82 }
andrewboyson 104:46ce1aaf8be7 83 if (HttpSameStr(pName, "blrriseat50"))
andrewboyson 104:46ce1aaf8be7 84 {
andrewboyson 104:46ce1aaf8be7 85 double value = HttpQueryValueAsDouble(pValue);
andrewboyson 105:1899f7ed17ec 86 BoilerSetMidFlowSpeed(value);
andrewboyson 104:46ce1aaf8be7 87 return;
andrewboyson 104:46ce1aaf8be7 88 }
andrewboyson 104:46ce1aaf8be7 89 if (HttpSameStr(pName, "blrriseat100"))
andrewboyson 104:46ce1aaf8be7 90 {
andrewboyson 104:46ce1aaf8be7 91 double value = HttpQueryValueAsDouble(pValue);
andrewboyson 105:1899f7ed17ec 92 BoilerSetFullSpeedDeltaT((int)(value * 16));
andrewboyson 104:46ce1aaf8be7 93 return;
andrewboyson 104:46ce1aaf8be7 94 }
andrewboyson 24:e3ed1b52c6e6 95 }
andrewboyson 24:e3ed1b52c6e6 96 }