EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
EnigmaIoTconfig.h
Go to the documentation of this file.
1 
9 #ifndef _CONFIG_h
10 #define _CONFIG_h
11 
12 #include "Arduino.h"
14 
15 // Global configuration. Physical layer settings
16 static const uint8_t ENIGMAIOT_PROT_VERS[3] = { 0,9,8 };
17 static const uint8_t DEFAULT_CHANNEL = 3;
18 static const uint32_t FLASH_LED_TIME = 30;
19 static const int RESET_PIN_DURATION = 5000;
20 #define TZINFO "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00"
21 #define NTP_SERVER_1 "pool.ntp.org"
22 #define NTP_SERVER_2 "time.nist.gov"
23 
24 // Gateway configuration
25 static const unsigned int MAX_KEY_VALIDITY = 172800000U;
26 static const unsigned int MAX_NODE_INACTIVITY = 86400000U;
27 static const size_t MAX_MQTT_QUEUE_SIZE = 3;
28 #define ENABLE_STATUS_MESSAGES 1
29 static const int RATE_AVE_ORDER = 5;
30 static const int MAX_INPUT_QUEUE_SIZE = 3;
31 #ifndef NUM_NODES
32 static const int NUM_NODES = 35;
33 #endif //NUM_NODES
34 #ifndef CONNECT_TO_WIFI_AP
35 #define CONNECT_TO_WIFI_AP 1
36 #endif //CONNECT_TO_WIFI_AP
37 
38 // Node configuration
39 static const int16_t RECONNECTION_PERIOD = 1500;
40 static const uint16_t DOWNLINK_WAIT_TIME = 350;
41 static const uint32_t DEFAULT_SLEEP_TIME = 10;
42 static const time_t IDENTIFY_TIMEOUT = 10000;
43 #ifndef TIME_SYNC_PERIOD
44 static const uint32_t TIME_SYNC_PERIOD = 30000;
45 #endif // TIME_SYNC_PERIOD
46 static const unsigned int QUICK_SYNC_TIME = 5000;
47 #ifndef PRE_REG_DELAY
48 static const uint32_t PRE_REG_DELAY = 5000;
49 #endif // PRE_REG_DELAY
50 static const uint32_t POST_REG_DELAY = 1500;
51 static const uint8_t COMM_ERRORS_BEFORE_SCAN = 2;
52 
53 //Web API
54 #define ENABLE_WEB_API 1
55 
56 //Debug
57 #ifndef DEBUG_ESP_PORT
58 #define DEBUG_ESP_PORT Serial
59 #endif // DEBUG_ESP_PORT
60 #ifndef DEBUG_LEVEL
61 // DON'T ENABLE DEBUG IF YOU CAN ONLY DO OTA UPDATE. YOU MAY BE UNABLE TO DO OTA UPDATE ANYMORE UNTIL YOU FLASH THE NODE THROUGH WIRE
62 #define DEBUG_LEVEL WARN
63 #endif //DEBUG_LEVEL
64 
65 #endif
MAX_NODE_INACTIVITY
static const unsigned int MAX_NODE_INACTIVITY
After this time (in ms) a node is marked as gone. Setting this to 0 means imfinite.
Definition: EnigmaIoTconfig.h:26
IDENTIFY_TIMEOUT
static const time_t IDENTIFY_TIMEOUT
How long LED will be flashing during identification.
Definition: EnigmaIoTconfig.h:42
EnigmaIoTconfigAdvanced.h
Parameter configuration.
COMM_ERRORS_BEFORE_SCAN
static const uint8_t COMM_ERRORS_BEFORE_SCAN
Node will search for a gateway if this number of communication errors have happened.
Definition: EnigmaIoTconfig.h:51
ENIGMAIOT_PROT_VERS
static const uint8_t ENIGMAIOT_PROT_VERS[3]
EnitmaIoT Version.
Definition: EnigmaIoTconfig.h:16
TIME_SYNC_PERIOD
static const uint32_t TIME_SYNC_PERIOD
Period of clock synchronization request.
Definition: EnigmaIoTconfig.h:44
QUICK_SYNC_TIME
static const unsigned int QUICK_SYNC_TIME
Period of clock synchronization request in case of resync is needed.
Definition: EnigmaIoTconfig.h:46
NUM_NODES
static const int NUM_NODES
Maximum number of nodes that this gateway can handle.
Definition: EnigmaIoTconfig.h:32
PRE_REG_DELAY
static const uint32_t PRE_REG_DELAY
Time to wait before registration so that other nodes have time to communicate. Real delay is a random...
Definition: EnigmaIoTconfig.h:48
POST_REG_DELAY
static const uint32_t POST_REG_DELAY
Time to wait before sending data after registration so that other nodes have time to finish their reg...
Definition: EnigmaIoTconfig.h:50
MAX_KEY_VALIDITY
static const unsigned int MAX_KEY_VALIDITY
After this time (in ms) a node is unregistered. Setting this to 0 means imfinite.
Definition: EnigmaIoTconfig.h:25
RECONNECTION_PERIOD
static const int16_t RECONNECTION_PERIOD
Time to retry Gateway connection.
Definition: EnigmaIoTconfig.h:39
DOWNLINK_WAIT_TIME
static const uint16_t DOWNLINK_WAIT_TIME
Time to wait for downlink message before sleep. Setting less than 180 ms causes ESP-NOW errors due to...
Definition: EnigmaIoTconfig.h:40
DEFAULT_CHANNEL
static const uint8_t DEFAULT_CHANNEL
WiFi channel to be used on ESP-NOW.
Definition: EnigmaIoTconfig.h:17
RESET_PIN_DURATION
static const int RESET_PIN_DURATION
Number of milliseconds that reset pin has to be grounded to produce a configuration reset.
Definition: EnigmaIoTconfig.h:19
FLASH_LED_TIME
static const uint32_t FLASH_LED_TIME
Time that led keeps on during flash in ms.
Definition: EnigmaIoTconfig.h:18
MAX_MQTT_QUEUE_SIZE
static const size_t MAX_MQTT_QUEUE_SIZE
Maximum number of MQTT messages to be sent.
Definition: EnigmaIoTconfig.h:27
DEFAULT_SLEEP_TIME
static const uint32_t DEFAULT_SLEEP_TIME
Default sleep time if it was not set.
Definition: EnigmaIoTconfig.h:41