EnigmaIOT  0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
Macros | Variables
EnigmaIoTconfig.h File Reference

Parameter configuration. More...

#include "Arduino.h"
#include "EnigmaIoTconfigAdvanced.h"

Go to the source code of this file.

Macros

#define TZINFO   "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00"
 Time zone. More...
 
#define NTP_SERVER_1   "pool.ntp.org"
 
#define NTP_SERVER_2   "time.nist.gov"
 
#define ENABLE_STATUS_MESSAGES   1
 Enable sending status message after every data message. More...
 
#define CONNECT_TO_WIFI_AP   1
 In projects where gateway should not be connected to WiFi (for instance a data logger to SD) it may be useful to disable WiFi setting this to 0. Set it to 1 otherwise. More...
 
#define ENABLE_WEB_API   1
 Enable Web API support on gateway. More...
 
#define DEBUG_ESP_PORT   Serial
 Stream to output debug info. It will normally be Serial More...
 
#define DEBUG_LEVEL   WARN
 Possible values VERBOSE, DBG, INFO, WARN, ERROR, NONE. More...
 

Variables

static const uint8_t ENIGMAIOT_PROT_VERS [3] = { 0,9,8 }
 EnitmaIoT Version. More...
 
static const uint8_t DEFAULT_CHANNEL = 3
 WiFi channel to be used on ESP-NOW. More...
 
static const uint32_t FLASH_LED_TIME = 30
 Time that led keeps on during flash in ms. More...
 
static const int RESET_PIN_DURATION = 5000
 Number of milliseconds that reset pin has to be grounded to produce a configuration reset. More...
 
static const unsigned int MAX_KEY_VALIDITY = 172800000U
 After this time (in ms) a node is unregistered. Setting this to 0 means imfinite. More...
 
static const unsigned int MAX_NODE_INACTIVITY = 86400000U
 After this time (in ms) a node is marked as gone. Setting this to 0 means imfinite. More...
 
static const size_t MAX_MQTT_QUEUE_SIZE = 3
 Maximum number of MQTT messages to be sent. More...
 
static const int RATE_AVE_ORDER = 5
 Message rate filter order. More...
 
static const int MAX_INPUT_QUEUE_SIZE = 3
 Input queue size for EnigmaIOT messages. Acts as a buffer to be able to handle messages during high load. More...
 
static const int NUM_NODES = 35
 Maximum number of nodes that this gateway can handle. More...
 
static const int16_t RECONNECTION_PERIOD = 1500
 Time to retry Gateway connection. More...
 
static const uint16_t DOWNLINK_WAIT_TIME = 350
 Time to wait for downlink message before sleep. Setting less than 180 ms causes ESP-NOW errors due to lack of ACK processing. More...
 
static const uint32_t DEFAULT_SLEEP_TIME = 10
 Default sleep time if it was not set. More...
 
static const time_t IDENTIFY_TIMEOUT = 10000
 How long LED will be flashing during identification. More...
 
static const uint32_t TIME_SYNC_PERIOD = 30000
 Period of clock synchronization request. More...
 
static const unsigned int QUICK_SYNC_TIME = 5000
 Period of clock synchronization request in case of resync is needed. More...
 
static const uint32_t PRE_REG_DELAY = 5000
 Time to wait before registration so that other nodes have time to communicate. Real delay is a random lower than this value. More...
 
static const uint32_t POST_REG_DELAY = 1500
 Time to wait before sending data after registration so that other nodes have time to finish their registration. Real delay is a random lower than this value. More...
 
static const uint8_t COMM_ERRORS_BEFORE_SCAN = 2
 Node will search for a gateway if this number of communication errors have happened. More...
 

Detailed Description

Parameter configuration.

Version
0.9.8
Date
15/07/2021
Author
German Martin

Definition in file EnigmaIoTconfig.h.

Macro Definition Documentation

◆ CONNECT_TO_WIFI_AP

#define CONNECT_TO_WIFI_AP   1

In projects where gateway should not be connected to WiFi (for instance a data logger to SD) it may be useful to disable WiFi setting this to 0. Set it to 1 otherwise.

Definition at line 35 of file EnigmaIoTconfig.h.

◆ DEBUG_ESP_PORT

#define DEBUG_ESP_PORT   Serial

Stream to output debug info. It will normally be Serial

Definition at line 58 of file EnigmaIoTconfig.h.

◆ DEBUG_LEVEL

#define DEBUG_LEVEL   WARN

Possible values VERBOSE, DBG, INFO, WARN, ERROR, NONE.

Definition at line 62 of file EnigmaIoTconfig.h.

◆ ENABLE_STATUS_MESSAGES

#define ENABLE_STATUS_MESSAGES   1

Enable sending status message after every data message.

Definition at line 28 of file EnigmaIoTconfig.h.

◆ ENABLE_WEB_API

#define ENABLE_WEB_API   1

Enable Web API support on gateway.

