Tue, 31 Aug 2021 20:48:37 +0200
Split batch, adjust mash step volume. In the duplicated log_brew handle the missing values. In save product, round the mash step sg to 4 decimals. In prod_edit, ingredients are stored as strings, not arrays. This triggered a memory corruption that only happened in rare circumstances. Don't fix mash step fields in the javascript, it is already done during load from the database. Calculation of the mash volume is rounded to 6 decimals. Enter mash step Brix/Plato value, the SG result is rounded to 4 decimals.
0 | 1 | /** |
2 | * @file bms.h | |
3 | */ | |
4 | ||
5 | #ifndef _BMS_H | |
6 | #define _BMS_H | |
7 | ||
8 | ||
746
44d929ff268e
Can start the daemon as root, and it will drop privileges.
Michiel Broek <mbroek@mbse.eu>
parents:
703
diff
changeset
|
9 | #define _GNU_SOURCE // for secure_getenv() |
44d929ff268e
Can start the daemon as root, and it will drop privileges.
Michiel Broek <mbroek@mbse.eu>
parents:
703
diff
changeset
|
10 | |
0 | 11 | #include "../config.h" |
12 | ||
13 | #include <stdlib.h> | |
14 | #include <stdio.h> | |
15 | #include <stdint.h> | |
16 | #include <stdarg.h> | |
17 | #include <string.h> | |
18 | #include <ctype.h> | |
19 | #include <sys/types.h> | |
20 | #include <sys/socket.h> | |
21 | #include <sys/stat.h> | |
22 | #include <sys/time.h> | |
23 | #include <sys/un.h> | |
24 | #include <sys/utsname.h> | |
25 | #include <pwd.h> | |
26 | #include <time.h> | |
27 | #include <fcntl.h> | |
28 | #include <syslog.h> | |
29 | #include <unistd.h> | |
30 | #include <errno.h> | |
31 | #include <signal.h> | |
32 | #include <getopt.h> | |
33 | #include <limits.h> | |
34 | #include <sys/socket.h> | |
35 | #include <arpa/inet.h> | |
36 | #include <netdb.h> | |
37 | #include <poll.h> | |
38 | #include <dirent.h> | |
39 | #include <uuid/uuid.h> | |
40 | #include <math.h> | |
41 | #include <assert.h> | |
42 | #include <libgen.h> | |
671
4b54d6f79d25
Version 0.3.33 Added websockets framework. Added fermenter status messages to the websockets broadcast.
Michiel Broek <mbroek@mbse.eu>
parents:
578
diff
changeset
|
43 | #include <pthread.h> |
0 | 44 | #include <libxml/xmlmemory.h> |
45 | #include <libxml/parser.h> | |
46 | #include <libxml/encoding.h> | |
47 | #include <libxml/xmlwriter.h> | |
48 | #include <mosquitto.h> | |
551
57cb71496a9a
Compile fix for Debian Buster.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
49 | #ifdef HAVE_MYSQL_MYSQL_H |
0 | 50 | #include <mysql/mysql.h> |
551
57cb71496a9a
Compile fix for Debian Buster.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
51 | #endif |
57cb71496a9a
Compile fix for Debian Buster.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
52 | #ifdef HAVE_MARIADB_MYSQL_H |
57cb71496a9a
Compile fix for Debian Buster.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
53 | #include <mariadb/mysql.h> |
57cb71496a9a
Compile fix for Debian Buster.
Michiel Broek <mbroek@mbse.eu>
parents:
506
diff
changeset
|
54 | #endif |
0 | 55 | #include <json-c/json.h> |
56 | ||
57 | ||
58 | #define MBSE_SS(x) (x)?(x):"(null)" | |
59 | ||
60 | ||
61 | #define MQTT_NODE_CONTROL 0x0001 ///< Show node control | |
572
7a03181d29a3
Version 0.3.27 More code for iSpindels. All online/offline data in the database is now handles as integers. Nodes timeout use the configured interval time from the nodes.
Michiel Broek <mbroek@mbse.eu>
parents:
567
diff
changeset
|
62 | #define LOWBATT 3.3 ///< Low battery voltage |
0 | 63 | |
64 | ||
65 | /** | |
66 | * @brief Configuration structure. Stored in a flat ascii file ~/.bms/bms.config | |
67 | */ | |
68 | typedef struct _sys_config { | |
69 | char *bms_name; ///< Brewery name | |
70 | char *bms_uuid; ///< Brewery uuid | |
71 | char *mysql_host; ///< MySQL host | |
72 | int mysql_port; ///< MySQL port | |
73 | char *mysql_user; ///< MySQL user name | |
74 | char *mysql_pass; ///< MySQL password | |
75 | char *mysql_database; ///< MySQL database | |
76 | char *mqtt_host; ///< MQTT host | |
77 | int mqtt_port; ///< MQTT port | |
78 | char *mqtt_user; ///< MQTT username of NULL | |
79 | char *mqtt_pass; ///< MQTT password of NULL | |
194
d202777ebae5
Added design notes for the csv log format from fermenters. In bmsd configuration added the web_root entry. Switched fermenter DLOG messages to store the log in flat csv files instead of the database. This is much faster and the graphs look better.
Michiel Broek <mbroek@mbse.eu>
parents:
192
diff
changeset
|
80 | char *web_root; ///< WWW root directory |
696
f4de55f587c1
Added websocket_port to the bms.conf file. Log the used port number.
Michiel Broek <mbroek@mbse.eu>
parents:
680
diff
changeset
|
81 | int websocket_port; ///< Websocket port |
0 | 82 | } sys_config; |
83 | ||
84 | ||
85 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
86 | * @brief Structure for the nodes. Database table 'mon_nodes'. |
0 | 87 | */ |
88 | typedef struct _sys_node_list { | |
89 | struct _sys_node_list *next; | |
90 | char *uuid; ///< uuid string | |
91 | char *node; ///< nodename | |
92 | bool online; ///< on-line state | |
93 | char *group_id; ///< group type | |
94 | char *hardwaremake; ///< hardware make | |
95 | char *hardwaremodel; ///< hardware model | |
96 | char *os; ///< os type | |
97 | char *os_version; ///< os version | |
98 | char *firmware; ///< application version | |
99 | time_t firstseen; ///< First seen this session | |
100 | time_t lastseen; ///< Last seen this session | |
101 | float temperature; ///< environment temperature | |
102 | float humidity; ///< environment humidity | |
103 | float barometer; ///< environment barometer pressure | |
104 | float gps_latitude; ///< GPS latitude | |
105 | float gps_longitude; ///< GPS longitude | |
106 | float gps_altitude; ///< GPS altitude | |
107 | char *net_address; ///< IPv4 or IPv6 address | |
108 | char *net_ifname; ///< Interface name | |
109 | int net_rssi; ///< RSSI value if wireless. | |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
110 | int interval; ///< Update interval |
703
faeede125639
Version 0.3.35 Added nodes database net_ssid field.
Michiel Broek <mbroek@mbse.eu>
parents:
696
diff
changeset
|
111 | char *net_ssid; ///< WiFi SSID |
0 | 112 | } sys_node_list; |
113 | ||
114 | ||
115 | /** | |
116 | * @brief Fermenting profile steps | |
117 | */ | |
118 | typedef struct _prof_step { | |
119 | struct _prof_step *next; | |
120 | int steptime; ///< Step time to target in hours | |
121 | int resttime; ///< Rest time on target in hours | |
122 | float target_lo; ///< Low Target temperature | |
123 | float target_hi; ///< High target temperature | |
124 | int fridge_mode; ///< Fridge or beer mode | |
125 | } prof_step; | |
126 | ||
127 | ||
128 | typedef enum | |
129 | { | |
130 | FERMENTER_MODE_OFF = 0, ///< Fermenter is off. | |
131 | FERMENTER_MODE_NONE, ///< Fermenter on but does nothing. | |
132 | FERMENTER_MODE_FRIDGE, ///< Fermenter acts as a fridge. | |
133 | FERMENTER_MODE_BEER, ///< Fermenter acts as beer cooler. | |
134 | FERMENTER_MODE_PROFILE, ///< Fermenter runs in profile mode. | |
135 | } FERMENTER_MODE; | |
136 | ||
137 | typedef enum | |
138 | { | |
139 | FERMENTER_STAGE_PRIMARY = 0, ///< Fermentation primage stage. | |
140 | FERMENTER_STAGE_SECONDARY, ///< Fermenter secondary stage. | |
141 | FERMENTER_STAGE_TERTIARY, ///< Fermenter tertiary stage. | |
34 | 142 | FERMENTER_STAGE_CARBONATION, ///< Fermenter carbonation stage. |
0 | 143 | } FERMENTER_STAGE; |
144 | ||
145 | typedef enum | |
146 | { | |
147 | DEVPRESENT_UNDEF = 0, ///< Precence not detectable. | |
148 | DEVPRESENT_NO, ///< Device is missing. | |
149 | DEVPRESENT_YES, ///< Device is present and Ok. | |
150 | DEVPRESENT_ERROR, ///< Device is present but in error state. | |
151 | } DEVPRESENT_STATE; | |
152 | ||
153 | ||
154 | typedef enum | |
155 | { | |
156 | ALARM_FLAG_DOOR = 0x0001, ///< Door open | |
157 | ALARM_FLAG_PSU = 0x0002, ///< PSU problem | |
572
7a03181d29a3
Version 0.3.27 More code for iSpindels. All online/offline data in the database is now handles as integers. Nodes timeout use the configured interval time from the nodes.
Michiel Broek <mbroek@mbse.eu>
parents:
567
diff
changeset
|
158 | ALARM_FLAG_BATTERY = 0x0004, ///< Low battery |
0 | 159 | ALARM_FLAG_CHILLER = 0x0100, ///< Chiller too warm |
160 | } ALARM_FLAGS; | |
161 | ||
162 | ||
163 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
164 | * @brief Structure for the fermenters. Stored in database table 'mon_fermenters'. |
0 | 165 | */ |
166 | typedef struct _fermenter_list { | |
167 | struct _fermenter_list *next; | |
168 | char *uuid; ///< Fixed uuid string | |
169 | char *alias; ///< Fixed short name | |
170 | char *node; ///< Fixed node name | |
171 | bool online; ///< Online status | |
172 | char *beercode; ///< Beer unique code | |
173 | char *beername; ///< Beer name in fermenter | |
192
7f69b43e6084
Implemented beer uuid product in monitor fermenters.
Michiel Broek <mbroek@mbse.eu>
parents:
81
diff
changeset
|
174 | char *beeruuid; ///< Beer uuid in fermenter |
0 | 175 | char *air_address; ///< Air sensor address |
176 | char *air_state; ///< Air sensor state | |
177 | float air_temperature; ///< Air temperature | |
178 | char *beer_address; ///< Beer sensor address | |
179 | char *beer_state; ///< Beer sensor state | |
180 | float beer_temperature; ///< Beer temperature | |
181 | char *chiller_address; ///< Chiller sensor address | |
182 | char *chiller_state; ///< Chiller sensor state | |
183 | float chiller_temperature; ///< Chiller temperature | |
184 | char *heater_address; ///< Heater address | |
185 | int heater_state; ///< Heater state | |
186 | uint64_t heater_usage; ///< Heater usage | |
187 | char *cooler_address; ///< Cooler address | |
188 | int cooler_state; ///< Cooler state | |
189 | uint64_t cooler_usage; ///> Cooler usage | |
190 | char *fan_address; ///< Fan address | |
191 | int fan_state; ///< Fan state | |
192 | uint64_t fan_usage; ///< Fan usage | |
193 | char *light_address; ///< Light address | |
194 | int light_state; ///< Light state | |
195 | uint64_t light_usage; ///< Light usage | |
196 | char *door_address; ///< Door address | |
197 | int door_state; ///< Door state | |
198 | char *psu_address; ///< PSU address | |
199 | int psu_state; ///< PSU state | |
200 | char *mode; ///< Fermenter mode | |
201 | char *stage; ///< Fermentation stage | |
202 | uint32_t alarm; ///< Alarm flag | |
203 | float setpoint_high; ///< Setpoint high | |
204 | float setpoint_low; ///< Setpoint low | |
205 | char *profile_uuid; ///< Profile uuid | |
206 | char *profile_name; ///< Profile name | |
207 | char *profile_state; ///< Profile state | |
208 | int profile_percent; ///< Profile percent done | |
209 | float profile_inittemp_high; ///< Profile init temp high | |
210 | float profile_inittemp_low; ///< Profile init temp low | |
211 | char *profile_steps; ///< Profile steps in JSON | |
299
047ead629d4a
Accept yeast temperature limits from thermferm via MQTT. Send yeat temperature ranges to thermferm together with the beer parameters. Store yeast temperature limits in the mon_fermenters database table. The monitor fermenters screen adjusts the temperature color ranges.
Michiel Broek <mbroek@mbse.eu>
parents:
194
diff
changeset
|
212 | float yeast_lo; ///< Yeast minimum temperature |
047ead629d4a
Accept yeast temperature limits from thermferm via MQTT. Send yeat temperature ranges to thermferm together with the beer parameters. Store yeast temperature limits in the mon_fermenters database table. The monitor fermenters screen adjusts the temperature color ranges.
Michiel Broek <mbroek@mbse.eu>
parents:
194
diff
changeset
|
213 | float yeast_hi; ///< Yeast maximum temperature |
334
26c6f8e5d58e
Added webcam_url and webcam_light fields to the mon_fermenters database table. Currently these fields need to be set using phpMyAdmin or another tool. If the webcam_url field is set, then on the mon_fermenter webpage a button is added to show a webcam page.
Michiel Broek <mbroek@mbse.eu>
parents:
299
diff
changeset
|
214 | char *webcam_url; ///< Webcam url to the stream |
26c6f8e5d58e
Added webcam_url and webcam_light fields to the mon_fermenters database table. Currently these fields need to be set using phpMyAdmin or another tool. If the webcam_url field is set, then on the mon_fermenter webpage a button is added to show a webcam page.
Michiel Broek <mbroek@mbse.eu>
parents:
299
diff
changeset
|
215 | int webcam_light; ///< Webcam control lights |
0 | 216 | } sys_fermenter_list; |
217 | ||
218 | ||
219 | ||
220 | typedef enum | |
221 | { | |
222 | PROFILE_OFF = 0, ///< Profile not active | |
223 | PROFILE_PAUSE, ///< Profile pause | |
224 | PROFILE_RUN, ///< Profile is running | |
225 | PROFILE_DONE, ///< Profile is finished | |
226 | PROFILE_ABORT, ///< Profile abort | |
227 | } PROFILE_STATE; | |
228 | ||
229 | ||
230 | ||
231 | /** | |
232 | * @brief Strcuture holding a fermentation log entry. | |
233 | */ | |
234 | typedef struct fermenting_log { | |
235 | char *datetime; ///< Date/time stamp | |
236 | char *product_uuid; ///< Product uuid | |
237 | char *product_code; ///< Product code | |
238 | char *product_name; ///< Product name | |
239 | float temperature_air; ///< Temperature air | |
240 | float temperature_beer; ///< Temperature beer | |
241 | float temperature_chiller; ///< Temperature chiller (if pressent) | |
242 | float temperature_room; ///< Temperature room | |
243 | int heater_power; ///< Heater power 0..100 | |
244 | uint64_t heater_usage; ///< Heater usage counter in seconds. | |
245 | int cooler_power; ///< Cooler power 0..100 | |
246 | uint64_t cooler_usage; ///< Cooler usage counter in seconds. | |
247 | int fan_power; ///< Fan power 0 or 100 | |
248 | uint64_t fan_usage; ///< Fan usage counter in seconds | |
249 | float setpoint_low; ///< Target temperature low | |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
250 | float setpoint_high; ///< Target temperature high |
0 | 251 | char *mode; ///< Working mode. |
252 | char *stage; ///< Fermentation stage | |
253 | char *event; ///< Optional event | |
254 | char *fermenter_uuid; ///< Fermenter in use | |
255 | char *fermenter_node; ///< Fermenter node | |
256 | char *fermenter_alias; ///< Fermenter_alias | |
257 | } fermentation_log; | |
258 | ||
259 | ||
260 | ||
261 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
262 | * @brief Structure for the co2meters. Stored in database table 'mon_co2meters'. |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
263 | */ |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
264 | typedef struct _co2meter_list { |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
265 | struct _co2meter_list *next; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
266 | char *uuid; ///< Fixed uuid string |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
267 | char *alias; ///< Fixed short name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
268 | char *node; ///< Fixed node name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
269 | bool online; ///< Online status |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
270 | char *mode; ///< Working mode |
505
c09b67fd8323
Added CO2 meter units alarm led.
Michiel Broek <mbroek@mbse.eu>
parents:
502
diff
changeset
|
271 | uint32_t alarm; ///< Alarm bits |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
272 | char *beercode; ///< Beer unique code |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
273 | char *beername; ///< Beer name in fermenter |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
274 | char *beeruuid; ///< Beer uuid in fermenter |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
275 | char *temperature_state; ///< Temperature sensor state |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
276 | char *temperature_address; ///< Temperature sensor address |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
277 | float temperature; ///< Temperature value |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
278 | char *pressure_state; ///< Pressure sensor state |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
279 | uint8_t pressure_channel; ///< Pressure sensor channel |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
280 | float pressure_voltage; ///< Pressure voltage reading |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
281 | float pressure_zero; ///< Pressure zero offset voltage |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
282 | float pressure_bar; ///< Pressure in bar |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
283 | } sys_co2meter_list; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
284 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
285 | |
506
8ab0e87d579e
Added beer selection in the CO2 meter screen. Added CO2 pressure logging.
Michiel Broek <mbroek@mbse.eu>
parents:
505
diff
changeset
|
286 | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
287 | /** |
578
e75ce5bbda73
Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents:
572
diff
changeset
|
288 | * @brief Structure holding a co2 pressure log entry. |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
289 | */ |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
290 | typedef struct co2meter_log { |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
291 | char *datetime; ///< Date/time stamp |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
292 | char *product_uuid; ///< Product uuid |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
293 | char *product_code; ///< Product code |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
294 | char *product_name; ///< Product name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
295 | float temperature; ///< Temperature |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
296 | float pressure; ///< Pressure |
506
8ab0e87d579e
Added beer selection in the CO2 meter screen. Added CO2 pressure logging.
Michiel Broek <mbroek@mbse.eu>
parents:
505
diff
changeset
|
297 | char *uuid; ///< Unit uuid |
8ab0e87d579e
Added beer selection in the CO2 meter screen. Added CO2 pressure logging.
Michiel Broek <mbroek@mbse.eu>
parents:
505
diff
changeset
|
298 | char *node; ///< Unit node |
8ab0e87d579e
Added beer selection in the CO2 meter screen. Added CO2 pressure logging.
Michiel Broek <mbroek@mbse.eu>
parents:
505
diff
changeset
|
299 | char *alias; ///< Unit alias |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
300 | } co2pressure_log; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
301 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
302 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
303 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
304 | /** |
0 | 305 | * @brief Brew computer controllers. Must have hardware + installation + recipe data. |
306 | */ | |
307 | typedef struct _brewer_list { | |
308 | struct _brewer_list *next; | |
309 | char *uuid; | |
310 | } brewer_list; | |
311 | ||
312 | ||
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
313 | // Make it universal and make it connectable with a beer. |
0 | 314 | typedef struct _ispindel_list { |
315 | struct _ispindel_list *next; | |
578
e75ce5bbda73
Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents:
572
diff
changeset
|
316 | char *uuid; ///< Fixed uuid string. |
e75ce5bbda73
Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents:
572
diff
changeset
|
317 | char *alias; ///< Alias name. |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
318 | char *node; ///< Node name received. |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
319 | bool online; ///< Is considered online. |
578
e75ce5bbda73
Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents:
572
diff
changeset
|
320 | char *mode; ///< Working mode OFF or ON. |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
321 | uint32_t alarm; ///< Alarm flags. |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
322 | char *beercode; ///< Beer unique code |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
323 | char *beername; ///< Beer name being measured |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
324 | char *beeruuid; ///< Beer uuid being measured |
578
e75ce5bbda73
Changed the interface from the iSpindels to be the same as other devices. A webpage converts each call to two standard MQTT messages. The nodes MQTT message extended with an interval parameter. iSpindels now have a generated uuid made up from the chipid.
Michiel Broek <mbroek@mbse.eu>
parents:
572
diff
changeset
|
325 | float angle; ///< Tilt angle in degrees |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
326 | float temperature; ///< Temperature in C |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
327 | float battery; ///< Battery voltage |
680
0bb48333d133
Fixed missing co2meters websocket data. Added websockets and removed polling for the mon-ispindel screen. The iSpindel SG gauge adjusts the resolution to the highest detected OG.
Michiel Broek <mbroek@mbse.eu>
parents:
671
diff
changeset
|
328 | float gravity; ///< Gravity in Plato |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
329 | int interval; ///< Measure interval |
680
0bb48333d133
Fixed missing co2meters websocket data. Added websockets and removed polling for the mon-ispindel screen. The iSpindel SG gauge adjusts the resolution to the highest detected OG.
Michiel Broek <mbroek@mbse.eu>
parents:
671
diff
changeset
|
330 | float og_gravity; ///< OG gravity in Plato detected |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
331 | } sys_ispindel_list; |
0 | 332 | |
333 | ||
334 | ||
335 | #endif |