-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.h
More file actions
34 lines (27 loc) · 993 Bytes
/
globals.h
File metadata and controls
34 lines (27 loc) · 993 Bytes
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
#pragma once
//#define DEBUG
#define P1_MAXLINELENGTH 1050
// Update treshold in milliseconds, messages will only be sent on this interval
#define UPDATE_INTERVAL 1000 // 1 second
//#define UPDATE_INTERVAL 10000 // 10 seconds
//#define UPDATE_INTERVAL 60000 // 1 minute
//#define UPDATE_INTERVAL 300000 // 5 minutes
// Update treshold in milliseconds,
// this will also send values that are more than the tresholds time the same
#define UPDATE_FULL_INTERVAL 600000 // 10 minutes
// #define UPDATE_FULL_INTERVAL 1800000 // 30 minutes
// #define UPDATE_FULL_INTERVAL 3600000 // 1 Hour
#define HOSTNAME "p1meter"
#define OTA_PASSWORD "admin"
#define BAUD_RATE 115200
#define RXD2 16
#define TXD2 17
#define MQTT_MAX_RECONNECT_TRIES 100
#define MQTT_ROOT_TOPIC "sensors/power/p1meter/"
long LAST_RECONNECT_ATTEMPT = 0;
long LAST_UPDATE_SENT = 0;
long LAST_FULL_UPDATE_SENT = 0;
class IBlock;
extern int InitializeMeterData();
extern bool HandleBlock(IBlock *block);
extern void SendAll();