Browse code

fucj this

root authored on28/07/2022 12:41:35
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+// Update treshold in milliseconds, messages will only be sent on this interval
2
+#define UPDATE_INTERVAL 5000 // 1 second
3
+//#define UPDATE_INTERVAL 10000 // 10 seconds
4
+//#define UPDATE_INTERVAL 60000  // 1 minute
5
+//#define UPDATE_INTERVAL 300000 // 5 minutes
6
+
7
+#define HOSTNAME "p1meter_esp"
8
+#define OTA_PASSWORD "admin"
9
+
10
+#define BAUD_RATE 115200
11
+#define P1_SERIAL_RX RX
12
+#define P1_MAXLINELENGTH 1050
13
+
14
+#define MQTT_MAX_RECONNECT_TRIES 100
15
+#define MQTT_ROOT_TOPIC "sensors/power/p1meter"
16
+
17
+#define NUMBER_OF_READOUTS 21
18
+
19
+long LAST_RECONNECT_ATTEMPT = 0;
20
+long LAST_UPDATE_SENT = 0;
21
+char WIFI_SSID[32] = "C2ROOT-WIFI";
22
+char WIFI_PASS[32] = "AK1S3PIDEH";
23
+
24
+char MQTT_HOST[64] = "192.168.5.131";
25
+char MQTT_PORT[6]  = "1883";
26
+char MQTT_USER[32] = "";
27
+char MQTT_PASS[32] = "";
28
+
29
+char telegram[P1_MAXLINELENGTH];
30
+
31
+struct TelegramDecodedObject
32
+{
33
+  String name;
34
+  long value;
35
+  char code[16];
36
+  char startChar = '(';
37
+  char endChar = ')';
38
+};
39
+
40
+struct TelegramDecodedObject telegramObjects[NUMBER_OF_READOUTS];
41
+
42
+// You can turn the CRC on and off here
43
+bool useCRC = true;
44
+unsigned int currentCRC = 0;