-
Notifications
You must be signed in to change notification settings - Fork 1
/
trigBoardV8_MCP9808.ino
58 lines (49 loc) · 1.37 KB
/
trigBoardV8_MCP9808.ino
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
52
53
54
55
56
57
58
/*
Using trigBoard with MCP9808 temperature sensor and sending on time interval to grafana using Corlysis
*/
//TIP to delete influx database data - DROP SERIES FROM LMT01
#include "includes.h"
#include <HTTPClient.h>// needed this for Corlysis
const char fwVersion[] = "8/05/20_MCP9808";
char temperatureString[5];//where the temperature in F/C is stored
boolean getMCP9808();
// USE CONFIGURATOR TO SET EVERYTHING UP
// Database = trigBoard Name
// Measurement = Message when contact opens
// location = Message when contact closes
// C or F in = Message when Button Pressed
// Token = Contact Still Open
void setup() {
pinMode(ESPlatchPin, OUTPUT);
digitalWrite(ESPlatchPin, HIGH);
pinMode(LEDpin, OUTPUT);
Serial.begin(115200);
checkWakeupPins();
loadConfiguration(filename, config);
rtcInit(config.timerCountDown, false);
Serial.println(getBattery(), 2);
if (getMCP9808()) {
// ONLY Sending data to Corlysis
// if (pushLogic()) { //decide if push will occur or nt and what message will be
// if (wiFiNeeded) {
if (connectWiFi()) {
sendToCorlysis();
// pushOver();
// pushSafer();
// ifttt();
// mqtt();
}
// }
// udp();
// }
}
killPower();
waitForButton();
initBluetooth();
}
void loop() {
if (!OTAsetup)
serviceBluetooth();
else
checkOTA();
}