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