-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbsec_bme680-diff.patch
More file actions
51 lines (47 loc) · 2.19 KB
/
bsec_bme680-diff.patch
File metadata and controls
51 lines (47 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- bsec_bme680.c.org 2021-02-03 15:13:15.331942259 +0100
+++ bsec_bme680.c 2021-02-03 15:15:57.541352658 +0100
@@ -28,11 +28,11 @@
/* definitions */
#define DESTZONE "TZ=Europe/Berlin"
-#define temp_offset (5.0f)
+#define temp_offset (0.5f)
#define sample_rate_mode (BSEC_SAMPLE_RATE_LP)
int g_i2cFid; // I2C Linux device handle
-int i2c_address = BME680_I2C_ADDR_PRIMARY;
+int i2c_address = BME680_I2C_ADDR_SECONDARY;
char *filename_state = "bsec_iaq.state";
char *filename_config = "bsec_iaq.config";
@@ -198,18 +198,25 @@ void output_ready(int64_t timestamp, flo
time_t t = time(NULL);
struct tm tm = *localtime(&t);
- printf("%d-%02d-%02d %02d:%02d:%02d,", tm.tm_year + 1900,tm.tm_mon + 1,
- tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); /* localtime */
- printf("[IAQ (%d)]: %.2f", iaq_accuracy, iaq);
- printf(",[T degC]: %.2f,[H %%rH]: %.2f,[P hPa]: %.2f", temperature,
- humidity,pressure / 100);
- printf(",[G Ohms]: %.0f", gas);
- printf(",[S]: %d", bsec_status);
+// printf("%d-%02d-%02d %02d:%02d:%02d,", tm.tm_year + 1900,tm.tm_mon + 1,
+// tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); /* localtime */
+// printf("[IAQ (%d)]: %.2f", iaq_accuracy, iaq);
+// printf(",[T degC]: %.2f,[H %%rH]: %.2f,[P hPa]: %.2f", temperature,
+// humidity,pressure / 100);
+// printf(",[G Ohms]: %.0f", gas);
+// printf(",[S]: %d", bsec_status);
//printf(",[static IAQ]: %.2f", static_iaq);
- printf(",[eCO2 ppm]: %.15f", co2_equivalent);
- printf(",[bVOCe ppm]: %.25f", breath_voc_equivalent);
+// printf(",[eCO2 ppm]: %.15f", co2_equivalent);
+// printf(",[bVOCe ppm]: %.25f", breath_voc_equivalent);
//printf(",%" PRId64, timestamp);
//printf(",%" PRId64, timestamp_ms);
+ printf("{\"IAQ_Accuracy\": \"%d\",\"IAQ\":\"%.2f\"", iaq_accuracy, iaq);
+ printf(",\"Temperature\": \"%.2f\",\"Humidity\": \"%.2f\",\"Pressure\": \"%.2f\"", temperature, humidity,pressure / 100);
+ printf(",\"Gas\": \"%.0f\"", gas);
+ printf(",\"Status\": \"%d\"", bsec_status);
+ printf(",\"Static_IAQ\": \"%.2f\"", static_iaq);
+ printf(",\"eCO2\": \"%.15f\"", co2_equivalent);
+ printf(",\"bVOCe\": \"%.25f\"}", breath_voc_equivalent);
printf("\r\n");
fflush(stdout);
}