|
@ -8,9 +8,19 @@ |
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
|
#define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name |
|
|
#define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name |
|
|
|
|
|
|
|
|
|
|
|
#ifndef ADMIN_PASS |
|
|
#define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI) |
|
|
#define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef USE_PASSWORD |
|
|
#define USE_PASSWORD 1 // Insecurity caution! Disabling this will disable password querying completely. |
|
|
#define USE_PASSWORD 1 // Insecurity caution! Disabling this will disable password querying completely. |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LOOP_DELAY_TIME |
|
|
#define LOOP_DELAY_TIME 10 // Delay for this millis in the main loop [0-250] |
|
|
#define LOOP_DELAY_TIME 10 // Delay for this millis in the main loop [0-250] |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
// TELNET |
|
|
// TELNET |
|
@ -72,6 +82,20 @@ |
|
|
// To receive the message son the destination computer use nc: |
|
|
// To receive the message son the destination computer use nc: |
|
|
// nc -ul 8113 |
|
|
// nc -ul 8113 |
|
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_UDP_SUPPORT |
|
|
|
|
|
#define DEBUG_UDP_SUPPORT 0 // Enable UDP debug log |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_UDP_IP |
|
|
|
|
|
#define DEBUG_UDP_IP IPAddress(192, 168, 1, 100) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_UDP_PORT |
|
|
|
|
|
#define DEBUG_UDP_PORT 8113 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
|
#ifndef DEBUG_TELNET_SUPPORT |
|
|
#ifndef DEBUG_TELNET_SUPPORT |
|
|
#define DEBUG_TELNET_SUPPORT TELNET_SUPPORT // Enable telnet debug log if telnet is enabled too |
|
|
#define DEBUG_TELNET_SUPPORT TELNET_SUPPORT // Enable telnet debug log if telnet is enabled too |
|
|
#endif |
|
|
#endif |
|
@ -82,7 +106,9 @@ |
|
|
#define DEBUG_UDP_IP IPAddress(192, 168, 1, 100) |
|
|
#define DEBUG_UDP_IP IPAddress(192, 168, 1, 100) |
|
|
#define DEBUG_UDP_PORT 8113 |
|
|
#define DEBUG_UDP_PORT 8113 |
|
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_WEB_ENABLED |
|
|
#define DEBUG_WEB_ENABLED 1 // Enable debug output by default |
|
|
#define DEBUG_WEB_ENABLED 1 // Enable debug output by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
@ -108,6 +134,7 @@ |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#define SYSTEM_CHECK_TIME 60000 // The system is considered stable after these many millis |
|
|
#define SYSTEM_CHECK_TIME 60000 // The system is considered stable after these many millis |
|
|
|
|
|
|
|
|
#ifndef SYSTEM_CHECK_MAX |
|
|
#ifndef SYSTEM_CHECK_MAX |
|
|
#define SYSTEM_CHECK_MAX 5 // After this many crashes on boot |
|
|
#define SYSTEM_CHECK_MAX 5 // After this many crashes on boot |
|
|
// the system is flagged as unstable |
|
|
// the system is flagged as unstable |
|
@ -156,8 +183,13 @@ |
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
// Load average |
|
|
// Load average |
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
|
|
|
#ifndef LOADAVG_INTERVAL |
|
|
#define LOADAVG_INTERVAL 30000 // Interval between calculating load average (in ms) |
|
|
#define LOADAVG_INTERVAL 30000 // Interval between calculating load average (in ms) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LOADAVG_REPORT |
|
|
#define LOADAVG_REPORT 1 // Should we report Load average over MQTT? |
|
|
#define LOADAVG_REPORT 1 // Should we report Load average over MQTT? |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
// BUTTON |
|
|
// BUTTON |
|
@ -184,81 +216,128 @@ |
|
|
//------------------------------------------------------------------------------ |
|
|
//------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
|
// Default boot mode: 0 means OFF, 1 ON and 2 whatever was before |
|
|
// Default boot mode: 0 means OFF, 1 ON and 2 whatever was before |
|
|
|
|
|
#ifndef RELAY_BOOT_MODE |
|
|
#define RELAY_BOOT_MODE RELAY_BOOT_OFF |
|
|
#define RELAY_BOOT_MODE RELAY_BOOT_OFF |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// 0 means ANY, 1 zero or one and 2 one and only one |
|
|
// 0 means ANY, 1 zero or one and 2 one and only one |
|
|
|
|
|
#ifndef RELAY_SYNC |
|
|
#define RELAY_SYNC RELAY_SYNC_ANY |
|
|
#define RELAY_SYNC RELAY_SYNC_ANY |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Default pulse mode: 0 means no pulses, 1 means normally off, 2 normally on |
|
|
// Default pulse mode: 0 means no pulses, 1 means normally off, 2 normally on |
|
|
|
|
|
#ifndef RELAY_PULSE_MODE |
|
|
#define RELAY_PULSE_MODE RELAY_PULSE_NONE |
|
|
#define RELAY_PULSE_MODE RELAY_PULSE_NONE |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Default pulse time in seconds |
|
|
// Default pulse time in seconds |
|
|
|
|
|
#ifndef RELAY_PULSE_TIME |
|
|
#define RELAY_PULSE_TIME 1.0 |
|
|
#define RELAY_PULSE_TIME 1.0 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Relay requests flood protection window - in seconds |
|
|
// Relay requests flood protection window - in seconds |
|
|
|
|
|
#ifndef RELAY_FLOOD_WINDOW |
|
|
#define RELAY_FLOOD_WINDOW 3 |
|
|
#define RELAY_FLOOD_WINDOW 3 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Allowed actual relay changes inside requests flood protection window |
|
|
// Allowed actual relay changes inside requests flood protection window |
|
|
|
|
|
#ifndef RELAY_FLOOD_CHANGES |
|
|
#define RELAY_FLOOD_CHANGES 5 |
|
|
#define RELAY_FLOOD_CHANGES 5 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Pulse with in milliseconds for a latched relay |
|
|
// Pulse with in milliseconds for a latched relay |
|
|
|
|
|
#ifndef RELAY_LATCHING_PULSE |
|
|
#define RELAY_LATCHING_PULSE 10 |
|
|
#define RELAY_LATCHING_PULSE 10 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Do not save relay state after these many milliseconds |
|
|
// Do not save relay state after these many milliseconds |
|
|
|
|
|
#ifndef RELAY_SAVE_DELAY |
|
|
#define RELAY_SAVE_DELAY 1000 |
|
|
#define RELAY_SAVE_DELAY 1000 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// WIFI |
|
|
// WIFI |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_CONNECT_TIMEOUT |
|
|
#define WIFI_CONNECT_TIMEOUT 60000 // Connecting timeout for WIFI in ms |
|
|
#define WIFI_CONNECT_TIMEOUT 60000 // Connecting timeout for WIFI in ms |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_RECONNECT_INTERVAL |
|
|
#define WIFI_RECONNECT_INTERVAL 180000 // If could not connect to WIFI, retry after this time in ms |
|
|
#define WIFI_RECONNECT_INTERVAL 180000 // If could not connect to WIFI, retry after this time in ms |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations |
|
|
#define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_AP_MODE |
|
|
#define WIFI_AP_MODE AP_MODE_ALONE |
|
|
#define WIFI_AP_MODE AP_MODE_ALONE |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_SLEEP_MODE |
|
|
#define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP |
|
|
#define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_SCAN_NETWORKS |
|
|
#define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting |
|
|
#define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// Optional hardcoded configuration (up to 2 networks) |
|
|
// Optional hardcoded configuration (up to 2 networks) |
|
|
#ifndef WIFI1_SSID |
|
|
#ifndef WIFI1_SSID |
|
|
#define WIFI1_SSID "" |
|
|
#define WIFI1_SSID "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI1_PASS |
|
|
#ifndef WIFI1_PASS |
|
|
#define WIFI1_PASS "" |
|
|
#define WIFI1_PASS "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI1_IP |
|
|
#ifndef WIFI1_IP |
|
|
#define WIFI1_IP "" |
|
|
#define WIFI1_IP "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI1_GW |
|
|
#ifndef WIFI1_GW |
|
|
#define WIFI1_GW "" |
|
|
#define WIFI1_GW "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI1_MASK |
|
|
#ifndef WIFI1_MASK |
|
|
#define WIFI1_MASK "" |
|
|
#define WIFI1_MASK "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI1_DNS |
|
|
#ifndef WIFI1_DNS |
|
|
#define WIFI1_DNS "" |
|
|
#define WIFI1_DNS "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_SSID |
|
|
#ifndef WIFI2_SSID |
|
|
#define WIFI2_SSID "" |
|
|
#define WIFI2_SSID "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_PASS |
|
|
#ifndef WIFI2_PASS |
|
|
#define WIFI2_PASS "" |
|
|
#define WIFI2_PASS "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_IP |
|
|
#ifndef WIFI2_IP |
|
|
#define WIFI2_IP "" |
|
|
#define WIFI2_IP "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_GW |
|
|
#ifndef WIFI2_GW |
|
|
#define WIFI2_GW "" |
|
|
#define WIFI2_GW "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_MASK |
|
|
#ifndef WIFI2_MASK |
|
|
#define WIFI2_MASK "" |
|
|
#define WIFI2_MASK "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef WIFI2_DNS |
|
|
#ifndef WIFI2_DNS |
|
|
#define WIFI2_DNS "" |
|
|
#define WIFI2_DNS "" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_RSSI_1M |
|
|
#define WIFI_RSSI_1M -30 // Calibrate it with your router reading the RSSI at 1m |
|
|
#define WIFI_RSSI_1M -30 // Calibrate it with your router reading the RSSI at 1m |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIFI_PROPAGATION_CONST |
|
|
#define WIFI_PROPAGATION_CONST 4 // This is typically something between 2.7 to 4.3 (free space is 2) |
|
|
#define WIFI_PROPAGATION_CONST 4 // This is typically something between 2.7 to 4.3 (free space is 2) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// WEB |
|
|
// WEB |
|
@ -274,32 +353,63 @@ |
|
|
|
|
|
|
|
|
// This is not working at the moment!! |
|
|
// This is not working at the moment!! |
|
|
// Requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core 2.4.0 |
|
|
// Requires ASYNC_TCP_SSL_ENABLED to 1 and ESP8266 Arduino Core 2.4.0 |
|
|
|
|
|
#ifndef WEB_SSL_ENABLED |
|
|
#define WEB_SSL_ENABLED 0 // Use HTTPS web interface |
|
|
#define WEB_SSL_ENABLED 0 // Use HTTPS web interface |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#define WEB_MODE_NORMAL 0 |
|
|
|
|
|
#define WEB_MODE_PASSWORD 1 |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WEB_USERNAME |
|
|
#define WEB_USERNAME "admin" // HTTP username |
|
|
#define WEB_USERNAME "admin" // HTTP username |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WEB_FORCE_PASS_CHANGE |
|
|
#define WEB_FORCE_PASS_CHANGE 1 // Force the user to change the password if default one |
|
|
#define WEB_FORCE_PASS_CHANGE 1 // Force the user to change the password if default one |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WEB_PORT |
|
|
#define WEB_PORT 80 // HTTP port |
|
|
#define WEB_PORT 80 // HTTP port |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// WEBSOCKETS |
|
|
// WEBSOCKETS |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
// This will only be enabled if WEB_SUPPORT is 1 (this is the default value) |
|
|
// This will only be enabled if WEB_SUPPORT is 1 (this is the default value) |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WS_AUTHENTICATION |
|
|
#define WS_AUTHENTICATION 1 // WS authentication ON by default (see #507) |
|
|
#define WS_AUTHENTICATION 1 // WS authentication ON by default (see #507) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WS_BUFFER_SIZE |
|
|
#define WS_BUFFER_SIZE 5 // Max number of secured websocket connections |
|
|
#define WS_BUFFER_SIZE 5 // Max number of secured websocket connections |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WS_TIMEOUT |
|
|
#define WS_TIMEOUT 1800000 // Timeout for secured websocket |
|
|
#define WS_TIMEOUT 1800000 // Timeout for secured websocket |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef WS_UPDATE_INTERVAL |
|
|
#define WS_UPDATE_INTERVAL 30000 // Update clients every 30 seconds |
|
|
#define WS_UPDATE_INTERVAL 30000 // Update clients every 30 seconds |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// API |
|
|
// API |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
// This will only be enabled if WEB_SUPPORT is 1 (this is the default value) |
|
|
// This will only be enabled if WEB_SUPPORT is 1 (this is the default value) |
|
|
|
|
|
|
|
|
|
|
|
#ifndef API_ENABLED |
|
|
#define API_ENABLED 0 // Do not enable API by default |
|
|
#define API_ENABLED 0 // Do not enable API by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef API_BUFFER_SIZE |
|
|
#define API_BUFFER_SIZE 15 // Size of the buffer for HTTP GET API responses |
|
|
#define API_BUFFER_SIZE 15 // Size of the buffer for HTTP GET API responses |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef API_REAL_TIME_VALUES |
|
|
#define API_REAL_TIME_VALUES 0 // Show filtered/median values by default (0 => median, 1 => real time) |
|
|
#define API_REAL_TIME_VALUES 0 // Show filtered/median values by default (0 => median, 1 => real time) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// MDNS / LLMNR / NETBIOS / SSDP |
|
|
// MDNS / LLMNR / NETBIOS / SSDP |
|
@ -344,7 +454,10 @@ |
|
|
// OTA |
|
|
// OTA |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
#ifndef OTA_PORT |
|
|
#define OTA_PORT 8266 // OTA port |
|
|
#define OTA_PORT 8266 // OTA port |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#define OTA_GITHUB_FP "D7:9F:07:61:10:B3:92:93:E3:49:AC:89:84:5B:03:80:C1:9E:2F:8B" |
|
|
#define OTA_GITHUB_FP "D7:9F:07:61:10:B3:92:93:E3:49:AC:89:84:5B:03:80:C1:9E:2F:8B" |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
@ -355,9 +468,17 @@ |
|
|
#define NOFUSS_SUPPORT 0 // Do not enable support for NoFuss by default (12.65Kb) |
|
|
#define NOFUSS_SUPPORT 0 // Do not enable support for NoFuss by default (12.65Kb) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NOFUSS_ENABLED |
|
|
#define NOFUSS_ENABLED 0 // Do not perform NoFUSS updates by default |
|
|
#define NOFUSS_ENABLED 0 // Do not perform NoFUSS updates by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NOFUSS_SERVER |
|
|
#define NOFUSS_SERVER "" // Default NoFuss Server |
|
|
#define NOFUSS_SERVER "" // Default NoFuss Server |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NOFUSS_INTERVAL |
|
|
#define NOFUSS_INTERVAL 3600000 // Check for updates every hour |
|
|
#define NOFUSS_INTERVAL 3600000 // Check for updates every hour |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// UART <-> MQTT |
|
|
// UART <-> MQTT |
|
@ -367,11 +488,26 @@ |
|
|
#define UART_MQTT_SUPPORT 0 // No support by default |
|
|
#define UART_MQTT_SUPPORT 0 // No support by default |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef UART_MQTT_USE_SOFT |
|
|
#define UART_MQTT_USE_SOFT 0 // Use SoftwareSerial |
|
|
#define UART_MQTT_USE_SOFT 0 // Use SoftwareSerial |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef UART_MQTT_HW_PORT |
|
|
#define UART_MQTT_HW_PORT Serial // Hardware serial port (if UART_MQTT_USE_SOFT == 0) |
|
|
#define UART_MQTT_HW_PORT Serial // Hardware serial port (if UART_MQTT_USE_SOFT == 0) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef UART_MQTT_RX_PIN |
|
|
#define UART_MQTT_RX_PIN 4 // RX PIN (if UART_MQTT_USE_SOFT == 1) |
|
|
#define UART_MQTT_RX_PIN 4 // RX PIN (if UART_MQTT_USE_SOFT == 1) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef UART_MQTT_TX_PIN |
|
|
#define UART_MQTT_TX_PIN 5 // TX PIN (if UART_MQTT_USE_SOFT == 1) |
|
|
#define UART_MQTT_TX_PIN 5 // TX PIN (if UART_MQTT_USE_SOFT == 1) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef UART_MQTT_BAUDRATE |
|
|
#define UART_MQTT_BAUDRATE 115200 // Serial speed |
|
|
#define UART_MQTT_BAUDRATE 115200 // Serial speed |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#define UART_MQTT_BUFFER_SIZE 100 // UART buffer size |
|
|
#define UART_MQTT_BUFFER_SIZE 100 // UART buffer size |
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
@ -404,31 +540,91 @@ |
|
|
// $ echo -n | openssl s_client -connect m11.cloudmqtt.com:24055 > cloudmqtt.pem |
|
|
// $ echo -n | openssl s_client -connect m11.cloudmqtt.com:24055 > cloudmqtt.pem |
|
|
// $ openssl x509 -noout -in cloudmqtt.pem -fingerprint -sha1 |
|
|
// $ openssl x509 -noout -in cloudmqtt.pem -fingerprint -sha1 |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_SSL_ENABLED |
|
|
#define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled |
|
|
#define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_SSL_FINGERPRINT |
|
|
#define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server |
|
|
#define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_ENABLED |
|
|
#define MQTT_ENABLED 0 // Do not enable MQTT connection by default |
|
|
#define MQTT_ENABLED 0 // Do not enable MQTT connection by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_AUTOCONNECT |
|
|
#define MQTT_AUTOCONNECT 1 // If enabled and MDNS_SERVER_SUPPORT=1 will perform an autodiscover and |
|
|
#define MQTT_AUTOCONNECT 1 // If enabled and MDNS_SERVER_SUPPORT=1 will perform an autodiscover and |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// autoconnect to the first MQTT broker found if none defined |
|
|
// autoconnect to the first MQTT broker found if none defined |
|
|
|
|
|
#ifndef MQTT_SERVER |
|
|
#define MQTT_SERVER "" // Default MQTT broker address |
|
|
#define MQTT_SERVER "" // Default MQTT broker address |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_USER |
|
|
#define MQTT_USER "" // Default MQTT broker usename |
|
|
#define MQTT_USER "" // Default MQTT broker usename |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_PASS |
|
|
#define MQTT_PASS "" // Default MQTT broker password |
|
|
#define MQTT_PASS "" // Default MQTT broker password |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_PORT |
|
|
#define MQTT_PORT 1883 // MQTT broker port |
|
|
#define MQTT_PORT 1883 // MQTT broker port |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_TOPIC |
|
|
#define MQTT_TOPIC "{hostname}" // Default MQTT base topic |
|
|
#define MQTT_TOPIC "{hostname}" // Default MQTT base topic |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_RETAIN |
|
|
#define MQTT_RETAIN true // MQTT retain flag |
|
|
#define MQTT_RETAIN true // MQTT retain flag |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_QOS |
|
|
#define MQTT_QOS 0 // MQTT QoS value for all messages |
|
|
#define MQTT_QOS 0 // MQTT QoS value for all messages |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_KEEPALIVE |
|
|
#define MQTT_KEEPALIVE 30 // MQTT keepalive value |
|
|
#define MQTT_KEEPALIVE 30 // MQTT keepalive value |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_RECONNECT_DELAY_MIN |
|
|
#define MQTT_RECONNECT_DELAY_MIN 5000 // Try to reconnect in 5 seconds upon disconnection |
|
|
#define MQTT_RECONNECT_DELAY_MIN 5000 // Try to reconnect in 5 seconds upon disconnection |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_RECONNECT_DELAY_STEP |
|
|
#define MQTT_RECONNECT_DELAY_STEP 5000 // Increase the reconnect delay in 5 seconds after each failed attempt |
|
|
#define MQTT_RECONNECT_DELAY_STEP 5000 // Increase the reconnect delay in 5 seconds after each failed attempt |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_RECONNECT_DELAY_MAX |
|
|
#define MQTT_RECONNECT_DELAY_MAX 120000 // Set reconnect time to 2 minutes at most |
|
|
#define MQTT_RECONNECT_DELAY_MAX 120000 // Set reconnect time to 2 minutes at most |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_SKIP_RETAINED |
|
|
#define MQTT_SKIP_RETAINED 1 // Skip retained messages on connection |
|
|
#define MQTT_SKIP_RETAINED 1 // Skip retained messages on connection |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_SKIP_TIME |
|
|
#define MQTT_SKIP_TIME 1000 // Skip messages for 1 second anter connection |
|
|
#define MQTT_SKIP_TIME 1000 // Skip messages for 1 second anter connection |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_USE_JSON |
|
|
#define MQTT_USE_JSON 0 // Group messages in a JSON body |
|
|
#define MQTT_USE_JSON 0 // Group messages in a JSON body |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_USE_JSON_DELAY |
|
|
#define MQTT_USE_JSON_DELAY 100 // Wait this many ms before grouping messages |
|
|
#define MQTT_USE_JSON_DELAY 100 // Wait this many ms before grouping messages |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MQTT_QUEUE_MAX_SIZE |
|
|
#define MQTT_QUEUE_MAX_SIZE 20 // Size of the MQTT queue when MQTT_USE_JSON is enabled |
|
|
#define MQTT_QUEUE_MAX_SIZE 20 // Size of the MQTT queue when MQTT_USE_JSON is enabled |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// These are the properties that will be sent when useJson is true |
|
|
// These are the properties that will be sent when useJson is true |
|
|
#ifndef MQTT_ENQUEUE_IP |
|
|
#ifndef MQTT_ENQUEUE_IP |
|
@ -544,7 +740,10 @@ |
|
|
#define LIGHT_SAVE_ENABLED 1 // Light channel values saved by default after each change |
|
|
#define LIGHT_SAVE_ENABLED 1 // Light channel values saved by default after each change |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_SAVE_DELAY |
|
|
#define LIGHT_SAVE_DELAY 5 // Persist color after 5 seconds to avoid wearing out |
|
|
#define LIGHT_SAVE_DELAY 5 // Persist color after 5 seconds to avoid wearing out |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_MAX_PWM |
|
|
#ifndef LIGHT_MAX_PWM |
|
|
|
|
|
|
|
@ -566,20 +765,58 @@ |
|
|
#define LIGHT_MAX_VALUE 255 // Maximum light value |
|
|
#define LIGHT_MAX_VALUE 255 // Maximum light value |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_MAX_BRIGHTNESS |
|
|
#define LIGHT_MAX_BRIGHTNESS 255 // Maximun brightness value |
|
|
#define LIGHT_MAX_BRIGHTNESS 255 // Maximun brightness value |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
//#define LIGHT_MIN_MIREDS 153 // NOT USED (yet)! // Default to the Philips Hue value that HA has always assumed |
|
|
//#define LIGHT_MIN_MIREDS 153 // NOT USED (yet)! // Default to the Philips Hue value that HA has always assumed |
|
|
//#define LIGHT_MAX_MIREDS 500 // NOT USED (yet)! // https://developers.meethue.com/documentation/core-concepts |
|
|
//#define LIGHT_MAX_MIREDS 500 // NOT USED (yet)! // https://developers.meethue.com/documentation/core-concepts |
|
|
|
|
|
#ifndef LIGHT_DEFAULT_MIREDS |
|
|
#define LIGHT_DEFAULT_MIREDS 153 // Default value used by MQTT. This value is __NEVRER__ applied! |
|
|
#define LIGHT_DEFAULT_MIREDS 153 // Default value used by MQTT. This value is __NEVRER__ applied! |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_STEP |
|
|
#define LIGHT_STEP 32 // Step size |
|
|
#define LIGHT_STEP 32 // Step size |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_COLOR |
|
|
#define LIGHT_USE_COLOR 1 // Use 3 first channels as RGB |
|
|
#define LIGHT_USE_COLOR 1 // Use 3 first channels as RGB |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_WHITE |
|
|
#define LIGHT_USE_WHITE 0 // Use white channel whenever RGB have the same value |
|
|
#define LIGHT_USE_WHITE 0 // Use white channel whenever RGB have the same value |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_GAMMA |
|
|
#define LIGHT_USE_GAMMA 0 // Use gamma correction for color channels |
|
|
#define LIGHT_USE_GAMMA 0 // Use gamma correction for color channels |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_CSS |
|
|
#define LIGHT_USE_CSS 1 // Use CSS style to report colors (1=> "#FF0000", 0=> "255,0,0") |
|
|
#define LIGHT_USE_CSS 1 // Use CSS style to report colors (1=> "#FF0000", 0=> "255,0,0") |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_RGB |
|
|
#define LIGHT_USE_RGB 0 // Use RGB color selector (1=> RGB, 0=> HSV) |
|
|
#define LIGHT_USE_RGB 0 // Use RGB color selector (1=> RGB, 0=> HSV) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_WHITE_FACTOR |
|
|
|
|
|
#define LIGHT_WHITE_FACTOR 1 // When using LIGHT_USE_WHITE with uneven brightness LEDs, |
|
|
|
|
|
// this factor is used to scale the white channel to match brightness |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_USE_TRANSITIONS |
|
|
#define LIGHT_USE_TRANSITIONS 1 // Transitions between colors |
|
|
#define LIGHT_USE_TRANSITIONS 1 // Transitions between colors |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_TRANSITION_STEP |
|
|
#define LIGHT_TRANSITION_STEP 10 // Time in millis between each transtion step |
|
|
#define LIGHT_TRANSITION_STEP 10 // Time in millis between each transtion step |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LIGHT_TRANSITION_TIME |
|
|
#define LIGHT_TRANSITION_TIME 500 // Time in millis from color to color |
|
|
#define LIGHT_TRANSITION_TIME 500 // Time in millis from color to color |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// DOMOTICZ |
|
|
// DOMOTICZ |
|
@ -612,12 +849,30 @@ |
|
|
#define INFLUXDB_SUPPORT 0 // Disable InfluxDB support by default (4.38Kb) |
|
|
#define INFLUXDB_SUPPORT 0 // Disable InfluxDB support by default (4.38Kb) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_ENABLED |
|
|
#define INFLUXDB_ENABLED 0 // InfluxDB disabled by default |
|
|
#define INFLUXDB_ENABLED 0 // InfluxDB disabled by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_HOST |
|
|
#define INFLUXDB_HOST "" // Default server |
|
|
#define INFLUXDB_HOST "" // Default server |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_PORT |
|
|
#define INFLUXDB_PORT 8086 // Default InfluxDB port |
|
|
#define INFLUXDB_PORT 8086 // Default InfluxDB port |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_DATABASE |
|
|
#define INFLUXDB_DATABASE "" // Default database |
|
|
#define INFLUXDB_DATABASE "" // Default database |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_USERNAME |
|
|
#define INFLUXDB_USERNAME "" // Default username |
|
|
#define INFLUXDB_USERNAME "" // Default username |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef INFLUXDB_PASSWORD |
|
|
#define INFLUXDB_PASSWORD "" // Default password |
|
|
#define INFLUXDB_PASSWORD "" // Default password |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// THINGSPEAK |
|
|
// THINGSPEAK |
|
@ -666,14 +921,38 @@ |
|
|
#define NTP_SUPPORT 1 // Build with NTP support by default (6.78Kb) |
|
|
#define NTP_SUPPORT 1 // Build with NTP support by default (6.78Kb) |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_SERVER |
|
|
#define NTP_SERVER "pool.ntp.org" // Default NTP server |
|
|
#define NTP_SERVER "pool.ntp.org" // Default NTP server |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_TIMEOUT |
|
|
#define NTP_TIMEOUT 2000 // Set NTP request timeout to 2 seconds (issue #452) |
|
|
#define NTP_TIMEOUT 2000 // Set NTP request timeout to 2 seconds (issue #452) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_TIME_OFFSET |
|
|
#define NTP_TIME_OFFSET 60 // Default timezone offset (GMT+1) |
|
|
#define NTP_TIME_OFFSET 60 // Default timezone offset (GMT+1) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_DAY_LIGHT |
|
|
#define NTP_DAY_LIGHT true // Enable daylight time saving by default |
|
|
#define NTP_DAY_LIGHT true // Enable daylight time saving by default |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_SYNC_INTERVAL |
|
|
#define NTP_SYNC_INTERVAL 60 // NTP initial check every minute |
|
|
#define NTP_SYNC_INTERVAL 60 // NTP initial check every minute |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_UPDATE_INTERVAL |
|
|
#define NTP_UPDATE_INTERVAL 1800 // NTP check every 30 minutes |
|
|
#define NTP_UPDATE_INTERVAL 1800 // NTP check every 30 minutes |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_START_DELAY |
|
|
#define NTP_START_DELAY 1000 // Delay NTP start 1 second |
|
|
#define NTP_START_DELAY 1000 // Delay NTP start 1 second |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef NTP_DST_REGION |
|
|
#define NTP_DST_REGION 0 // 0 for Europe, 1 for USA (defined in NtpClientLib) |
|
|
#define NTP_DST_REGION 0 // 0 for Europe, 1 for USA (defined in NtpClientLib) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ALEXA |
|
|
// ALEXA |
|
@ -694,12 +973,24 @@ |
|
|
// This module is not compatible with RF_SUPPORT=1 |
|
|
// This module is not compatible with RF_SUPPORT=1 |
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
#ifndef RF_SEND_TIMES |
|
|
#define RF_SEND_TIMES 4 // How many times to send the message |
|
|
#define RF_SEND_TIMES 4 // How many times to send the message |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef RF_SEND_DELAY |
|
|
#define RF_SEND_DELAY 500 // Interval between sendings in ms |
|
|
#define RF_SEND_DELAY 500 // Interval between sendings in ms |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef RF_RECEIVE_DELAY |
|
|
#define RF_RECEIVE_DELAY 500 // Interval between recieving in ms (avoid debouncing) |
|
|
#define RF_RECEIVE_DELAY 500 // Interval between recieving in ms (avoid debouncing) |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef RF_RAW_SUPPORT |
|
|
#define RF_RAW_SUPPORT 0 // RF raw codes require a specific firmware for the EFM8BB1 |
|
|
#define RF_RAW_SUPPORT 0 // RF raw codes require a specific firmware for the EFM8BB1 |
|
|
// https://github.com/rhx/RF-Bridge-EFM8BB1 |
|
|
// https://github.com/rhx/RF-Bridge-EFM8BB1 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------------- |
|
|
// IR |
|
|
// IR |
|
|