Definition at line 54 of file EnigmaIoTconfig.h.

◆ NTP_SERVER_1

#define NTP_SERVER_1   "pool.ntp.org"

Definition at line 21 of file EnigmaIoTconfig.h.

◆ NTP_SERVER_2

#define NTP_SERVER_2   "time.nist.gov"

Definition at line 22 of file EnigmaIoTconfig.h.

◆ TZINFO

#define TZINFO   "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00"

Time zone.

Definition at line 20 of file EnigmaIoTconfig.h.

Variable Documentation

◆ COMM_ERRORS_BEFORE_SCAN

const uint8_t COMM_ERRORS_BEFORE_SCAN = 2
static

Node will search for a gateway if this number of communication errors have happened.

Definition at line 51 of file EnigmaIoTconfig.h.

◆ DEFAULT_CHANNEL

const uint8_t DEFAULT_CHANNEL = 3
static

WiFi channel to be used on ESP-NOW.

Definition at line 17 of file EnigmaIoTconfig.h.

◆ DEFAULT_SLEEP_TIME

const uint32_t DEFAULT_SLEEP_TIME = 10
static

Default sleep time if it was not set.

Definition at line 41 of file EnigmaIoTconfig.h.

◆ DOWNLINK_WAIT_TIME

const uint16_t DOWNLINK_WAIT_TIME = 350
static

Time to wait for downlink message before sleep. Setting less than 180 ms causes ESP-NOW errors due to lack of ACK processing.

Definition at line 40 of file EnigmaIoTconfig.h.

◆ ENIGMAIOT_PROT_VERS

const uint8_t ENIGMAIOT_PROT_VERS[3] = { 0,9,8 }
static

EnitmaIoT Version.

Definition at line 16 of file EnigmaIoTconfig.h.

◆ FLASH_LED_TIME

const uint32_t FLASH_LED_TIME = 30
static

Time that led keeps on during flash in ms.

Definition at line 18 of file EnigmaIoTconfig.h.

◆ IDENTIFY_TIMEOUT

const time_t IDENTIFY_TIMEOUT = 10000
static

How long LED will be flashing during identification.

Definition at line 42 of file EnigmaIoTconfig.h.

◆ MAX_INPUT_QUEUE_SIZE

const int MAX_INPUT_QUEUE_SIZE = 3
static

Input queue size for EnigmaIOT messages. Acts as a buffer to be able to handle messages during high load.

Definition at line 30 of file EnigmaIoTconfig.h.

◆ MAX_KEY_VALIDITY

const unsigned int MAX_KEY_VALIDITY = 172800000U
static

After this time (in ms) a node is unregistered. Setting this to 0 means imfinite.

Definition at line 25 of file EnigmaIoTconfig.h.

◆ MAX_MQTT_QUEUE_SIZE

const size_t MAX_MQTT_QUEUE_SIZE = 3
static

Maximum number of MQTT messages to be sent.

Definition at line 27 of file EnigmaIoTconfig.h.

◆ MAX_NODE_INACTIVITY

const unsigned int MAX_NODE_INACTIVITY = 86400000U
static

After this time (in ms) a node is marked as gone. Setting this to 0 means imfinite.

Definition at line 26 of file EnigmaIoTconfig.h.

◆ NUM_NODES

const int NUM_NODES = 35
static

Maximum number of nodes that this gateway can handle.

Definition at line 32 of file EnigmaIoTconfig.h.

◆ POST_REG_DELAY

const uint32_t POST_REG_DELAY = 1500
static

Time to wait before sending data after registration so that other nodes have time to finish their registration. Real delay is a random lower than this value.

Definition at line 50 of file EnigmaIoTconfig.h.

◆ PRE_REG_DELAY

const uint32_t PRE_REG_DELAY = 5000
static

Time to wait before registration so that other nodes have time to communicate. Real delay is a random lower than this value.

Definition at line 48 of file EnigmaIoTconfig.h.

◆ QUICK_SYNC_TIME

const unsigned int QUICK_SYNC_TIME = 5000
static

Period of clock synchronization request in case of resync is needed.

Definition at line 46 of file EnigmaIoTconfig.h.

◆ RATE_AVE_ORDER

const int RATE_AVE_ORDER = 5
static

Message rate filter order.

Definition at line 29 of file EnigmaIoTconfig.h.

◆ RECONNECTION_PERIOD

const int16_t RECONNECTION_PERIOD = 1500
static

Time to retry Gateway connection.

Definition at line 39 of file EnigmaIoTconfig.h.

◆ RESET_PIN_DURATION

const int RESET_PIN_DURATION = 5000
static

Number of milliseconds that reset pin has to be grounded to produce a configuration reset.

Definition at line 19 of file EnigmaIoTconfig.h.

◆ TIME_SYNC_PERIOD

const uint32_t TIME_SYNC_PERIOD = 30000
static

Period of clock synchronization request.

Definition at line 44 of file EnigmaIoTconfig.h.