-
Notifications
You must be signed in to change notification settings - Fork 1
/
DallasWifiMonitor.ino
70 lines (49 loc) · 1.17 KB
/
DallasWifiMonitor.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
59
60
61
62
63
64
65
66
67
68
69
70
#include <FS.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include "sha256.h"
#include "base64.h"
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include "WiFiManager.h"
void setup() {
SetupSleep();
ConfigSetup();
Serial.begin(115200);
delay(100);
Serial.println();
printInfo();
if (LoadConfig() == false || ConfigModeRequested()) {
EnableConfigMode();
ESP.reset();
}
SetupDallas();
}
void loop() {
ReadPowerValue();
ConnectWiFi();
ReadDallasValue();
PublishData();
GotoSleep();
}
void printInfo() {
Serial.print("Chip Id:");
Serial.println(ESP.getChipId());
Serial.print("Flash Chip Id:");
Serial.println(ESP.getFlashChipId());
Serial.print("Flash Chip Speed:");
Serial.println(ESP.getFlashChipSpeed());
Serial.print("Flash Chip Size:");
Serial.println(ESP.getFlashChipSize());
Serial.print("Cpu Freq MHz:");
Serial.println(ESP.getCpuFreqMHz());
Serial.print("Sdk Version:");
Serial.println(ESP.getSdkVersion());
Serial.print("Boot Version:");
Serial.println(ESP.getBootVersion());
Serial.print("Boot Mode:");
Serial.println(ESP.getBootMode());
}