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
web-this/boiler/web-boiler-query.c@104:46ce1aaf8be7, 2021-02-10 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Feb 10 17:24:36 2021 +0000
- Revision:
- 104:46ce1aaf8be7
- Parent:
- 91:8b192efd0288
- Child:
- 105:1899f7ed17ec
Added PWM speed control to the boiler pump.
Who changed what in which revision?
User | Revision | Line number | New 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 | 24:e3ed1b52c6e6 | 13 | |
andrewboyson | 91:8b192efd0288 | 14 | if (HttpSameStr(pName, "tanksetpoint" )) |
andrewboyson | 91:8b192efd0288 | 15 | { |
andrewboyson | 91:8b192efd0288 | 16 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 91:8b192efd0288 | 17 | BoilerSetTankSetPoint(value); |
andrewboyson | 91:8b192efd0288 | 18 | return; |
andrewboyson | 91:8b192efd0288 | 19 | } |
andrewboyson | 91:8b192efd0288 | 20 | if (HttpSameStr(pName, "tankhysteresis")) |
andrewboyson | 91:8b192efd0288 | 21 | { |
andrewboyson | 91:8b192efd0288 | 22 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 91:8b192efd0288 | 23 | BoilerSetTankHysteresis(value); |
andrewboyson | 91:8b192efd0288 | 24 | return; |
andrewboyson | 91:8b192efd0288 | 25 | } |
andrewboyson | 91:8b192efd0288 | 26 | if (HttpSameStr(pName, "boilerresidual")) |
andrewboyson | 91:8b192efd0288 | 27 | { |
andrewboyson | 91:8b192efd0288 | 28 | double value = HttpQueryValueAsDouble(pValue); |
andrewboyson | 91:8b192efd0288 | 29 | BoilerSetRunOnResidual16ths((int)(value * 16)); |
andrewboyson | 91:8b192efd0288 | 30 | return; |
andrewboyson | 91:8b192efd0288 | 31 | } |
andrewboyson | 91:8b192efd0288 | 32 | if (HttpSameStr(pName, "boilerrunon" )) |
andrewboyson | 91:8b192efd0288 | 33 | { |
andrewboyson | 91:8b192efd0288 | 34 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 91:8b192efd0288 | 35 | BoilerSetRunOnTime(value); |
andrewboyson | 91:8b192efd0288 | 36 | return; |
andrewboyson | 91:8b192efd0288 | 37 | } |
andrewboyson | 104:46ce1aaf8be7 | 38 | if (HttpSameStr(pName, "pumpspeedcalling")) |
andrewboyson | 104:46ce1aaf8be7 | 39 | { |
andrewboyson | 104:46ce1aaf8be7 | 40 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 41 | BoilerSetPumpSpeedCalling(value); |
andrewboyson | 104:46ce1aaf8be7 | 42 | return; |
andrewboyson | 104:46ce1aaf8be7 | 43 | } |
andrewboyson | 104:46ce1aaf8be7 | 44 | if (HttpSameStr(pName, "pumpspeedrunon")) |
andrewboyson | 104:46ce1aaf8be7 | 45 | { |
andrewboyson | 104:46ce1aaf8be7 | 46 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 47 | BoilerSetPumpSpeedRunOn(value); |
andrewboyson | 104:46ce1aaf8be7 | 48 | return; |
andrewboyson | 104:46ce1aaf8be7 | 49 | } |
andrewboyson | 104:46ce1aaf8be7 | 50 | if (HttpSameStr(pName, "boileroutputtarget")) |
andrewboyson | 104:46ce1aaf8be7 | 51 | { |
andrewboyson | 104:46ce1aaf8be7 | 52 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 53 | BoilerSetOutputTarget(value); |
andrewboyson | 104:46ce1aaf8be7 | 54 | return; |
andrewboyson | 104:46ce1aaf8be7 | 55 | } |
andrewboyson | 104:46ce1aaf8be7 | 56 | if (HttpSameStr(pName, "blrriseat0")) |
andrewboyson | 104:46ce1aaf8be7 | 57 | { |
andrewboyson | 104:46ce1aaf8be7 | 58 | double value = HttpQueryValueAsDouble(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 59 | BoilerSetRise16thsAt0((int)(value * 16)); |
andrewboyson | 104:46ce1aaf8be7 | 60 | return; |
andrewboyson | 104:46ce1aaf8be7 | 61 | } |
andrewboyson | 104:46ce1aaf8be7 | 62 | if (HttpSameStr(pName, "blrriseat50")) |
andrewboyson | 104:46ce1aaf8be7 | 63 | { |
andrewboyson | 104:46ce1aaf8be7 | 64 | double value = HttpQueryValueAsDouble(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 65 | BoilerSetRise16thsAt50((int)(value * 16)); |
andrewboyson | 104:46ce1aaf8be7 | 66 | return; |
andrewboyson | 104:46ce1aaf8be7 | 67 | } |
andrewboyson | 104:46ce1aaf8be7 | 68 | if (HttpSameStr(pName, "blrriseat100")) |
andrewboyson | 104:46ce1aaf8be7 | 69 | { |
andrewboyson | 104:46ce1aaf8be7 | 70 | double value = HttpQueryValueAsDouble(pValue); |
andrewboyson | 104:46ce1aaf8be7 | 71 | BoilerSetRise16thsAt100((int)(value * 16)); |
andrewboyson | 104:46ce1aaf8be7 | 72 | return; |
andrewboyson | 104:46ce1aaf8be7 | 73 | } |
andrewboyson | 24:e3ed1b52c6e6 | 74 | } |
andrewboyson | 24:e3ed1b52c6e6 | 75 | } |