Sun, 24 May 2020 12:12:34 +0200
Fixed temperature gauge update after an error.
0 | 1 | /** |
2 | * @file bms.h | |
3 | */ | |
4 | ||
5 | #ifndef _BMS_H | |
6 | #define _BMS_H | |
7 | ||
8 | #define TRUE 1 | |
9 | #define FALSE 0 | |
10 | ||
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 |
0 | 81 | } sys_config; |
82 | ||
83 | ||
84 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
85 | * @brief Structure for the nodes. Database table 'mon_nodes'. |
0 | 86 | */ |
87 | typedef struct _sys_node_list { | |
88 | struct _sys_node_list *next; | |
89 | char *uuid; ///< uuid string | |
90 | char *node; ///< nodename | |
91 | bool online; ///< on-line state | |
92 | char *group_id; ///< group type | |
93 | char *hardwaremake; ///< hardware make | |
94 | char *hardwaremodel; ///< hardware model | |
95 | char *os; ///< os type | |
96 | char *os_version; ///< os version | |
97 | char *firmware; ///< application version | |
98 | time_t firstseen; ///< First seen this session | |
99 | time_t lastseen; ///< Last seen this session | |
100 | float temperature; ///< environment temperature | |
101 | float humidity; ///< environment humidity | |
102 | float barometer; ///< environment barometer pressure | |
103 | float gps_latitude; ///< GPS latitude | |
104 | float gps_longitude; ///< GPS longitude | |
105 | float gps_altitude; ///< GPS altitude | |
106 | char *net_address; ///< IPv4 or IPv6 address | |
107 | char *net_ifname; ///< Interface name | |
108 | 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
|
109 | int interval; ///< Update interval |
0 | 110 | } sys_node_list; |
111 | ||
112 | ||
113 | /** | |
114 | * @brief Fermenting profile steps | |
115 | */ | |
116 | typedef struct _prof_step { | |
117 | struct _prof_step *next; | |
118 | int steptime; ///< Step time to target in hours | |
119 | int resttime; ///< Rest time on target in hours | |
120 | float target_lo; ///< Low Target temperature | |
121 | float target_hi; ///< High target temperature | |
122 | int fridge_mode; ///< Fridge or beer mode | |
123 | } prof_step; | |
124 | ||
125 | ||
126 | typedef enum | |
127 | { | |
128 | FERMENTER_MODE_OFF = 0, ///< Fermenter is off. | |
129 | FERMENTER_MODE_NONE, ///< Fermenter on but does nothing. | |
130 | FERMENTER_MODE_FRIDGE, ///< Fermenter acts as a fridge. | |
131 | FERMENTER_MODE_BEER, ///< Fermenter acts as beer cooler. | |
132 | FERMENTER_MODE_PROFILE, ///< Fermenter runs in profile mode. | |
133 | } FERMENTER_MODE; | |
134 | ||
135 | typedef enum | |
136 | { | |
137 | FERMENTER_STAGE_PRIMARY = 0, ///< Fermentation primage stage. | |
138 | FERMENTER_STAGE_SECONDARY, ///< Fermenter secondary stage. | |
139 | FERMENTER_STAGE_TERTIARY, ///< Fermenter tertiary stage. | |
34 | 140 | FERMENTER_STAGE_CARBONATION, ///< Fermenter carbonation stage. |
0 | 141 | } FERMENTER_STAGE; |
142 | ||
143 | typedef enum | |
144 | { | |
145 | DEVPRESENT_UNDEF = 0, ///< Precence not detectable. | |
146 | DEVPRESENT_NO, ///< Device is missing. | |
147 | DEVPRESENT_YES, ///< Device is present and Ok. | |
148 | DEVPRESENT_ERROR, ///< Device is present but in error state. | |
149 | } DEVPRESENT_STATE; | |
150 | ||
151 | ||
152 | typedef enum | |
153 | { | |
154 | ALARM_FLAG_DOOR = 0x0001, ///< Door open | |
155 | 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
|
156 | ALARM_FLAG_BATTERY = 0x0004, ///< Low battery |
0 | 157 | ALARM_FLAG_CHILLER = 0x0100, ///< Chiller too warm |
158 | } ALARM_FLAGS; | |
159 | ||
160 | ||
161 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
162 | * @brief Structure for the fermenters. Stored in database table 'mon_fermenters'. |
0 | 163 | */ |
164 | typedef struct _fermenter_list { | |
165 | struct _fermenter_list *next; | |
166 | char *uuid; ///< Fixed uuid string | |
167 | char *alias; ///< Fixed short name | |
168 | char *node; ///< Fixed node name | |
169 | bool online; ///< Online status | |
170 | char *beercode; ///< Beer unique code | |
171 | char *beername; ///< Beer name in fermenter | |
192
7f69b43e6084
Implemented beer uuid product in monitor fermenters.
Michiel Broek <mbroek@mbse.eu>
parents:
81
diff
changeset
|
172 | char *beeruuid; ///< Beer uuid in fermenter |
0 | 173 | char *air_address; ///< Air sensor address |
174 | char *air_state; ///< Air sensor state | |
175 | float air_temperature; ///< Air temperature | |
176 | char *beer_address; ///< Beer sensor address | |
177 | char *beer_state; ///< Beer sensor state | |
178 | float beer_temperature; ///< Beer temperature | |
179 | char *chiller_address; ///< Chiller sensor address | |
180 | char *chiller_state; ///< Chiller sensor state | |
181 | float chiller_temperature; ///< Chiller temperature | |
182 | char *heater_address; ///< Heater address | |
183 | int heater_state; ///< Heater state | |
184 | uint64_t heater_usage; ///< Heater usage | |
185 | char *cooler_address; ///< Cooler address | |
186 | int cooler_state; ///< Cooler state | |
187 | uint64_t cooler_usage; ///> Cooler usage | |
188 | char *fan_address; ///< Fan address | |
189 | int fan_state; ///< Fan state | |
190 | uint64_t fan_usage; ///< Fan usage | |
191 | char *light_address; ///< Light address | |
192 | int light_state; ///< Light state | |
193 | uint64_t light_usage; ///< Light usage | |
194 | char *door_address; ///< Door address | |
195 | int door_state; ///< Door state | |
196 | char *psu_address; ///< PSU address | |
197 | int psu_state; ///< PSU state | |
198 | char *mode; ///< Fermenter mode | |
199 | char *stage; ///< Fermentation stage | |
200 | uint32_t alarm; ///< Alarm flag | |
201 | float setpoint_high; ///< Setpoint high | |
202 | float setpoint_low; ///< Setpoint low | |
203 | char *profile_uuid; ///< Profile uuid | |
204 | char *profile_name; ///< Profile name | |
205 | char *profile_state; ///< Profile state | |
206 | int profile_percent; ///< Profile percent done | |
207 | float profile_inittemp_high; ///< Profile init temp high | |
208 | float profile_inittemp_low; ///< Profile init temp low | |
209 | 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
|
210 | 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
|
211 | 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
|
212 | 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
|
213 | int webcam_light; ///< Webcam control lights |
0 | 214 | } sys_fermenter_list; |
215 | ||
216 | ||
217 | ||
218 | typedef enum | |
219 | { | |
220 | PROFILE_OFF = 0, ///< Profile not active | |
221 | PROFILE_PAUSE, ///< Profile pause | |
222 | PROFILE_RUN, ///< Profile is running | |
223 | PROFILE_DONE, ///< Profile is finished | |
224 | PROFILE_ABORT, ///< Profile abort | |
225 | } PROFILE_STATE; | |
226 | ||
227 | ||
228 | ||
229 | /** | |
230 | * @brief Strcuture holding a fermentation log entry. | |
231 | */ | |
232 | typedef struct fermenting_log { | |
233 | char *datetime; ///< Date/time stamp | |
234 | char *product_uuid; ///< Product uuid | |
235 | char *product_code; ///< Product code | |
236 | char *product_name; ///< Product name | |
237 | float temperature_air; ///< Temperature air | |
238 | float temperature_beer; ///< Temperature beer | |
239 | float temperature_chiller; ///< Temperature chiller (if pressent) | |
240 | float temperature_room; ///< Temperature room | |
241 | int heater_power; ///< Heater power 0..100 | |
242 | uint64_t heater_usage; ///< Heater usage counter in seconds. | |
243 | int cooler_power; ///< Cooler power 0..100 | |
244 | uint64_t cooler_usage; ///< Cooler usage counter in seconds. | |
245 | int fan_power; ///< Fan power 0 or 100 | |
246 | uint64_t fan_usage; ///< Fan usage counter in seconds | |
247 | 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
|
248 | float setpoint_high; ///< Target temperature high |
0 | 249 | char *mode; ///< Working mode. |
250 | char *stage; ///< Fermentation stage | |
251 | char *event; ///< Optional event | |
252 | char *fermenter_uuid; ///< Fermenter in use | |
253 | char *fermenter_node; ///< Fermenter node | |
254 | char *fermenter_alias; ///< Fermenter_alias | |
255 | } fermentation_log; | |
256 | ||
257 | ||
258 | ||
259 | /** | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
260 | * @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
|
261 | */ |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
262 | typedef struct _co2meter_list { |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
263 | struct _co2meter_list *next; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
264 | char *uuid; ///< Fixed uuid string |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
265 | char *alias; ///< Fixed short name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
266 | char *node; ///< Fixed node name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
267 | bool online; ///< Online status |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
268 | char *mode; ///< Working mode |
505
c09b67fd8323
Added CO2 meter units alarm led.
Michiel Broek <mbroek@mbse.eu>
parents:
502
diff
changeset
|
269 | uint32_t alarm; ///< Alarm bits |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
270 | char *beercode; ///< Beer unique code |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
271 | char *beername; ///< Beer name in fermenter |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
272 | char *beeruuid; ///< Beer uuid in fermenter |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
273 | char *temperature_state; ///< Temperature sensor state |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
274 | char *temperature_address; ///< Temperature sensor address |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
275 | float temperature; ///< Temperature value |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
276 | char *pressure_state; ///< Pressure sensor state |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
277 | uint8_t pressure_channel; ///< Pressure sensor channel |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
278 | float pressure_voltage; ///< Pressure voltage reading |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
279 | float pressure_zero; ///< Pressure zero offset voltage |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
280 | float pressure_bar; ///< Pressure in bar |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
281 | } sys_co2meter_list; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
282 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
283 | |
506
8ab0e87d579e
Added beer selection in the CO2 meter screen. Added CO2 pressure logging.
Michiel Broek <mbroek@mbse.eu>
parents:
505
diff
changeset
|
284 | |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
285 | /** |
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
|
286 | * @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
|
287 | */ |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
288 | typedef struct co2meter_log { |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
289 | char *datetime; ///< Date/time stamp |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
290 | char *product_uuid; ///< Product uuid |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
291 | char *product_code; ///< Product code |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
292 | char *product_name; ///< Product name |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
293 | float temperature; ///< Temperature |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
294 | 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
|
295 | 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
|
296 | 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
|
297 | char *alias; ///< Unit alias |
502
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
298 | } co2pressure_log; |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
299 | |
a8a6901b5a99
Added CO2 meter units to the daemon.
Michiel Broek <mbroek@mbse.eu>
parents:
334
diff
changeset
|
300 | |
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 | /** |
0 | 303 | * @brief Brew computer controllers. Must have hardware + installation + recipe data. |
304 | */ | |
305 | typedef struct _brewer_list { | |
306 | struct _brewer_list *next; | |
307 | char *uuid; | |
308 | } brewer_list; | |
309 | ||
310 | ||
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
311 | // Make it universal and make it connectable with a beer. |
0 | 312 | typedef struct _ispindel_list { |
313 | 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
|
314 | 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
|
315 | char *alias; ///< Alias name. |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
316 | char *node; ///< Node name received. |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
317 | 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
|
318 | 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
|
319 | uint32_t alarm; ///< Alarm flags. |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
320 | char *beercode; ///< Beer unique code |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
321 | char *beername; ///< Beer name being measured |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
322 | 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
|
323 | 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
|
324 | float temperature; ///< Temperature in C |
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
325 | 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
|
326 | float gravity; ///< Gravity in Plato |
567
6bf0afc33e70
Initial code for iSpindel support in the daemon
Michiel Broek <mbroek@mbse.eu>
parents:
551
diff
changeset
|
327 | 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
|
328 | 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
|
329 | } sys_ispindel_list; |
0 | 330 | |
331 | ||
332 | ||
333 | #endif |