thermferm/thermferm.h

Sun, 05 May 2024 17:24:54 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 05 May 2024 17:24:54 +0200
changeset 730
6eba006ed8f5
parent 728
da038d0bed04
permissions
-rw-r--r--

Much faster shutdown of the websocket service.

51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
1 #ifndef _MBSELIB_H
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
2 #define _MBSELIB_H
26
9322c619c525 Added coolers program, first draft
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
9322c619c525 Added coolers program, first draft
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
9322c619c525 Added coolers program, first draft
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 #define TRUE 1
9322c619c525 Added coolers program, first draft
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 #define FALSE 0
9322c619c525 Added coolers program, first draft
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7
724
01e3936f62d4 Log pid of each started thread so we can see which uses the most cpu time.
Michiel Broek <mbroek@mbse.eu>
parents: 716
diff changeset
8 #define _GNU_SOURCE
01e3936f62d4 Log pid of each started thread so we can see which uses the most cpu time.
Michiel Broek <mbroek@mbse.eu>
parents: 716
diff changeset
9
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
10 #include "../config.h"
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 339
diff changeset
11 #include "pid.h"
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
12
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
13 #include <stdlib.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
14 #include <stdio.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
15 #include <stdint.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
16 #include <stdarg.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
17 #include <string.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
18 #include <ctype.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
19 #include <sys/types.h>
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
20 #include <sys/socket.h>
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
21 #include <sys/stat.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
22 #include <sys/time.h>
726
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
23 #include <sys/syscall.h>
420
644a6106d712 The first ideas of the brewpanel simulation are in place.
Michiel Broek <mbroek@mbse.eu>
parents: 418
diff changeset
24 #include <sys/un.h>
506
cdcd07bbee30 New MQTT protocol
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
25 #include <sys/utsname.h>
549
ee1bcad035f0 Versie 0.8.2. Node NBIRTH payload heeft nu netwerk informatie.
Michiel Broek <mbroek@mbse.eu>
parents: 544
diff changeset
26 #include <ifaddrs.h>
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
27 #include <time.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
28 #include <fcntl.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
29 #include <syslog.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
30 #include <unistd.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
31 #include <errno.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
32 #include <signal.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
33 #include <getopt.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
34 #include <limits.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
35 #include <sys/socket.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
36 #include <arpa/inet.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
37 #include <netdb.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
38 #include <poll.h>
84
ef4c0032b51f Can list the 1-wire bus
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
39 #include <dirent.h>
79
eb9dd60aa791 Added uuid library
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
40 #include <uuid/uuid.h>
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
41 #include <math.h>
550
04c942cded91 Versie 0.8.3. Enkele debug console berichten verwijderd. De MQTT NCMD reboot en rebirth commando's geimplementeerd.
Michiel Broek <mbroek@mbse.eu>
parents: 549
diff changeset
42 #include <json-c/json.h>
74
879bd09e2b96 Reinstalled threads
Michiel Broek <mbroek@mbse.eu>
parents: 73
diff changeset
43 #include <pthread.h>
73
4a28de5b9b47 Changed include files
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
44 #include <libxml/xmlmemory.h>
4a28de5b9b47 Changed include files
Michiel Broek <mbroek@mbse.eu>
parents: 72
diff changeset
45 #include <libxml/parser.h>
75
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
46 #include <libxml/encoding.h>
4b976601737d Writes a basic xml configuration next to the plain ascii config file
Michiel Broek <mbroek@mbse.eu>
parents: 74
diff changeset
47 #include <libxml/xmlwriter.h>
497
18ace27338e5 Compiles mosquitto code if library is found on the system. Bumped to version 0.5.4
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
48 #include <mosquitto.h>
18ace27338e5 Compiles mosquitto code if library is found on the system. Bumped to version 0.5.4
Michiel Broek <mbroek@mbse.eu>
parents: 420
diff changeset
49
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
50 #ifdef HAVE_WIRINGPI_H
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
51 /* wiringPi */
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
52 #include <wiringPi.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
53 #include <pcf8574.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
54 #include <lcd.h>
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
55
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
56 #endif
215
5ad534c79a22 Do not use 100% cpu on a system without devices
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
57
726
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
58
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
59 #ifndef HAVE_GETTID
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
60 pid_t gettid(void);
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
61 #endif
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
62
8289078ff7be Added test for gettid()
Michiel Broek <mbroek@mbse.eu>
parents: 724
diff changeset
63
240
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
64 /*
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
65 * Thread locks
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
66 */
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
67 #define LOCK_DEVICES 0
241
4ba138737bf4 Added thread locks to all LCD access functions. This seems to have fixed the LCD corruption problems.
Michiel Broek <mbroek@mbse.eu>
parents: 240
diff changeset
68 #define LOCK_LCD 1
244
2f868eaefec2 Selecting units in setup does now work. Menu select variables are protected with thread locking.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
69 #define LOCK_MENU 2
654
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
70 #define LOCK_ONE_WIRE 3
645
49eb753a958b All thread locks from wiringPi to standard pthreads.
Michiel Broek <mbroek@mbse.eu>
parents: 614
diff changeset
71 #define LOCK_SPARE3 4
240
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
72
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
73
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
74 /*
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
75 * Thread states
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
76 */
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
77 #define THREAD_OFF 0
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
78 #define THREAD_RUN 1
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
79 #define THREAD_PAUSE 2
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
80
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
81
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
82 /*
240
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
83 * Frontpanel menu numbers
6bdda35b4a13 Added thread locks for device processing
Michiel Broek <mbroek@mbse.eu>
parents: 218
diff changeset
84 */
214
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
85 #define MENU_NONE 0
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
86 #define MENU_TOP_DEFAULT 1
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
87 #define MENU_TOP_UNITS 2
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
88 #define MENU_UNITS 21
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
89 #define MENU_MODE_OFF 211
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
90 #define MENU_MODE_NONE 212
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
91 #define MENU_NONE_HEAT 2121
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
92 #define MENU_NONE_COOL 2122
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
93 #define MENU_NONE_FAN 2123
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
94 #define MENU_MODE_BEER 213
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
95 #define MENU_BEER_TEMP_LO 2131
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
96 #define MENU_BEER_TEMP_HI 2132
214
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
97 #define MENU_MODE_FRIDGE 214
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
98 #define MENU_FRIDGE_TEMP_LO 2141
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
99 #define MENU_FRIDGE_TEMP_HI 2142
214
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
100 #define MENU_MODE_PROFILE 215
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
101 #define MENU_PROFILE_START 2152
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
102 #define MENU_PROFILE_PAUSE 2153
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
103 #define MENU_PROFILE_ABORT 2154
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
104 #define MENU_PROFILE_RESUME 2155
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
105 #define MENU_PROFILE_GOOFF 2156
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
106 #define MENU_TOP_SYS 3
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
107 #define MENU_SYS_HALT 31
37d1eb0e1d66 Added a bunch of panel menus
Michiel Broek <mbroek@mbse.eu>
parents: 209
diff changeset
108 #define MENU_SYS_REBOOT 32
205
ca18ff45deba Start initial menu setup
Michiel Broek <mbroek@mbse.eu>
parents: 194
diff changeset
109
ca18ff45deba Start initial menu setup
Michiel Broek <mbroek@mbse.eu>
parents: 194
diff changeset
110
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
111
339
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
112 /*
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
113 * 1-Wire devices
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
114 */
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
115 #define W1_FAMILY_DEFAULT 0
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
116 #define W1_FAMILY_SMEM_01 0x01
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
117 #define W1_FAMILY_SMEM_81 0x81
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
118 #define W1_THERM_DS18S20 0x10
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
119 #define W1_FAMILY_DS28E04 0x1C
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
120 #define W1_COUNTER_DS2423 0x1D
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
121 #define W1_THERM_DS1822 0x22
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
122 #define W1_EEPROM_DS2433 0x23
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
123 #define W1_THERM_DS18B20 0x28
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
124 #define W1_FAMILY_DS2408 0x29
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
125 #define W1_EEPROM_DS2431 0x2D
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
126 #define W1_FAMILY_DS2760 0x30
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
127 #define W1_FAMILY_DS2780 0x32
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
128 #define W1_FAMILY_DS2413 0x3A
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
129 #define W1_THERM_DS1825 0x3B
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
130 #define W1_FAMILY_DS2781 0x3D
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
131 #define W1_THERM_DS28EA00 0x42
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
132
16203280eea2 Added defines copied from kernel source with 1-Wire device family numbers.
Michiel Broek <mbroek@mbse.eu>
parents: 313
diff changeset
133
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
134
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
135 #define MBSE_SS(x) (x)?(x):"(null)"
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
136
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
137
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
138 /*
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
139 * Fermenting steps
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
140 */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
141 typedef struct _prof_step {
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
142 struct _prof_step *next;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
143 char *name; /* Description of this step */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
144 int steptime; /* Step time to target in hours */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
145 int resttime; /* Rest time on target in hours */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
146 float target_lo; /* Low Target temperature */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
147 float target_hi; /* High target temperature */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
148 int fridge_mode; /* Fridge or beer mode */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
149 } prof_step;
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
150
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
151
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
152
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
153 /*
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
154 * Fermenter units. These units are connected via the 1-wire bus.
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
155 * Each unit can have:
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
156 * a DS18B20 sensor to measure the air temperature inside the unit.
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
157 * a DS18B20 sensor(s) to measure the beer temperature.
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
158 * a DS2408 to turn the cooler, heater and fans on or off. Sense door and PSU state.
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
159 */
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
160 typedef struct _units_list {
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
161 struct _units_list *next;
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
162 char *uuid; /* uid code */
554
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
163 char *product_uuid; /* Beer product uuid */
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
164 char *product_code; /* Beer product code */
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
165 char *product_name; /* Beer product name */
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 499
diff changeset
166 char *alias; /* alias name 'unit1' */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
167 char *air_address; /* DS18B20 address */
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 95
diff changeset
168 int air_state; /* 0=ok, 1=missing, 2=error */
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 95
diff changeset
169 int air_temperature; /* Air temperature in C * 1000 */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
170 int air_idx; /* Domoticz idx */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
171 char *beer_address; /* DS18B20 address */
614
389097dc665d Version 0.9.11. Removed lcd debug message after 7 years. Added setup for alternative beer sensor. If the main sensor is gone, the alternative will be used.
Michiel Broek <mbroek@mbse.eu>
parents: 582
diff changeset
172 char *beer_address2; /* Alternative sensor address */
101
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 95
diff changeset
173 int beer_state; /* 0=ok, 1=missing, 2=error */
1302abe92eb1 Made temperature sensors working in the units
Michiel Broek <mbroek@mbse.eu>
parents: 95
diff changeset
174 int beer_temperature; /* Beer temperature in C * 1000 */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
175 int beer_idx; /* Domoticz idx */
518
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
176 char *chiller_address; /* DS18B20 address */
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
177 int chiller_state; /* 0=ok, 1=missing, 2=error */
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
178 int chiller_temperature; /* Chiller temp. in C * 1000 */
fd36bedab944 Added chiller configuration items
Michiel Broek <mbroek@mbse.eu>
parents: 513
diff changeset
179 int chiller_idx; /* Domoticz idx */
175
b73490398368 Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
180 char *heater_address; /* Heater relay or PWM */
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
181 int heater_state; /* Heater state 0..100 */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
182 int heater_delay; /* Heater delay time /15 sec */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
183 int heater_wait; /* Heater wait counter */
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 292
diff changeset
184 int heater_usage; /* Heater usage in seconds */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
185 int heater_idx; /* Domoticz idx */
175
b73490398368 Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
186 char *cooler_address; /* Cooler relay or PWM */
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
187 int cooler_state; /* Cooler state 0..100 */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
188 int cooler_delay; /* Cooler delay time /15 sec */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
189 int cooler_wait; /* Cooler wait counter */
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 292
diff changeset
190 int cooler_usage; /* Cooler usage in seconds */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
191 int cooler_idx; /* Domoticz idx */
175
b73490398368 Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
192 char *fan_address; /* Fan relay or PWM */
270
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
193 int fan_state; /* Fan state 0..100 */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
194 int fan_delay; /* Fan delay time /15 sec */
df81d583c2c3 The PID commands have an adjustable delay, default 5 minutes
Michiel Broek <mbroek@mbse.eu>
parents: 262
diff changeset
195 int fan_wait; /* Fan wait counter */
293
881b1ae75468 Added usage counters
Michiel Broek <mbroek@mbse.eu>
parents: 292
diff changeset
196 int fan_usage; /* Fan usage in seconds */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
197 int fan_idx; /* Domoticz idx */
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
198 char *light_address; /* Lights relay */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
199 int light_state; /* Lights state 0..100 */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
200 int light_delay; /* Lights delay time /15 sec */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
201 int light_wait; /* Lights wait counter */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
202 int light_usage; /* Lights usage in seconds */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
203 int light_idx; /* Domoticz idx */
582
ba340e00aab2 Version 0.9.5, interior lights are now only controlled by the open door or a 5 minutes timer. The timer is started via an MQTT command. The BMS web application sends this command just before a webcam page is requested.
Chiel Broek <mbse@mbse.eu>
parents: 579
diff changeset
204 int light_timer; /* Lights timer */
175
b73490398368 Units editing is more or less complete. Changed structures for heating, cooling, fan and door. Updated the web interface to confuigure all these things.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
205 char *door_address; /* Door input address */
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
206 int door_state; /* Door status */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
207 int door_idx; /* Domoticz idx */
306
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
208 char *psu_address; /* Power Supply input address */
97602274eb58 Updated to add support for lights in a fermenter unit and a Power Supply status.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
209 int psu_state; /* Power Supply status */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
210 int psu_idx; /* Domoticz idx */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
211 int mode; /* Unit mode */
578
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
212 float beer_set_lo; /* Beer temperature setting lo */
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
213 float beer_set_hi; /* Beer temperature setting hi */
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
214 float fridge_set_lo; /* Fridge temperature setting */
d694abd9d809 Version 0.9.3. Splitted the temperature low and high settings in fridge and beer mode.
Michiel Broek <mbroek@mbse.eu>
parents: 575
diff changeset
215 float fridge_set_hi; /* Fridge temperature setting */
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
216 float temp_set_min; /* Minimum temperature */
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
217 float temp_set_max; /* Maximum temperature */
570
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
218 char *profile_uuid; /* Profile uuid or NULL */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
219 char *profile_name; /* Profile name */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
220 float profile_inittemp_lo; /* Profile initial temp low */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
221 float profile_inittemp_hi; /* Profile initial temp high */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
222 int profile_fridge_mode; /* Profile initial fridge mode */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
223 int profile_duration; /* Profile duration in hours */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
224 int profile_totalsteps; /* Profile number of steps */
1e0192b295b9 Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.
Michiel Broek <mbroek@mbse.eu>
parents: 569
diff changeset
225 prof_step *profile_steps; /* Profile steps */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
226 time_t prof_started; /* Profile start time */
89
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
227 int prof_state; /* Profile OFF|PAUSE|RUN|DONE */
397
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
228 float prof_target_lo; /* Profile current target low */
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
229 float prof_target_hi; /* Profile current target high */
194
9eaaba49450f Added some ideas about profiles.
Michiel Broek <mbroek@mbse.eu>
parents: 191
diff changeset
230 time_t prof_paused; /* Profile total pause time */
284
9e6fb5aed618 Profile progress is visible in the web interface
Michiel Broek <mbroek@mbse.eu>
parents: 270
diff changeset
231 int prof_percent; /* Profile percentage done */
289
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
232 float prof_peak_abs; /* Profile absolute peak temp */
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
233 float prof_peak_rel; /* Profile relative peak temp */
d810df0df36a Added code to detect primary fermentation
Michiel Broek <mbroek@mbse.eu>
parents: 284
diff changeset
234 time_t prof_primary_done; /* Profile primary is done */
397
00ca08f5a6f8 Fermentation profiles now have a low and high temperature setting so that you can use a temperture window. Each profile step can now set for beer or air temperature reference. The logfiles have an extra temperature field for this. Bumped to version 0.4.2.
Michiel Broek <mbroek@mbse.eu>
parents: 362
diff changeset
235 int prof_fridge_mode; /* Profile fridge/beer mode */
362
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 339
diff changeset
236 pid_var *PID_cool; /* PID cooler */
c92651a54969 Made the client-server protocol more robust. When a change to a unit is made using the web interface, the main process is stopped during the update. Splitted the PID in two PID's, one for heating and one for cooling. Adjusted the web edit scrreen for this, but there are still rough edges. Replaced the PID code, maybe this one works better for our purpose. The simulator air temperature changes on the simulator heater and cooler, but it is not realistic at all. This is a development version, do not use in production. The version is 0.3.0
Michiel Broek <mbroek@mbse.eu>
parents: 339
diff changeset
237 pid_var *PID_heat; /* PID heater */
499
602d9968960f Created mqtt sourcefiles. Use flags to trigger publish messages. The main source does not know and does not care if MQTT messages will be sent. Version 0.5.5
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
238 int mqtt_flag; /* MQTT print values flag */
554
ab9f22ab57b5 Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.
Michiel Broek <mbroek@mbse.eu>
parents: 553
diff changeset
239 char *event_msg; /* Event message to log */
525
5855abe0e82c Added unit alarm flag
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
240 int alarm_flag; /* Alarm flag */
5855abe0e82c Added unit alarm flag
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
241 int alarm_last; /* Last alarm state */
564
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 557
diff changeset
242 int stage; /* Fermentation stage */
579
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
243 float yeast_lo; /* Yeast low temperature limit */
7032693272f1 Concept for yeast limits settings.
Michiel Broek <mbroek@mbse.eu>
parents: 578
diff changeset
244 float yeast_hi; /* Yeast high temperature limit */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
245 } units_list;
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
246
76
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
247 #define UNITMODE_OFF 0 /* Unit turned off */
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
248 #define UNITMODE_NONE 1 /* Unit on but does nothing */
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
249 #define UNITMODE_FRIDGE 2 /* Unit acts as a fridge */
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
250 #define UNITMODE_BEER 3 /* Unit acts as beer cooler */
d2c7b32f27d6 Can now write the fermenter units configurations
Michiel Broek <mbroek@mbse.eu>
parents: 75
diff changeset
251 #define UNITMODE_PROFILE 4 /* Unit runs in profile mode */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
252
564
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 557
diff changeset
253 #define UNITSTAGE_PRIMARY 0 /* Fermentation primary stage */
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 557
diff changeset
254 #define UNITSTAGE_SECONDARY 1 /* Fermentation secondary stage */
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 557
diff changeset
255 #define UNITSTAGE_TERTIARY 2 /* Fermentation tertiary stage */
569
9c69d43bfb06 Version 0.9.0. Implemented DCMD via mqtt to set stage, mode, setpoint low and high. Implemeted DCMD via mqtt to set heater, cooler, fan and light state. Implemented DCMD via mqtt to set product code and name. Set the PID's in fridge mode without idle range offset, that was an old leftover setting that was obsolete.
Michiel Broek <mbroek@mbse.eu>
parents: 564
diff changeset
256 #define UNITSTAGE_CARBONATION 3 /* Carbonation packaged beer */
564
3fc61dd28656 Versie 0.8.8 Fermentation stage implemented in units.
Michiel Broek <mbroek@mbse.eu>
parents: 557
diff changeset
257
510
2da3d3340403 Version 0.6.0. The MQTT data messages are now allways the same length so that openhab will function with the message updates.
Michiel Broek <mbroek@mbse.eu>
parents: 506
diff changeset
258 #define MQTT_FLAG_DATA 0x0001 /* Show updated data values */
533
49580ca85ab7 Versie 0.6.3. MQTT device berichten alleen als een fermenter ingeschakeld is. MQTT fermenter birth en death berichhten als een fementer in of uitgeschakeld wordt. MQTT node death bericht bij normaal afsluiten van de daemon. Alle MQTT persistent berichten worden nu goed opgeruikmd.
Michiel Broek <mbroek@mbse.eu>
parents: 530
diff changeset
259 #define MQTT_FLAG_BIRTH 0x0002 /* Show birth instead of data */
49580ca85ab7 Versie 0.6.3. MQTT device berichten alleen als een fermenter ingeschakeld is. MQTT fermenter birth en death berichhten als een fementer in of uitgeschakeld wordt. MQTT node death bericht bij normaal afsluiten van de daemon. Alle MQTT persistent berichten worden nu goed opgeruikmd.
Michiel Broek <mbroek@mbse.eu>
parents: 530
diff changeset
260 #define MQTT_FLAG_DEATH 0x0004 /* Show death of a unit */
506
cdcd07bbee30 New MQTT protocol
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
261
544
e2889b17f48c Versie 0.6.8. Code cleanup. Publish NDATA MQTT bericht iedere 5 minuten of als er een THB wijziging is.
Michiel Broek <mbroek@mbse.eu>
parents: 540
diff changeset
262
506
cdcd07bbee30 New MQTT protocol
Michiel Broek <mbroek@mbse.eu>
parents: 500
diff changeset
263
530
d33516eac22f Serious alarms are above 255
Michiel Broek <mbroek@mbse.eu>
parents: 525
diff changeset
264 /*
d33516eac22f Serious alarms are above 255
Michiel Broek <mbroek@mbse.eu>
parents: 525
diff changeset
265 * Alarm bits, value above 255 are serious alarms.
d33516eac22f Serious alarms are above 255
Michiel Broek <mbroek@mbse.eu>
parents: 525
diff changeset
266 */
525
5855abe0e82c Added unit alarm flag
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
267 #define ALARM_FLAG_DOOR 0x0001 /* Door open */
5855abe0e82c Added unit alarm flag
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
268 #define ALARM_FLAG_PSU 0x0002 /* PSU problem */
530
d33516eac22f Serious alarms are above 255
Michiel Broek <mbroek@mbse.eu>
parents: 525
diff changeset
269 #define ALARM_FLAG_CHILLER 0x0100 /* Chiller too warm */
525
5855abe0e82c Added unit alarm flag
Michiel Broek <mbroek@mbse.eu>
parents: 518
diff changeset
270
499
602d9968960f Created mqtt sourcefiles. Use flags to trigger publish messages. The main source does not know and does not care if MQTT messages will be sent. Version 0.5.5
Michiel Broek <mbroek@mbse.eu>
parents: 497
diff changeset
271
89
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
272 #define PROFILE_OFF 0 /* Profile not active */
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
273 #define PROFILE_PAUSE 1 /* Profile pause */
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
274 #define PROFILE_RUN 2 /* Profile is running */
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
275 #define PROFILE_DONE 3 /* Profile is finished */
218
311a293b3e46 Added profile state ABORT
Michiel Broek <mbroek@mbse.eu>
parents: 215
diff changeset
276 #define PROFILE_ABORT 4 /* Profile abort */
311a293b3e46 Added profile state ABORT
Michiel Broek <mbroek@mbse.eu>
parents: 215
diff changeset
277
89
8bab04a663dd Added profile states
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
278
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
279 /*
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
280 * External devices like sensors, relays.
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
281 */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
282 typedef struct _dev_list {
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
283 struct _dev_list *next;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
284 char *uuid; /* UUID of this device */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
285 int type; /* Device type */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
286 int direction; /* Device direction */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
287 int value; /* Device value */
209
c5b1dfd83e81 Added offset value for sensor that need it
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
288 int offset; /* Device offset value */
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
289 int present; /* Device present */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
290 char *address; /* Device address */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
291 int subdevice; /* Device sub address */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
292 int gpiopin; /* Device GPIO pin or -1 */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
293 char *description; /* Device description */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
294 int inuse; /* In use counter */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
295 char *comment; /* What we think it is */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
296 time_t timestamp; /* Last updated */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
297 } devices_list;
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
298
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
299 #define DEVTYPE_NA 0 /* Unknown device type */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
300 #define DEVTYPE_W1 1 /* 1-Wire bus */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
301 #define DEVTYPE_GPIO 2 /* GPIO I/O device */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
302 #define DEVTYPE_RC433 3 /* 433 MHz device */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
303 #define DEVTYPE_DHT 4 /* DHT type device on GPIO */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
304 #define DEVTYPE_I2C 5 /* I2C bus device */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
305 #define DEVTYPE_SPI 6 /* SPI bus device */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
306 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
307 #define DEVTYPE_SIM 7 /* Simulated device */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
308 #endif
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
309
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
310 #define DEVPRESENT_UNDEF 0 /* Precence not testable */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
311 #define DEVPRESENT_NO 1 /* Device is missing */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
312 #define DEVPRESENT_YES 2 /* Device is detected */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
313 #define DEVPRESENT_ERROR 3 /* Device is in error */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
314
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
315 #define DEVDIR_UNDEF 0 /* Undefined */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
316 #define DEVDIR_IN_BIN 1 /* Binary input */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
317 #define DEVDIR_OUT_BIN 2 /* Binary output */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
318 #define DEVDIR_IN_ANALOG 3 /* Temperature input etc. */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
319 #define DEVDIR_OUT_ANALOG 4 /* Analog steering */
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
320 #define DEVDIR_OUT_PWM 5 /* PWM outout */
162
6fc9e3f7962f Added Raspberry GPIO devices
Michiel Broek <mbroek@mbse.eu>
parents: 158
diff changeset
321 #define DEVDIR_INTERN 6 /* Internal function */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
322
654
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
323
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
324 /*
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
325 * Dynamic one-wire devices list
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
326 */
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
327 typedef struct _w1_list {
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
328 struct _w1_list *next;
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
329 char *address; ///< Device address
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
330 char family[3]; ///< Device family
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
331 int present; ///< Present on bus
660
a28ef4d9afa4 Version 0.9.17a1. Revised starting and stopping the threads. Fixed stopping the command server thread. Moved one-wire tempeature sensors resolution correction to the one-wire thread. The devices thread fetches temperatures from the one-wire thread. The one-wire thread does everything for the temperature sensors. The command server uses private sockets. Still, only one session at the same time is handled.
Michiel Broek <mbroek@mbse.eu>
parents: 654
diff changeset
332 int value; ///< Last value
728
da038d0bed04 Version 0.9.20a1. Analyse threads cpu usage. One-wire added a resolution flag to prevent continuous resolution checks, now only for new sensors and replugged known sensors. Added two 40 sSec delays in the state machine. In the panel thread moved a few locks so these expensive calls are called only when needed.
Michiel Broek <mbroek@mbse.eu>
parents: 726
diff changeset
333 int resolution; ///< Actual resolution
654
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
334 time_t timestamp; ///< Last seen
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
335 } w1_list;
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
336
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
337
e981d0185485 Added one-wire thread and some old state table macro's. The state machine first state scans new one-wire devices and stores them in a linked list.
Michiel Broek <mbroek@mbse.eu>
parents: 645
diff changeset
338
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
339 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
340
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
341 /*
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
342 * The frigo is a simulation of a fridge with a heating device.
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
343 * It has a volume air, a volume of your beer. There is a simulated
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
344 * thermal sensor that measures the air and one that measures the beer.
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
345 * It looks like a normal live setup.
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
346 */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
347 typedef struct _simulator {
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
348 struct _simulator *next;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
349 char *uuid; /* Simulator uuid */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
350 char *name; /* Simulator name */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
351 int simno; /* Simulator number */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
352 int volume_air; /* Volume air of the frigo */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
353 int volume_beer; /* Volume beer inside frigo */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
354 char *room_tempaddress; /* Address */
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
355 double room_temperature; /* Temp outside frigo */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
356 char *room_humaddress; /* Address */
553
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 550
diff changeset
357 double room_humidity; /* Humidity outside frigo */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
358 char *air_address; /* Simulated air address */
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
359 double air_temperature; /* Simulated air temperature */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
360 int air_present; /* Simulated air present */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
361 char *beer_address;
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
362 double beer_temperature; /* Simulated beer temperature */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
363 int beer_present; /* Simulated beer present */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
364 char *beer_address2;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
365 double beer_temperature2; /* Simulated beer temperature2 */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
366 int beer_present2; /* Simulated beer present2 */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
367 char *chiller_address;
553
4091d4fe217f Updated simulator with more simulated devices.
Michiel Broek <mbroek@mbse.eu>
parents: 550
diff changeset
368 double chiller_temperature; /* Simulated chiller temp. */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
369 int chiller_present; /* Simulated chiller present */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
370 char *cooler_address;
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
371 double cooler_temp; /* Lowest cooler temperature */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
372 int cooler_time; /* Time to reach temperature */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
373 float cooler_size; /* Size of cooler in square mtr */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
374 int cooler_present; /* Simulated cooler present */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
375 int cooler_power; /* Simulated cooler 0..100% */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
376 char *heater_address;
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
377 double heater_temp; /* Highest heater temperature */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
378 int heater_time; /* Time to reach temperature */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
379 float heater_size; /* Size of heater in square mtr */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
380 int heater_present; /* Simulated heater present */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
381 int heater_power; /* Simulated heater 0..100% */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
382 char *fan_address; /* Simulated fan */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
383 int fan_present;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
384 int fan_power;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
385 char *light_address; /* Simulated interior light */
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
386 int light_present;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
387 int light_power;
716
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
388 char *door_address; /* Simulated fridge door */
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
389 int door_present;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
390 int door_value;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
391 char *psu_address; /* Simulated PSU status */
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
392 int psu_present;
5c30c8ef83a8 Version 0.9.19b3. The simulator thread can be paused to be able to add and delete simulators. Added simulated door and PSU status. Devices can now fully use multiple simulators. Better rounding of simulated temperature values. The server SIMULATOR DEL and ADD commands pause the simulator when the linked list is manipulated. Fixed SIGSEGV when a simulator is added. Added socket SO_REUSEADDR again to the server socket.
Michiel Broek <mbroek@mbse.eu>
parents: 714
diff changeset
393 int psu_value;
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
394 float frigo_isolation; /* Frigo isolation value */
714
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
395 time_t timestamp;
24749c296a50 Version 0.9.19b2. Simulator redesign and it is now possible to run more then one simulator. All simulated devices have address names that include the simulator number. Added the setup screen for the most part. Not compatible with previous versions if a simulator was used, delete all simulators and simulated devices during stop and start.
Michiel Broek <mbroek@mbse.eu>
parents: 702
diff changeset
396
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
397 /*
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
398 * Status values, maintained by the simulator but stored
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
399 * here so they don't get lost over program restarts.
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
400 */
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
401 double s_yeast_heat; /* Heat generated by yeast */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
402 time_t s_yeast_started; /* Start date/time fermentation */
262
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
403 double s_cool_temp; /* Temp cooler */
d0014ccec615 Simulation of fridge cold loss to the room added for testing.
Michiel Broek <mbroek@mbse.eu>
parents: 259
diff changeset
404 double s_heat_temp; /* Temp heater */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
405 time_t s_cool_changed; /* Start date/time cooler */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
406 time_t s_heat_changed; /* Start date/time heater */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
407 } simulator_list;
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
408
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
409 #endif
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
410
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
411 typedef struct _sys_config {
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
412 char *name; /* Configuration name */
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
413 int server_port; /* my client/server port */
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
414 char *temp_uuid; /* Environment temperature */
206
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
415 int temp_state; /* 0=ok, 1=missing, 2=error */
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
416 int temp_value; /* Air temperature in C * 1000 */
693
3518c07737d8 Version 0.9.19a2. Dropped TEMPSTATE[] and only use DEVPRESENT[] to mark devices state. Adjusted webpages for this switch in responses. Adjusted MySQL mon_fermenters enum values too. Rename some global Config records to better reflect their real use.Added one-wire json records and websocket. Announce when some onewire device changes. Add UNITS JSON command without parameter. Dropped global tempFormat setting that was never used.
Michiel Broek <mbroek@mbse.eu>
parents: 675
diff changeset
417 char *hum_uuid; /* Environment huminity */
206
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
418 int hum_state; /* 0=ok, 1=missing, 2=error */
78fb6f99e473 Added GLOBAL GET and GLOBAL PUT commands.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
419 int hum_value; /* Huminity in % * 1000 */
513
a2732027afb3 Version 0.6.1 added support for domoticz mqtt sensors.
Michiel Broek <mbroek@mbse.eu>
parents: 510
diff changeset
420 int temp_hum_idx; /* Domoticz idx */
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
421 int lcd_cols; /* LCD display columns */
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
422 int lcd_rows; /* LCD display rows */
78
c49ab5179bf3 Added lcd i2c address to xml configuration
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
423 int lcd_address; /* LCD display i2c address */
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 499
diff changeset
424 int next_unit; /* Next unit alias name */
71
a09c5cdc4022 Removed rc-switch
Michiel Broek <mbroek@mbse.eu>
parents: 66
diff changeset
425 units_list *units; /* Fermenter units */
158
f1b7e2ef90be Added device configuration
Michiel Broek <mbroek@mbse.eu>
parents: 157
diff changeset
426 devices_list *devices; /* Sensors and switches */
259
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
427 #ifdef USE_SIMULATOR
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
428 simulator_list *simulators; /* Simulators */
b7c967359771 Added framework for a simulation of a fridge with heater to use as controlled fermentor
Michiel Broek <mbroek@mbse.eu>
parents: 248
diff changeset
429 #endif
500
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 499
diff changeset
430 char *mqtt_host; /* MQTT host to connect to */
5aa914eb644e Units now have an unique alias name so that the MQTT messages are more friendly.
Michiel Broek <mbroek@mbse.eu>
parents: 499
diff changeset
431 int mqtt_port; /* MQTT port to connect to */
534
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 533
diff changeset
432 char *mqtt_username; /* MQTT username */
92b546d4a839 Versie 0.6.4. Aan de global setup de MQTT instellingen toegevoegd. Die zijn er ook als MQTT niet op het systeem aanwezig is. Indien het de global setup wijzigd, wordt de MQTT verbinding opnieuw gemaakt.
Michiel Broek <mbroek@mbse.eu>
parents: 533
diff changeset
433 char *mqtt_password; /* MQTT password */
540
5a26429abbf8 Versie 0.6.7. Globale uuid toegevoegd voor de NBIRTH payload.
Michiel Broek <mbroek@mbse.eu>
parents: 534
diff changeset
434 char *uuid; /* System uuid */
675
825210ba2707 Added websockets to thermferm. Started new www directory for websocket enabled web. The init script now waits until thermferm is completely stopped.
Michiel Broek <mbroek@mbse.eu>
parents: 671
diff changeset
435 int websocket_port; /* Websocket port */
51
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
436 } sys_config;
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
437
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
438
a03b6dac5398 Removed library, bumped to version 0.0.7
Michiel Broek <mbroek@mbse.eu>
parents: 48
diff changeset
439
66
805f1d285acd Compiles with 1-wire bus on PC hardware
Michiel Broek <mbroek@mbse.eu>
parents: 54
diff changeset
440 #endif

mercurial