Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1819 lines
61 KiB

8 years ago
8 years ago
6 years ago
7 years ago
7 years ago
7 years ago
3 years ago
Terminal: change command-line parser (#2247) Change the underlying command line handling: - switch to a custom parser, inspired by redis / sds - update terminalRegisterCommand signature, pass only bare minimum - clean-up `help` & `commands`. update settings `set`, `get` and `del` - allow our custom test suite to run command-line tests - clean-up Stream IO to allow us to print large things into debug stream (for example, `eeprom.dump`) - send parsing errors to the debug log As a proof of concept, introduce `TERMINAL_MQTT_SUPPORT` and `TERMINAL_WEB_API_SUPPORT` - MQTT subscribes to the `<root>/cmd/set` and sends response to the `<root>/cmd`. We can't output too much, as we don't have any large-send API. - Web API listens to the `/api/cmd?apikey=...&line=...` (or PUT, params inside the body). This one is intended as a possible replacement of the `API_SUPPORT`. Internals introduce a 'task' around the AsyncWebServerRequest object that will simulate what WiFiClient does and push data into it continuously, switching between CONT and SYS. Both are experimental. We only accept a single command and not every command is updated to use Print `ctx.output` object. We are also somewhat limited by the Print / Stream overall, perhaps I am overestimating the usefulness of Arduino compatibility to such an extent :) Web API handler can also sometimes show only part of the result, whenever the command tries to yield() by itself waiting for something. Perhaps we would need to create a custom request handler for that specific use-case.
4 years ago
api: rework plain and JSON implementations (#2405) - match paths through a custom AsyncWebHandler instead of using generic not-found fallback handler - allow MQTT-like patterns when registering paths (`simple/path`, `path/+/something`, `path/#`) Replaces `relay/0`, `relay/1` etc. with `relay/+`. Magnitudes are plain paths, but using `/+` in case there's more than 1 magnitude of the same type. - restore `std::function` as callback container (no more single-byte arg nonsense). Still, limit to 1 type per handler type - adds JSON handlers which will receive JsonObject root as both input and output. Same logic as plain - GET returns resource data, PUT updates it. - breaking change to `apiAuthenticate(request)`, it no longer will do `request->send(403)` and expect this to be handled externally. - allow `Api-Key` header containing the key, works for both GET & PUT plain requests. The only way to set apikey for JSON. - add `ApiRequest::param` to retrieve both GET and PUT params (aka args), remove ApiBuffer - remove `API_BUFFER_SIZE`. Allow custom form-data key=value pairs for requests, allow to send basic `String`. - add `API_JSON_BUFFER_SIZE` for the JSON buffer (both input and output) - `/apis` replaced with `/api/list`, no longer uses custom handler and is an `apiRegister` callback - `/api/rpc` custom handler replaced with an `apiRegister` callback WIP further down: - no more `webLog` for API requests, unless `webAccessLog` / `WEB_ACCESS_LOG` is set to `1`. This also needs to happen to the other handlers. - migrate to ArduinoJson v6, since it become apparent it is actually a good upgrade :) - actually make use of JSON endpoints more, right now it's just existing GET for sensors and relays - fork ESPAsyncWebServer to cleanup path parsing and temporary objects attached to the request (also, fix things a lot of things based on PRs there...)
3 years ago
Terminal: change command-line parser (#2247) Change the underlying command line handling: - switch to a custom parser, inspired by redis / sds - update terminalRegisterCommand signature, pass only bare minimum - clean-up `help` & `commands`. update settings `set`, `get` and `del` - allow our custom test suite to run command-line tests - clean-up Stream IO to allow us to print large things into debug stream (for example, `eeprom.dump`) - send parsing errors to the debug log As a proof of concept, introduce `TERMINAL_MQTT_SUPPORT` and `TERMINAL_WEB_API_SUPPORT` - MQTT subscribes to the `<root>/cmd/set` and sends response to the `<root>/cmd`. We can't output too much, as we don't have any large-send API. - Web API listens to the `/api/cmd?apikey=...&line=...` (or PUT, params inside the body). This one is intended as a possible replacement of the `API_SUPPORT`. Internals introduce a 'task' around the AsyncWebServerRequest object that will simulate what WiFiClient does and push data into it continuously, switching between CONT and SYS. Both are experimental. We only accept a single command and not every command is updated to use Print `ctx.output` object. We are also somewhat limited by the Print / Stream overall, perhaps I am overestimating the usefulness of Arduino compatibility to such an extent :) Web API handler can also sometimes show only part of the result, whenever the command tries to yield() by itself waiting for something. Perhaps we would need to create a custom request handler for that specific use-case.
4 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
8 years ago
8 years ago
api: rework plain and JSON implementations (#2405) - match paths through a custom AsyncWebHandler instead of using generic not-found fallback handler - allow MQTT-like patterns when registering paths (`simple/path`, `path/+/something`, `path/#`) Replaces `relay/0`, `relay/1` etc. with `relay/+`. Magnitudes are plain paths, but using `/+` in case there's more than 1 magnitude of the same type. - restore `std::function` as callback container (no more single-byte arg nonsense). Still, limit to 1 type per handler type - adds JSON handlers which will receive JsonObject root as both input and output. Same logic as plain - GET returns resource data, PUT updates it. - breaking change to `apiAuthenticate(request)`, it no longer will do `request->send(403)` and expect this to be handled externally. - allow `Api-Key` header containing the key, works for both GET & PUT plain requests. The only way to set apikey for JSON. - add `ApiRequest::param` to retrieve both GET and PUT params (aka args), remove ApiBuffer - remove `API_BUFFER_SIZE`. Allow custom form-data key=value pairs for requests, allow to send basic `String`. - add `API_JSON_BUFFER_SIZE` for the JSON buffer (both input and output) - `/apis` replaced with `/api/list`, no longer uses custom handler and is an `apiRegister` callback - `/api/rpc` custom handler replaced with an `apiRegister` callback WIP further down: - no more `webLog` for API requests, unless `webAccessLog` / `WEB_ACCESS_LOG` is set to `1`. This also needs to happen to the other handlers. - migrate to ArduinoJson v6, since it become apparent it is actually a good upgrade :) - actually make use of JSON endpoints more, right now it's just existing GET for sensors and relays - fork ESPAsyncWebServer to cleanup path parsing and temporary objects attached to the request (also, fix things a lot of things based on PRs there...)
3 years ago
6 years ago
6 years ago
api: rework plain and JSON implementations (#2405) - match paths through a custom AsyncWebHandler instead of using generic not-found fallback handler - allow MQTT-like patterns when registering paths (`simple/path`, `path/+/something`, `path/#`) Replaces `relay/0`, `relay/1` etc. with `relay/+`. Magnitudes are plain paths, but using `/+` in case there's more than 1 magnitude of the same type. - restore `std::function` as callback container (no more single-byte arg nonsense). Still, limit to 1 type per handler type - adds JSON handlers which will receive JsonObject root as both input and output. Same logic as plain - GET returns resource data, PUT updates it. - breaking change to `apiAuthenticate(request)`, it no longer will do `request->send(403)` and expect this to be handled externally. - allow `Api-Key` header containing the key, works for both GET & PUT plain requests. The only way to set apikey for JSON. - add `ApiRequest::param` to retrieve both GET and PUT params (aka args), remove ApiBuffer - remove `API_BUFFER_SIZE`. Allow custom form-data key=value pairs for requests, allow to send basic `String`. - add `API_JSON_BUFFER_SIZE` for the JSON buffer (both input and output) - `/apis` replaced with `/api/list`, no longer uses custom handler and is an `apiRegister` callback - `/api/rpc` custom handler replaced with an `apiRegister` callback WIP further down: - no more `webLog` for API requests, unless `webAccessLog` / `WEB_ACCESS_LOG` is set to `1`. This also needs to happen to the other handlers. - migrate to ArduinoJson v6, since it become apparent it is actually a good upgrade :) - actually make use of JSON endpoints more, right now it's just existing GET for sensors and relays - fork ESPAsyncWebServer to cleanup path parsing and temporary objects attached to the request (also, fix things a lot of things based on PRs there...)
3 years ago
6 years ago
8 years ago
8 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
6 years ago
6 years ago
6 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
8 years ago
6 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
  1. //------------------------------------------------------------------------------
  2. // Do not change this file unless you know what you are doing
  3. // To override user configuration, please see custom.h
  4. //------------------------------------------------------------------------------
  5. #pragma once
  6. //------------------------------------------------------------------------------
  7. // GENERAL
  8. //------------------------------------------------------------------------------
  9. #ifndef DEVICE_NAME
  10. #define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name
  11. #endif
  12. // When defined, ADMIN_PASS must be 8..63 printable ASCII characters. See:
  13. // https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution)
  14. // https://github.com/xoseperez/espurna/issues/1151
  15. #ifndef ADMIN_PASS
  16. #define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI SoftAP)
  17. #endif
  18. #ifndef USE_PASSWORD
  19. #define USE_PASSWORD 1 // Insecurity caution! Disabling this will disable password querying completely.
  20. #endif
  21. #ifndef LOOP_DELAY_TIME
  22. #define LOOP_DELAY_TIME 10 // Delay for the main loop, in millis [0-250]
  23. // Recommended minimum is 10, see:
  24. // https://github.com/xoseperez/espurna/issues/1541
  25. // https://github.com/xoseperez/espurna/issues/1631
  26. // https://github.com/esp8266/Arduino/issues/5825
  27. #endif
  28. //------------------------------------------------------------------------------
  29. // HEARTBEAT
  30. //------------------------------------------------------------------------------
  31. #ifndef HEARTBEAT_MODE
  32. #define HEARTBEAT_MODE HEARTBEAT_REPEAT
  33. #endif
  34. #ifndef HEARTBEAT_INTERVAL
  35. #define HEARTBEAT_INTERVAL 300 // Interval between heartbeat messages
  36. #endif
  37. //------------------------------------------------------------------------------
  38. // DEBUG
  39. //------------------------------------------------------------------------------
  40. // Set global logger mode. One of:
  41. // - DebugLogMode::Enabled
  42. // - DebugLogMode::Disabled
  43. // - DebugLogMode::SkipBoot
  44. #ifndef DEBUG_LOG_MODE
  45. #define DEBUG_LOG_MODE DebugLogMode::Enabled
  46. #endif
  47. // Serial debug log
  48. #ifndef DEBUG_SERIAL_SUPPORT
  49. #define DEBUG_SERIAL_SUPPORT 1 // Enable serial debug log
  50. #endif
  51. #ifndef DEBUG_PORT
  52. #define DEBUG_PORT Serial // Default debugging port
  53. #endif
  54. #ifndef SERIAL_BAUDRATE
  55. #define SERIAL_BAUDRATE 115200 // Default baudrate
  56. #endif
  57. #ifndef DEBUG_ADD_TIMESTAMP
  58. #define DEBUG_ADD_TIMESTAMP 1 // Add timestamp to debug messages
  59. // (in millis overflowing every 1000 seconds)
  60. #endif
  61. // Second serial port (used for RX)
  62. #ifndef SERIAL_RX_ENABLED
  63. #define SERIAL_RX_ENABLED 0 // Secondary serial port for RX
  64. #endif
  65. #ifndef SERIAL_RX_PORT
  66. #define SERIAL_RX_PORT Serial // This setting is usually defined
  67. // in the hardware.h file for those
  68. // boards that require it
  69. #endif
  70. #ifndef SERIAL_RX_BAUDRATE
  71. #define SERIAL_RX_BAUDRATE 115200 // Default baudrate
  72. #endif
  73. //------------------------------------------------------------------------------
  74. // UDP debug log
  75. // To receive the message on the destination computer use nc:
  76. // nc -ul 8113
  77. #ifndef DEBUG_UDP_SUPPORT
  78. #define DEBUG_UDP_SUPPORT 0 // Enable UDP debug log
  79. #endif
  80. #ifndef DEBUG_UDP_IP
  81. #define DEBUG_UDP_IP IPAddress(192, 168, 1, 100)
  82. #endif
  83. #ifndef DEBUG_UDP_PORT
  84. #define DEBUG_UDP_PORT 514
  85. #endif
  86. // If DEBUG_UDP_PORT is set to 514 syslog format is assumed
  87. // (https://tools.ietf.org/html/rfc3164)
  88. // DEBUG_UDP_FAC_PRI is the facility+priority
  89. #define DEBUG_UDP_FAC_PRI (SYSLOG_LOCAL0 | SYSLOG_DEBUG)
  90. //------------------------------------------------------------------------------
  91. #ifndef DEBUG_TELNET_SUPPORT
  92. #define DEBUG_TELNET_SUPPORT 1 // Enable telnet debug log (will only work if TELNET_SUPPORT is also 1)
  93. #endif
  94. //------------------------------------------------------------------------------
  95. #ifndef DEBUG_WEB_SUPPORT
  96. #define DEBUG_WEB_SUPPORT 1 // Enable web debug log (will only work if WEB_SUPPORT is also 1)
  97. #endif
  98. //------------------------------------------------------------------------------
  99. #ifndef DEBUG_LOG_BUFFER_SUPPORT
  100. #define DEBUG_LOG_BUFFER_SUPPORT 1 // Support boot log buffer (1.2Kb)
  101. // Will only work if DEBUG_LOG_BUFFER_ENABLED or runtime setting is also 1
  102. #endif
  103. #ifndef DEBUG_LOG_BUFFER_ENABLED
  104. #define DEBUG_LOG_BUFFER_ENABLED 0 // Disable boot log buffer by default
  105. #endif
  106. #ifndef DEBUG_LOG_BUFFER_SIZE
  107. #define DEBUG_LOG_BUFFER_SIZE 4096 // Store 4 Kb of log strings
  108. // WARNING! Memory is only reclaimed after `debug.buffer` prints the buffer contents
  109. #endif
  110. //------------------------------------------------------------------------------
  111. // TELNET
  112. //------------------------------------------------------------------------------
  113. #ifndef TELNET_SUPPORT
  114. #define TELNET_SUPPORT 1 // Enable telnet support by default (3.34Kb)
  115. #endif
  116. #ifndef TELNET_STA
  117. #define TELNET_STA 0 // By default, disallow connections via STA interface
  118. #endif
  119. #ifndef TELNET_AUTHENTICATION
  120. #define TELNET_AUTHENTICATION 1 // Request password to start telnet session by default
  121. #endif
  122. #ifndef TELNET_PORT
  123. #define TELNET_PORT 23 // Port to listen to telnet clients
  124. #endif
  125. #ifndef TELNET_MAX_CLIENTS
  126. #define TELNET_MAX_CLIENTS 1 // Max number of concurrent telnet clients
  127. #endif
  128. #ifndef TELNET_SERVER
  129. #define TELNET_SERVER TELNET_SERVER_ASYNC // Can be either TELNET_SERVER_ASYNC (using ESPAsyncTCP) or TELNET_SERVER_WIFISERVER (using WiFiServer)
  130. #endif
  131. #ifndef TELNET_SERVER_ASYNC_BUFFERED
  132. #define TELNET_SERVER_ASYNC_BUFFERED 1 // Enable buffered output for telnet server (+1Kb)
  133. // Helps to avoid lost data with lwip2 TCP_MSS=536 option
  134. #endif
  135. // Enable this flag to add support for reverse telnet (+800 bytes)
  136. // This is useful to telnet to a device behind a NAT or firewall
  137. // To use this feature, start a listen server on a publicly reachable host with e.g. "ncat -vlp <port>" and use the MQTT reverse telnet command to connect
  138. #ifndef TELNET_REVERSE_SUPPORT
  139. #define TELNET_REVERSE_SUPPORT 0
  140. #endif
  141. //------------------------------------------------------------------------------
  142. // TERMINAL
  143. //------------------------------------------------------------------------------
  144. #ifndef TERMINAL_SUPPORT
  145. #define TERMINAL_SUPPORT 1 // Enable terminal commands (0.97Kb)
  146. #endif
  147. #ifndef TERMINAL_SHARED_BUFFER_SIZE
  148. #define TERMINAL_SHARED_BUFFER_SIZE 128 // Maximum size for command line, shared by the WebUI, Telnet and Serial
  149. #endif
  150. #ifndef TERMINAL_MQTT_SUPPORT
  151. #define TERMINAL_MQTT_SUPPORT 0 // MQTT Terminal support built in
  152. // Depends on MQTT_SUPPORT and TERMINAL_SUPPORT commands being available
  153. #endif
  154. #ifndef TERMINAL_WEB_API_SUPPORT
  155. #define TERMINAL_WEB_API_SUPPORT 0 // Web server API Terminal support built in
  156. // Depends on WEB_SUPPORT and TERMINAL_SUPPORT commands being available
  157. #endif
  158. #ifndef TERMINAL_WEB_API_PATH
  159. #define TERMINAL_WEB_API_PATH "cmd"
  160. #endif
  161. //------------------------------------------------------------------------------
  162. // SYSTEM CHECK
  163. //------------------------------------------------------------------------------
  164. #ifndef SYSTEM_CHECK_ENABLED
  165. #define SYSTEM_CHECK_ENABLED 1 // Enable crash check by default
  166. #endif
  167. #ifndef SYSTEM_CHECK_TIME
  168. #define SYSTEM_CHECK_TIME 60000 // The system is considered stable after these many millis
  169. #endif
  170. #ifndef SYSTEM_CHECK_MAX
  171. #define SYSTEM_CHECK_MAX 5 // After this many crashes on boot
  172. // the system is flagged as unstable
  173. #endif
  174. //------------------------------------------------------------------------------
  175. // EEPROM
  176. //------------------------------------------------------------------------------
  177. //#define EEPROM_RORATE_SECTORS 2 // Number of sectors to use for EEPROM rotation
  178. // If not defined the firmware will use a number based
  179. // on the number of available sectors
  180. #ifndef SAVE_CRASH_ENABLED
  181. #define SAVE_CRASH_ENABLED 1 // Save stack trace to EEPROM by default
  182. // Depends on DEBUG_SUPPORT == 1
  183. #endif
  184. #ifndef SAVE_CRASH_STACK_TRACE_MAX
  185. #define SAVE_CRASH_STACK_TRACE_MAX 0x80 // limit at 128 bytes (increment/decrement by 16)
  186. #endif
  187. //------------------------------------------------------------------------------
  188. // GARLAND
  189. //------------------------------------------------------------------------------
  190. #ifndef GARLAND_SUPPORT
  191. #define GARLAND_SUPPORT 0
  192. #endif
  193. #ifndef GARLAND_D_PIN
  194. #define GARLAND_D_PIN 4 // WS2812 pin number (default: D2 / GPIO4)
  195. #endif
  196. #ifndef GARLAND_LEDS
  197. #define GARLAND_LEDS 60 // Number of LEDs
  198. #endif
  199. //------------------------------------------------------------------------------
  200. // THERMOSTAT
  201. //------------------------------------------------------------------------------
  202. #ifndef THERMOSTAT_SUPPORT
  203. #define THERMOSTAT_SUPPORT 0
  204. #endif
  205. #ifndef THERMOSTAT_DISPLAY_SUPPORT
  206. #define THERMOSTAT_DISPLAY_SUPPORT 0
  207. #endif
  208. #ifndef THERMOSTAT_DISPLAY_OFF_INTERVAL // Interval in seconds after which display will be switched off
  209. #define THERMOSTAT_DISPLAY_OFF_INTERVAL 0 // This will prevent it from burnout
  210. #endif // 0 - newer switch display off
  211. #define THERMOSTAT_SERVER_LOST_INTERVAL 120000 //server means lost after 2 min from last response
  212. #define THERMOSTAT_REMOTE_TEMP_MAX_WAIT 120 // 2 min
  213. #ifndef THERMOSTAT_REMOTE_SENSOR_NAME
  214. #define THERMOSTAT_REMOTE_SENSOR_NAME "" // Get remote temp(hum) from mqtt topic of this device
  215. #endif
  216. //------------------------------------------------------------------------------
  217. // HEARTBEAT REPORT
  218. //------------------------------------------------------------------------------
  219. #ifndef HEARTBEAT_REPORT_STATUS
  220. #define HEARTBEAT_REPORT_STATUS 1
  221. #endif
  222. #ifndef HEARTBEAT_REPORT_SSID
  223. #define HEARTBEAT_REPORT_SSID 1
  224. #endif
  225. #ifndef HEARTBEAT_REPORT_IP
  226. #define HEARTBEAT_REPORT_IP 1
  227. #endif
  228. #ifndef HEARTBEAT_REPORT_MAC
  229. #define HEARTBEAT_REPORT_MAC 1
  230. #endif
  231. #ifndef HEARTBEAT_REPORT_RSSI
  232. #define HEARTBEAT_REPORT_RSSI 1
  233. #endif
  234. #ifndef HEARTBEAT_REPORT_UPTIME
  235. #define HEARTBEAT_REPORT_UPTIME 1
  236. #endif
  237. #ifndef HEARTBEAT_REPORT_DATETIME
  238. #define HEARTBEAT_REPORT_DATETIME 1
  239. #endif
  240. #ifndef HEARTBEAT_REPORT_FREEHEAP
  241. #define HEARTBEAT_REPORT_FREEHEAP 1
  242. #endif
  243. #ifndef HEARTBEAT_REPORT_VCC
  244. #define HEARTBEAT_REPORT_VCC 1
  245. #endif
  246. #ifndef HEARTBEAT_REPORT_RELAY
  247. #define HEARTBEAT_REPORT_RELAY 1
  248. #endif
  249. #ifndef HEARTBEAT_REPORT_LIGHT
  250. #define HEARTBEAT_REPORT_LIGHT 1
  251. #endif
  252. #ifndef HEARTBEAT_REPORT_HOSTNAME
  253. #define HEARTBEAT_REPORT_HOSTNAME 1
  254. #endif
  255. #ifndef HEARTBEAT_REPORT_DESCRIPTION
  256. #define HEARTBEAT_REPORT_DESCRIPTION 1
  257. #endif
  258. #ifndef HEARTBEAT_REPORT_APP
  259. #define HEARTBEAT_REPORT_APP 1
  260. #endif
  261. #ifndef HEARTBEAT_REPORT_VERSION
  262. #define HEARTBEAT_REPORT_VERSION 1
  263. #endif
  264. #ifndef HEARTBEAT_REPORT_BOARD
  265. #define HEARTBEAT_REPORT_BOARD 1
  266. #endif
  267. #ifndef HEARTBEAT_REPORT_LOADAVG
  268. #define HEARTBEAT_REPORT_LOADAVG 1
  269. #endif
  270. #ifndef HEARTBEAT_REPORT_INTERVAL
  271. #define HEARTBEAT_REPORT_INTERVAL 0
  272. #endif
  273. #ifndef HEARTBEAT_REPORT_RANGE
  274. #define HEARTBEAT_REPORT_RANGE 1
  275. #endif
  276. #ifndef HEARTBEAT_REPORT_REMOTE_TEMP
  277. #define HEARTBEAT_REPORT_REMOTE_TEMP 1
  278. #endif
  279. #ifndef HEARTBEAT_REPORT_BSSID
  280. #define HEARTBEAT_REPORT_BSSID 0
  281. #endif
  282. //------------------------------------------------------------------------------
  283. // Load average
  284. //------------------------------------------------------------------------------
  285. #ifndef LOADAVG_INTERVAL
  286. #define LOADAVG_INTERVAL 30000 // Interval between calculating load average (in ms)
  287. #endif
  288. //------------------------------------------------------------------------------
  289. // RELAY
  290. //------------------------------------------------------------------------------
  291. // Enable general support for relays (aka switches)
  292. #ifndef RELAY_SUPPORT
  293. #define RELAY_SUPPORT 1
  294. #endif
  295. // ESP01-relays with STM co-MCU driving the relays
  296. #ifndef RELAY_PROVIDER_STM_SUPPORT
  297. #define RELAY_PROVIDER_STM_SUPPORT 0
  298. #endif
  299. // Sonoff Dual, using serial protocol
  300. #ifndef RELAY_PROVIDER_DUAL_SUPPORT
  301. #define RELAY_PROVIDER_DUAL_SUPPORT 0
  302. #endif
  303. // Default boot mode: 0 means OFF, 1 ON and 2 whatever was before
  304. #ifndef RELAY_BOOT_MODE
  305. #define RELAY_BOOT_MODE RELAY_BOOT_OFF
  306. #endif
  307. // One of RELAY_SYNC_ANY, RELAY_SYNC_NONE_OR_ONE, RELAY_SYNC_SAME or RELAY_SYNC_FIRST
  308. // Default to ANY i.e. don't do anything
  309. #ifndef RELAY_SYNC
  310. #define RELAY_SYNC RELAY_SYNC_ANY
  311. #endif
  312. // 0 (ms) means EVERY relay switches as soon as possible
  313. // otherwise, wait up until this much time before changing the status
  314. #ifndef RELAY_DELAY_INTERLOCK
  315. #define RELAY_DELAY_INTERLOCK 0
  316. #endif
  317. // Default pulse mode / normal mode. Switching from it will start the 'pulse' timer and reset the relay back after it finishes
  318. #ifndef RELAY_PULSE_MODE
  319. #define RELAY_PULSE_MODE RELAY_PULSE_NONE
  320. #endif
  321. // Default pulse time in seconds
  322. #ifndef RELAY_PULSE_TIME
  323. #define RELAY_PULSE_TIME 0.0
  324. #endif
  325. // Relay requests flood protection window - in seconds
  326. #ifndef RELAY_FLOOD_WINDOW
  327. #define RELAY_FLOOD_WINDOW 3.0
  328. #endif
  329. // Allowed actual relay changes inside requests flood protection window
  330. #ifndef RELAY_FLOOD_CHANGES
  331. #define RELAY_FLOOD_CHANGES 5
  332. #endif
  333. // Pulse with in milliseconds for a latched relay
  334. #ifndef RELAY_LATCHING_PULSE
  335. #define RELAY_LATCHING_PULSE 10
  336. #endif
  337. // Do not save relay state after these many milliseconds
  338. #ifndef RELAY_SAVE_DELAY
  339. #define RELAY_SAVE_DELAY 1000
  340. #endif
  341. // Configure the MQTT payload for ON, OFF and TOGGLE
  342. #ifndef RELAY_MQTT_OFF
  343. #define RELAY_MQTT_OFF "0"
  344. #endif
  345. #ifndef RELAY_MQTT_ON
  346. #define RELAY_MQTT_ON "1"
  347. #endif
  348. #ifndef RELAY_MQTT_TOGGLE
  349. #define RELAY_MQTT_TOGGLE "2"
  350. #endif
  351. #ifndef RELAY_MQTT_TOPIC_MODE
  352. #define RELAY_MQTT_TOPIC_MODE RELAY_MQTT_TOPIC_NORMAL
  353. #endif
  354. #ifndef RELAY_MQTT_DISCONNECT_STATUS
  355. #define RELAY_MQTT_DISCONNECT_STATUS RELAY_MQTT_DISCONNECT_NONE
  356. #endif
  357. //------------------------------------------------------------------------------
  358. // BUTTON
  359. //------------------------------------------------------------------------------
  360. #ifndef BUTTON_SUPPORT
  361. #define BUTTON_SUPPORT 1
  362. #endif
  363. #ifndef BUTTON_DEBOUNCE_DELAY
  364. #define BUTTON_DEBOUNCE_DELAY 50 // Debounce delay (ms)
  365. #endif
  366. #ifndef BUTTON_REPEAT_DELAY
  367. #define BUTTON_REPEAT_DELAY 500 // Time in ms to wait for a second (or third...) click
  368. #endif
  369. #ifndef BUTTON_LNGCLICK_DELAY
  370. #define BUTTON_LNGCLICK_DELAY 1000 // Time in ms holding the button down to get a long click
  371. #endif
  372. #ifndef BUTTON_LNGLNGCLICK_DELAY
  373. #define BUTTON_LNGLNGCLICK_DELAY 10000 // Time in ms holding the button down to get a long-long click
  374. #endif
  375. #ifndef BUTTON_MQTT_SEND_ALL_EVENTS
  376. #define BUTTON_MQTT_SEND_ALL_EVENTS 0 // 0 - to send only events the are bound to actions
  377. // 1 - to send all button events to MQTT
  378. #endif
  379. #ifndef BUTTON_MQTT_RETAIN
  380. #define BUTTON_MQTT_RETAIN 0
  381. #endif
  382. // Generic digital pin support
  383. #ifndef BUTTON_PROVIDER_GPIO_SUPPORT
  384. #define BUTTON_PROVIDER_GPIO_SUPPORT 1
  385. #endif
  386. // Resistor ladder support. Poll analog pin and return digital LOW when analog reading is in a certain range
  387. // ref. https://github.com/bxparks/AceButton/tree/develop/docs/resistor_ladder
  388. // Uses BUTTON#_ANALOG_LEVEL for the individual button level configuration
  389. #ifndef BUTTON_PROVIDER_ANALOG_SUPPORT
  390. #define BUTTON_PROVIDER_ANALOG_SUPPORT 0
  391. #endif
  392. //------------------------------------------------------------------------------
  393. // ENCODER
  394. //------------------------------------------------------------------------------
  395. #ifndef ENCODER_SUPPORT
  396. #define ENCODER_SUPPORT 0
  397. #endif
  398. #ifndef ENCODER_MINIMUM_DELTA
  399. #define ENCODER_MINIMUM_DELTA 1
  400. #endif
  401. //------------------------------------------------------------------------------
  402. // LED
  403. //------------------------------------------------------------------------------
  404. #ifndef LED_SUPPORT
  405. #define LED_SUPPORT 1
  406. #endif
  407. // -----------------------------------------------------------------------------
  408. // WIFI
  409. // -----------------------------------------------------------------------------
  410. #ifndef WIFI_CONNECT_RETRIES
  411. #define WIFI_CONNECT_RETRIES 3 // Number of times before changing to the next configured network
  412. #endif
  413. #ifndef WIFI_CONNECT_INTERVAL
  414. #define WIFI_CONNECT_INTERVAL 3000 // Time (ms) between connection attempts
  415. #endif
  416. #ifndef WIFI_RECONNECT_INTERVAL
  417. #define WIFI_RECONNECT_INTERVAL 120000 // When all retries on all networks are exhausted, wait for this time (ms) and start from the beginning
  418. #endif
  419. #ifndef WIFI_MAX_NETWORKS
  420. #define WIFI_MAX_NETWORKS 5 // Maximum number of WiFi configurations in settings
  421. #endif
  422. #ifndef WIFI_AP_CAPTIVE_SUPPORT
  423. #define WIFI_AP_CAPTIVE_SUPPORT 1 // Captive portal for AP mode
  424. #endif
  425. #ifndef WIFI_AP_CAPTIVE_ENABLED
  426. #define WIFI_AP_CAPTIVE_ENABLED 1 // Enabled by default
  427. #endif
  428. #ifndef WIFI_STA_MODE
  429. #define WIFI_STA_MODE wifi::StaMode::Enabled // By default, turn on STA interface and try to connect to configured networks
  430. // - wifi::StaMode::Enabled (default)
  431. // - wifi::StaMode::Disabled keeps STA disabled
  432. #endif
  433. #ifndef WIFI_AP_MODE
  434. #define WIFI_AP_MODE wifi::ApMode::Fallback // By default, enable AP if there is no STA connection
  435. // - wifi::ApMode::Fallback (default)
  436. // - wifi::ApMode::Enabled keeps AP enabled independent of STA
  437. // - wifi::ApMode::Disabled keeps AP disabled
  438. #endif
  439. #ifndef WIFI_FALLBACK_TIMEOUT
  440. #define WIFI_FALLBACK_TIMEOUT 60000 // When AP is in FALLBACK mode and STA is connected,
  441. // how long to wait until stopping the AP
  442. #endif
  443. #ifndef WIFI_AP_SSID
  444. #define WIFI_AP_SSID "" // (optional) Specify softAp SSID.
  445. // By default or when empty, hostname (or device identifier) is used instead.
  446. #endif
  447. #ifndef WIFI_AP_PASS
  448. #define WIFI_AP_PASS "" // (optional) Specify softAp passphrase
  449. // By default or when empty, admin password is used instead.
  450. #endif
  451. #ifndef WIFI_AP_LEASES_SUPPORT
  452. #define WIFI_AP_LEASES_SUPPORT 0 // (optional) Specify softAp MAC<->IP DHCP reservations
  453. // Use `set wifiApLease# MAC`, where MAC is a valid 12-byte HEX number without colons
  454. #endif
  455. #ifndef WIFI_AP_CHANNEL
  456. #define WIFI_AP_CHANNEL 1
  457. #endif
  458. #ifndef WIFI_SLEEP_MODE
  459. #define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP
  460. #endif
  461. #ifndef WIFI_SCAN_NETWORKS
  462. #define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting and when RSSI threshold is reached
  463. #endif
  464. #ifndef WIFI_SCAN_RSSI_THRESHOLD
  465. #define WIFI_SCAN_RSSI_THRESHOLD -73 // Consider current network for a reconnection cycle
  466. // when it's RSSI value is below the specified threshold
  467. #endif
  468. #ifndef WIFI_SCAN_RSSI_CHECKS
  469. #define WIFI_SCAN_RSSI_CHECKS 3 // Amount of RSSI threshold checks before starting a scan
  470. #endif
  471. #ifndef WIFI_SCAN_RSSI_CHECK_INTERVAL
  472. #define WIFI_SCAN_RSSI_CHECK_INTERVAL 60000 // Time (ms) between RSSI checks
  473. #endif
  474. // Optional hardcoded configuration
  475. // NOTICE that these values become factory-defaults
  476. #ifndef WIFI1_SSID
  477. #define WIFI1_SSID ""
  478. #endif
  479. #ifndef WIFI1_PASS
  480. #define WIFI1_PASS ""
  481. #endif
  482. #ifndef WIFI1_IP
  483. #define WIFI1_IP ""
  484. #endif
  485. #ifndef WIFI1_GW
  486. #define WIFI1_GW ""
  487. #endif
  488. #ifndef WIFI1_MASK
  489. #define WIFI1_MASK ""
  490. #endif
  491. #ifndef WIFI1_DNS
  492. #define WIFI1_DNS ""
  493. #endif
  494. #ifndef WIFI2_SSID
  495. #define WIFI2_SSID ""
  496. #endif
  497. #ifndef WIFI2_PASS
  498. #define WIFI2_PASS ""
  499. #endif
  500. #ifndef WIFI2_IP
  501. #define WIFI2_IP ""
  502. #endif
  503. #ifndef WIFI2_GW
  504. #define WIFI2_GW ""
  505. #endif
  506. #ifndef WIFI2_MASK
  507. #define WIFI2_MASK ""
  508. #endif
  509. #ifndef WIFI2_DNS
  510. #define WIFI2_DNS ""
  511. #endif
  512. #ifndef WIFI3_SSID
  513. #define WIFI3_SSID ""
  514. #endif
  515. #ifndef WIFI3_PASS
  516. #define WIFI3_PASS ""
  517. #endif
  518. #ifndef WIFI3_IP
  519. #define WIFI3_IP ""
  520. #endif
  521. #ifndef WIFI3_GW
  522. #define WIFI3_GW ""
  523. #endif
  524. #ifndef WIFI3_MASK
  525. #define WIFI3_MASK ""
  526. #endif
  527. #ifndef WIFI3_DNS
  528. #define WIFI3_DNS ""
  529. #endif
  530. #ifndef WIFI4_SSID
  531. #define WIFI4_SSID ""
  532. #endif
  533. #ifndef WIFI4_PASS
  534. #define WIFI4_PASS ""
  535. #endif
  536. #ifndef WIFI4_IP
  537. #define WIFI4_IP ""
  538. #endif
  539. #ifndef WIFI4_GW
  540. #define WIFI4_GW ""
  541. #endif
  542. #ifndef WIFI4_MASK
  543. #define WIFI4_MASK ""
  544. #endif
  545. #ifndef WIFI4_DNS
  546. #define WIFI4_DNS ""
  547. #endif
  548. #ifndef WIFI5_SSID
  549. #define WIFI5_SSID ""
  550. #endif
  551. #ifndef WIFI5_PASS
  552. #define WIFI5_PASS ""
  553. #endif
  554. #ifndef WIFI5_IP
  555. #define WIFI5_IP ""
  556. #endif
  557. #ifndef WIFI5_GW
  558. #define WIFI5_GW ""
  559. #endif
  560. #ifndef WIFI5_MASK
  561. #define WIFI5_MASK ""
  562. #endif
  563. #ifndef WIFI5_DNS
  564. #define WIFI5_DNS ""
  565. #endif
  566. // ref: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html#config-lwip-esp-gratuitous-arp
  567. // ref: https://github.com/xoseperez/espurna/pull/1877#issuecomment-525612546
  568. //
  569. // Broadcast gratuitous ARP periodically to update ARP tables on the AP and all devices on the same network.
  570. // Helps to solve compatibility issues when ESP fails to timely reply to ARP requests, causing the device's ARP table entry to expire.
  571. #ifndef WIFI_GRATUITOUS_ARP_SUPPORT
  572. #define WIFI_GRATUITOUS_ARP_SUPPORT 1
  573. #endif
  574. // Interval is randomized on each boot in range from ..._MIN to ..._MAX (ms)
  575. #ifndef WIFI_GRATUITOUS_ARP_INTERVAL_MIN
  576. #define WIFI_GRATUITOUS_ARP_INTERVAL_MIN 15000
  577. #endif
  578. #ifndef WIFI_GRATUITOUS_ARP_INTERVAL_MAX
  579. #define WIFI_GRATUITOUS_ARP_INTERVAL_MAX 30000
  580. #endif
  581. // ref: https://github.com/esp8266/Arduino/issues/6471
  582. // ref: https://github.com/esp8266/Arduino/issues/6366
  583. //
  584. // Issue #6366 turned out to be high tx power causing weird behavior. Lowering tx power achieved stability.
  585. #ifndef WIFI_OUTPUT_POWER_DBM
  586. #define WIFI_OUTPUT_POWER_DBM 20.0f
  587. #endif
  588. // -----------------------------------------------------------------------------
  589. // WEB
  590. // -----------------------------------------------------------------------------
  591. #ifndef WEB_SUPPORT
  592. #define WEB_SUPPORT 1 // Enable web support (http, api, 121.65Kb)
  593. #endif
  594. #ifndef WEB_EMBEDDED
  595. #define WEB_EMBEDDED 1 // Build the firmware with the web interface embedded in
  596. #endif
  597. #ifndef WEB_ACCESS_LOG
  598. #define WEB_ACCESS_LOG 0 // Log every request that was received by the server (but, not necessarily processed)
  599. #endif
  600. // Requires ESPAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and Arduino Core version >= 2.4.0
  601. // XXX: This is not working at the moment!! Pending https://github.com/me-no-dev/ESPAsyncTCP/issues/95
  602. #ifndef WEB_SSL_ENABLED
  603. #define WEB_SSL_ENABLED 0 // Use HTTPS web interface
  604. #endif
  605. #ifndef WEB_USERNAME
  606. #define WEB_USERNAME "admin" // HTTP username
  607. #endif
  608. #ifndef WEB_FORCE_PASS_CHANGE
  609. #define WEB_FORCE_PASS_CHANGE 1 // Force the user to change the password if default one
  610. #endif
  611. #ifndef WEB_PORT
  612. #define WEB_PORT 80 // HTTP port
  613. #endif
  614. // Defining a WEB_REMOTE_DOMAIN will enable Cross-Origin Resource Sharing (CORS)
  615. // so you will be able to login to this device from another domain. This will allow
  616. // you to manage all ESPurna devices in your local network from a unique installation
  617. // of the web UI. This installation could be in a local server (a Raspberry Pi, for instance)
  618. // or in the Internet. Since the WebUI is just one compressed file with HTML, CSS and JS
  619. // there are no special requirements. Any static web server will do (NGinx, Apache, Lighttpd,...).
  620. // The only requirement is that the resource must be available under this domain.
  621. #ifndef WEB_REMOTE_DOMAIN
  622. #define WEB_REMOTE_DOMAIN "http://espurna.io"
  623. #endif
  624. // -----------------------------------------------------------------------------
  625. // WEBSOCKETS
  626. // -----------------------------------------------------------------------------
  627. // This will only be enabled if WEB_SUPPORT is 1 (this is the default value)
  628. #ifndef WS_AUTHENTICATION
  629. #define WS_AUTHENTICATION 1 // WS authentication ON by default (see #507)
  630. #endif
  631. #ifndef WS_MAX_CLIENTS
  632. #define WS_MAX_CLIENTS 5 // Max number of websocket connections
  633. #endif
  634. #ifndef WS_TIMEOUT
  635. #define WS_TIMEOUT 1800000 // Timeout for secured websocket
  636. #endif
  637. #ifndef WS_UPDATE_INTERVAL
  638. #define WS_UPDATE_INTERVAL 30000 // Update clients every 30 seconds
  639. #endif
  640. // -----------------------------------------------------------------------------
  641. // API
  642. // -----------------------------------------------------------------------------
  643. #ifndef API_SUPPORT
  644. #define API_SUPPORT 1 // API (REST & RPC) support built in
  645. #endif
  646. // This will only be enabled if WEB_SUPPORT is 1 (this is the default value)
  647. #ifndef API_ENABLED
  648. #define API_ENABLED 0 // Do not enable API by default
  649. #endif
  650. #ifndef API_KEY
  651. #define API_KEY "" // Do not enable API by default. WebUI will automatically generate the key
  652. #endif
  653. #ifndef API_RESTFUL
  654. #define API_RESTFUL 1 // A restful API requires changes to be issued as PUT requests
  655. // Setting this to 0 will allow using GET to change relays, for instance
  656. #endif
  657. #ifndef API_JSON_BUFFER_SIZE
  658. #define API_JSON_BUFFER_SIZE 256 // Size of the (de)serializer buffer.
  659. #endif
  660. #ifndef API_BASE_PATH
  661. #define API_BASE_PATH "/api/"
  662. #endif
  663. #ifndef API_REAL_TIME_VALUES
  664. #define API_REAL_TIME_VALUES 0 // Show filtered/median values by default (0 => median, 1 => real time)
  665. #endif
  666. // -----------------------------------------------------------------------------
  667. // MDNS / LLMNR / NETBIOS / SSDP
  668. // -----------------------------------------------------------------------------
  669. #ifndef MDNS_SERVER_SUPPORT
  670. #define MDNS_SERVER_SUPPORT 1 // Publish services using mDNS by default (1.48Kb)
  671. #endif
  672. #ifndef LLMNR_SUPPORT
  673. #define LLMNR_SUPPORT 0 // Publish device using LLMNR protocol by default (1.95Kb) - requires Core version >= 2.4.0
  674. #endif
  675. #ifndef NETBIOS_SUPPORT
  676. #define NETBIOS_SUPPORT 0 // Publish device using NetBIOS protocol by default (1.26Kb) - requires Core version >= 2.4.0
  677. #endif
  678. #ifndef SSDP_SUPPORT
  679. #define SSDP_SUPPORT 0 // Publish device using SSDP protocol by default (4.59Kb)
  680. // Not compatible with ALEXA_SUPPORT at the moment
  681. #endif
  682. #ifndef SSDP_DEVICE_TYPE
  683. #define SSDP_DEVICE_TYPE "upnp:rootdevice"
  684. //#define SSDP_DEVICE_TYPE "urn:schemas-upnp-org:device:BinaryLight:1"
  685. #endif
  686. // -----------------------------------------------------------------------------
  687. // SPIFFS
  688. // -----------------------------------------------------------------------------
  689. #ifndef SPIFFS_SUPPORT
  690. #define SPIFFS_SUPPORT 0 // Do not add support for SPIFFS by default
  691. #endif
  692. // -----------------------------------------------------------------------------
  693. // SSL Client ** EXPERIMENTAL **
  694. // -----------------------------------------------------------------------------
  695. #ifndef SECURE_CLIENT
  696. #define SECURE_CLIENT SECURE_CLIENT_NONE // What variant of WiFiClient to use
  697. // SECURE_CLIENT_NONE - No secure client support (default)
  698. // SECURE_CLIENT_AXTLS - axTLS client secure support (All Core versions, ONLY TLS 1.1)
  699. // SECURE_CLIENT_BEARSSL - BearSSL client secure support (starting with 2.5.0, TLS 1.2)
  700. //
  701. // axTLS marked for derecation since Arduino Core 2.4.2 and **will** be removed in the future
  702. #endif
  703. // Security check that is performed when the connection is established:
  704. // SECURE_CLIENT_CHECK_CA - Use Trust Anchor / Root Certificate
  705. // Supported only by the SECURE_CLIENT_BEARSSL
  706. // (See respective ..._SECURE_CLIENT_INCLUDE_CA options per-module)
  707. // SECURE_CLIENT_CHECK_FINGERPRINT - Check certificate fingerprint
  708. // SECURE_CLIENT_CHECK_NONE - Allow insecure connections
  709. #ifndef SECURE_CLIENT_CHECK
  710. #if SECURE_CLIENT == SECURE_CLIENT_BEARSSL
  711. #define SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK_CA
  712. #else
  713. #define SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK_FINGERPRINT
  714. #endif
  715. #endif // SECURE_CLIENT_CHECK
  716. // Support Maximum Fragment Length Negotiation TLS extension
  717. // "...negotiate a smaller maximum fragment length due to memory limitations or bandwidth limitations."
  718. // - https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/bearssl-client-secure-class.html#mfln-or-maximum-fragment-length-negotiation-saving-ram
  719. // - https://tools.ietf.org/html/rfc6066#section-4
  720. #ifndef SECURE_CLIENT_MFLN
  721. #define SECURE_CLIENT_MFLN 0 // The only possible values are: 512, 1024, 2048 and 4096
  722. // Set to 0 to disable (default)
  723. #endif
  724. // -----------------------------------------------------------------------------
  725. // OTA
  726. // -----------------------------------------------------------------------------
  727. #ifndef OTA_PORT
  728. #define OTA_PORT 8266 // Port for ArduinoOTA
  729. #endif
  730. #ifndef OTA_MQTT_SUPPORT
  731. #define OTA_MQTT_SUPPORT 0 // Listen for HTTP(s) URLs at '<root topic>/ota'. Depends on OTA_CLIENT
  732. #endif
  733. #ifndef OTA_ARDUINOOTA_SUPPORT
  734. #define OTA_ARDUINOOTA_SUPPORT 1 // Support ArduinoOTA by default (4.2Kb)
  735. // Implicitly depends on ESP8266mDNS library, thus increasing firmware size
  736. #endif
  737. #ifndef OTA_CLIENT
  738. #define OTA_CLIENT OTA_CLIENT_ASYNCTCP // Terminal / MQTT OTA support
  739. // OTA_CLIENT_ASYNCTCP (ESPAsyncTCP library)
  740. // OTA_CLIENT_HTTPUPDATE (Arduino Core library)j
  741. // OTA_CLIENT_NONE to disable
  742. #endif
  743. #ifndef OTA_WEB_SUPPORT
  744. #define OTA_WEB_SUPPORT 1 // Support `/upgrade` endpoint and WebUI OTA handler
  745. #endif
  746. #define OTA_GITHUB_FP "CA:06:F5:6B:25:8B:7A:0D:4F:2B:05:47:09:39:47:86:51:15:19:84"
  747. #ifndef OTA_FINGERPRINT
  748. #define OTA_FINGERPRINT OTA_GITHUB_FP
  749. #endif
  750. #ifndef OTA_SECURE_CLIENT_CHECK
  751. #define OTA_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK
  752. #endif
  753. #ifndef OTA_SECURE_CLIENT_MFLN
  754. #define OTA_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN
  755. #endif
  756. #ifndef OTA_SECURE_CLIENT_INCLUDE_CA
  757. #define OTA_SECURE_CLIENT_INCLUDE_CA 0 // Use user-provided CA. Only PROGMEM PEM option is supported.
  758. // TODO: eventually should be replaced with pre-parsed structs, read directly from flash
  759. // (ref: https://github.com/earlephilhower/bearssl-esp8266/pull/14)
  760. //
  761. // When enabled, current implementation includes "static/ota_client_trusted_root_ca.h" with
  762. // const char _ota_client_trusted_root_ca[] PROGMEM = "...PEM data...";
  763. // By default, using DigiCert root in "static/digicert_evroot_pem.h" (for https://github.com)
  764. #endif
  765. // -----------------------------------------------------------------------------
  766. // NOFUSS
  767. // -----------------------------------------------------------------------------
  768. #ifndef NOFUSS_SUPPORT
  769. #define NOFUSS_SUPPORT 0 // Do not enable support for NoFuss by default (12.65Kb)
  770. #endif
  771. #ifndef NOFUSS_ENABLED
  772. #define NOFUSS_ENABLED 0 // Do not perform NoFUSS updates by default
  773. #endif
  774. #ifndef NOFUSS_SERVER
  775. #define NOFUSS_SERVER "" // Default NoFuss Server
  776. #endif
  777. #ifndef NOFUSS_INTERVAL
  778. #define NOFUSS_INTERVAL 3600000 // Check for updates every hour
  779. #endif
  780. // -----------------------------------------------------------------------------
  781. // UART <-> MQTT
  782. // -----------------------------------------------------------------------------
  783. #ifndef UART_MQTT_SUPPORT
  784. #define UART_MQTT_SUPPORT 0 // No support by default
  785. #endif
  786. #ifndef UART_MQTT_USE_SOFT
  787. #define UART_MQTT_USE_SOFT 0 // Use SoftwareSerial
  788. #endif
  789. #ifndef UART_MQTT_HW_PORT
  790. #define UART_MQTT_HW_PORT Serial // Hardware serial port (if UART_MQTT_USE_SOFT == 0)
  791. #endif
  792. #ifndef UART_MQTT_RX_PIN
  793. #define UART_MQTT_RX_PIN 4 // RX PIN (if UART_MQTT_USE_SOFT == 1)
  794. #endif
  795. #ifndef UART_MQTT_TX_PIN
  796. #define UART_MQTT_TX_PIN 5 // TX PIN (if UART_MQTT_USE_SOFT == 1)
  797. #endif
  798. #ifndef UART_MQTT_BAUDRATE
  799. #define UART_MQTT_BAUDRATE 115200 // Serial speed
  800. #endif
  801. #ifndef UART_MQTT_TERMINATION
  802. #define UART_MQTT_TERMINATION '\n' // Termination character
  803. #endif
  804. #define UART_MQTT_BUFFER_SIZE 100 // UART buffer size
  805. // -----------------------------------------------------------------------------
  806. // MQTT
  807. // -----------------------------------------------------------------------------
  808. #ifndef MQTT_SUPPORT
  809. #define MQTT_SUPPORT 1 // MQTT support (22.38Kb async, 12.48Kb sync)
  810. #endif
  811. #ifndef MQTT_LIBRARY
  812. #define MQTT_LIBRARY MQTT_LIBRARY_ASYNCMQTTCLIENT // MQTT_LIBRARY_ASYNCMQTTCLIENT (default, https://github.com/marvinroger/async-mqtt-client)
  813. // MQTT_LIBRARY_PUBSUBCLIENT (https://github.com/knolleary/pubsubclient)
  814. // MQTT_LIBRARY_ARDUINOMQTT (https://github.com/256dpi/arduino-mqtt)
  815. #endif
  816. // -----------------------------------------------------------------------------
  817. // MQTT OVER SSL
  818. // -----------------------------------------------------------------------------
  819. //
  820. // Requires SECURE_CLIENT set to SECURE_CLIENT_AXTLS or SECURE_CLIENT_BEARSSL
  821. // It is recommended to use MQTT_LIBRARY_ARDUINOMQTT or MQTT_LIBRARY_PUBSUBCLIENT
  822. // It is recommended to use SECURE_CLIENT_BEARSSL
  823. // It is recommended to use ESP8266 Arduino Core >= 2.5.2 with SECURE_CLIENT_BEARSSL
  824. //
  825. // Current version of MQTT_LIBRARY_ASYNCMQTTCLIENT only supports SECURE_CLIENT_AXTLS
  826. //
  827. // It is recommended to use WEB_SUPPORT=0 with either SECURE_CLIENT option, as there are miscellaneous problems when using them simultaneously
  828. // (although, things might've improved, and I'd encourage to check whether this is true or not)
  829. //
  830. // When using MQTT_LIBRARY_PUBSUBCLIENT or MQTT_LIBRARY_ARDUINOMQTT, you will have to disable every module that uses ESPAsyncTCP:
  831. // ALEXA_SUPPORT=0, INFLUXDB_SUPPORT=0, TELNET_SUPPORT=0, THINGSPEAK_SUPPORT=0, DEBUG_TELNET_SUPPORT=0 and WEB_SUPPORT=0
  832. // Or, use "sync" versions instead (note that not every module has this option):
  833. // THINGSPEAK_USE_ASYNC=0, TELNET_SERVER=TELNET_SERVER_WIFISERVER
  834. //
  835. // See SECURE_CLIENT_CHECK for all possible connection verification options.
  836. //
  837. // The simpliest way to verify SSL connection is to use fingerprinting.
  838. // For example, to get Google's MQTT server certificate fingerprint, run the following command:
  839. // $ echo -n | openssl s_client -connect mqtt.googleapis.com:8883 2>&1 | openssl x509 -noout -fingerprint -sha1 | cut -d\= -f2
  840. // Note that fingerprint will change when certificate changes e.g. LetsEncrypt renewals or when the CSR updates
  841. #ifndef MQTT_SSL_ENABLED
  842. #define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled
  843. #endif
  844. #ifndef MQTT_SSL_FINGERPRINT
  845. #define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server
  846. #endif
  847. #ifndef MQTT_SECURE_CLIENT_CHECK
  848. #define MQTT_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK // Use global verification setting by default
  849. #endif
  850. #ifndef MQTT_SECURE_CLIENT_MFLN
  851. #define MQTT_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN // Use global MFLN setting by default
  852. #endif
  853. #ifndef MQTT_SECURE_CLIENT_INCLUDE_CA
  854. #define MQTT_SECURE_CLIENT_INCLUDE_CA 0 // Use user-provided CA. Only PROGMEM PEM option is supported.
  855. // When enabled, current implementation includes "static/mqtt_client_trusted_root_ca.h" with
  856. // const char _mqtt_client_trusted_root_ca[] PROGMEM = "...PEM data...";
  857. // By default, using LetsEncrypt X3 root in "static/letsencrypt_isrgroot_pem.h"
  858. #endif
  859. #ifndef MQTT_ENABLED
  860. #define MQTT_ENABLED 0 // Do not enable MQTT connection by default
  861. #endif
  862. #ifndef MQTT_AUTOCONNECT
  863. #define MQTT_AUTOCONNECT 1 // If enabled and MDNS_SERVER_SUPPORT=1 will perform an autodiscover and
  864. // autoconnect to the first MQTT broker found if none defined
  865. #endif
  866. #ifndef MQTT_SERVER
  867. #define MQTT_SERVER "" // Default MQTT broker address
  868. #endif
  869. #ifndef MQTT_USER
  870. #define MQTT_USER "" // Default MQTT broker usename
  871. #endif
  872. #ifndef MQTT_PASS
  873. #define MQTT_PASS "" // Default MQTT broker password
  874. #endif
  875. #ifndef MQTT_PORT
  876. #define MQTT_PORT 1883 // MQTT broker port
  877. #endif
  878. #ifndef MQTT_TOPIC
  879. #define MQTT_TOPIC "{hostname}" // Default MQTT base topic
  880. #endif
  881. #ifndef MQTT_RETAIN
  882. #define MQTT_RETAIN true // MQTT retain flag
  883. #endif
  884. #ifndef MQTT_QOS
  885. #define MQTT_QOS 0 // MQTT QoS value for all messages
  886. #endif
  887. #ifndef MQTT_KEEPALIVE
  888. #define MQTT_KEEPALIVE 120 // MQTT keepalive value
  889. #endif
  890. #ifndef MQTT_RECONNECT_DELAY_MIN
  891. #define MQTT_RECONNECT_DELAY_MIN 5000 // Try to reconnect in 5 seconds upon disconnection
  892. #endif
  893. #ifndef MQTT_RECONNECT_DELAY_STEP
  894. #define MQTT_RECONNECT_DELAY_STEP 5000 // Increase the reconnect delay in 5 seconds after each failed attempt
  895. #endif
  896. #ifndef MQTT_RECONNECT_DELAY_MAX
  897. #define MQTT_RECONNECT_DELAY_MAX 120000 // Set reconnect time to 2 minutes at most
  898. #endif
  899. #ifndef MQTT_SKIP_TIME
  900. #define MQTT_SKIP_TIME 0 // Skip messages for N ms after connection. Disabled by default
  901. #endif
  902. #ifndef MQTT_USE_JSON
  903. #define MQTT_USE_JSON 0 // Don't group messages in a JSON body by default
  904. #endif
  905. #ifndef MQTT_USE_JSON_DELAY
  906. #define MQTT_USE_JSON_DELAY 100 // Wait this many ms before grouping messages
  907. #endif
  908. #ifndef MQTT_QUEUE_MAX_SIZE
  909. #define MQTT_QUEUE_MAX_SIZE 20 // Size of the MQTT queue when MQTT_USE_JSON is enabled
  910. #endif
  911. #ifndef MQTT_BUFFER_MAX_SIZE
  912. #define MQTT_BUFFER_MAX_SIZE 1024 // Size of the MQTT payload buffer for MQTT_MESSAGE_EVENT. Large messages will only be available via MQTT_MESSAGE_RAW_EVENT.
  913. // Note: When using MQTT_LIBRARY_PUBSUBCLIENT, MQTT_MAX_PACKET_SIZE should not be more than this value.
  914. #endif
  915. // These are the properties that will be sent when useJson is true
  916. #ifndef MQTT_ENQUEUE_IP
  917. #define MQTT_ENQUEUE_IP 1
  918. #endif
  919. #ifndef MQTT_ENQUEUE_MAC
  920. #define MQTT_ENQUEUE_MAC 1
  921. #endif
  922. #ifndef MQTT_ENQUEUE_HOSTNAME
  923. #define MQTT_ENQUEUE_HOSTNAME 1
  924. #endif
  925. #ifndef MQTT_ENQUEUE_DATETIME
  926. #define MQTT_ENQUEUE_DATETIME 1
  927. #endif
  928. #ifndef MQTT_ENQUEUE_MESSAGE_ID
  929. #define MQTT_ENQUEUE_MESSAGE_ID 1
  930. #endif
  931. #ifndef MQTT_STATUS_ONLINE
  932. #define MQTT_STATUS_ONLINE "1" // Value for the device ON message
  933. #endif
  934. #ifndef MQTT_STATUS_OFFLINE
  935. #define MQTT_STATUS_OFFLINE "0" // Value for the device OFF message (will)
  936. #endif
  937. #define MQTT_ACTION_RESET "reboot" // RESET MQTT topic particle
  938. // Custom get and set postfixes
  939. // Use something like "/status" or "/set", with leading slash
  940. // Since 1.9.0 the default value is "" for getter and "/set" for setter
  941. #ifndef MQTT_GETTER
  942. #define MQTT_GETTER ""
  943. #endif
  944. #ifndef MQTT_SETTER
  945. #define MQTT_SETTER "/set"
  946. #endif
  947. // -----------------------------------------------------------------------------
  948. // SETTINGS
  949. // -----------------------------------------------------------------------------
  950. #ifndef SETTINGS_AUTOSAVE
  951. #define SETTINGS_AUTOSAVE 1 // Autosave settings or force manual commit
  952. #endif
  953. #define SETTINGS_MAX_LIST_COUNT 16 // Maximum index for settings lists
  954. // -----------------------------------------------------------------------------
  955. // LIGHT
  956. // -----------------------------------------------------------------------------
  957. // LIGHT_PROVIDER_DIMMER can have from 1 to 5 different channels.
  958. // They have to be defined for each device in the hardware.h file.
  959. // If 3 or more channels first 3 will be considered RGB.
  960. // Usual configurations are:
  961. // 1 channels => W
  962. // 2 channels => WW
  963. // 3 channels => RGB
  964. // 4 channels => RGBW
  965. // 5 channels => RGBWW
  966. #ifndef LIGHT_PROVIDER
  967. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  968. #endif
  969. #ifndef LIGHT_REPORT_DELAY
  970. #define LIGHT_REPORT_DELAY 100 // Delay reporting current state for the specified number of ms after light update
  971. #endif
  972. #ifndef LIGHT_SAVE_ENABLED
  973. #define LIGHT_SAVE_ENABLED 1 // Light channel values saved by default after each change
  974. #endif
  975. #ifndef LIGHT_SAVE_DELAY
  976. #define LIGHT_SAVE_DELAY 5000 // Persist channel & brightness values after the specified number of ms
  977. #endif
  978. #ifndef LIGHT_MIN_PWM
  979. #define LIGHT_MIN_PWM 0
  980. #endif
  981. #ifndef LIGHT_MAX_PWM
  982. #if LIGHT_PROVIDER == LIGHT_PROVIDER_MY92XX
  983. #define LIGHT_MAX_PWM 255
  984. #elif LIGHT_PROVIDER == LIGHT_PROVIDER_DIMMER
  985. #define LIGHT_MAX_PWM 10000 // 10000 * 200ns => 2 kHz
  986. #else
  987. #define LIGHT_MAX_PWM 0
  988. #endif
  989. #endif // LIGHT_MAX_PWM
  990. #ifndef LIGHT_LIMIT_PWM
  991. #define LIGHT_LIMIT_PWM LIGHT_MAX_PWM // Limit PWM to this value (prevent 100% power)
  992. #endif
  993. #ifndef LIGHT_MIN_VALUE
  994. #define LIGHT_MIN_VALUE 0 // Minimum light value
  995. #endif
  996. #ifndef LIGHT_MAX_VALUE
  997. #define LIGHT_MAX_VALUE 255 // Maximum light value
  998. #endif
  999. #ifndef LIGHT_MIN_BRIGHTNESS
  1000. #define LIGHT_MIN_BRIGHTNESS 0 // Minimum brightness value
  1001. #endif
  1002. #ifndef LIGHT_MAX_BRIGHTNESS
  1003. #define LIGHT_MAX_BRIGHTNESS 255 // Maximum brightness value
  1004. #endif
  1005. // Default mireds & kelvin to the Philips Hue limits
  1006. // https://developers.meethue.com/documentation/core-concepts
  1007. //
  1008. // Home Assistant also uses these, see Light::min_mireds, Light::max_mireds
  1009. // https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/__init__.py
  1010. // Used when LIGHT_USE_WHITE AND LIGHT_USE_CCT is 1 - (1000000/Kelvin = MiReds)
  1011. // Warning! Don't change this yet, NOT FULLY IMPLEMENTED!
  1012. #ifndef LIGHT_COLDWHITE_MIRED
  1013. #define LIGHT_COLDWHITE_MIRED 153 // Coldwhite Strip, Value must be __BELOW__ W2!! (Default: 6535 Kelvin/153 MiRed)
  1014. #endif
  1015. #ifndef LIGHT_WARMWHITE_MIRED
  1016. #define LIGHT_WARMWHITE_MIRED 500 // Warmwhite Strip, Value must be __ABOVE__ W1!! (Default: 2000 Kelvin/500 MiRed)
  1017. #endif
  1018. #ifndef LIGHT_STEP
  1019. #define LIGHT_STEP 32 // Step size
  1020. #endif
  1021. #ifndef LIGHT_USE_COLOR
  1022. #define LIGHT_USE_COLOR 1 // Use 3 first channels as RGB
  1023. #endif
  1024. #ifndef LIGHT_USE_WHITE
  1025. #define LIGHT_USE_WHITE 0 // Use the 4th channel as (Warm-)White LEDs
  1026. #endif
  1027. #ifndef LIGHT_USE_CCT
  1028. #define LIGHT_USE_CCT 0 // Use the 5th channel as Coldwhite LEDs, LIGHT_USE_WHITE must be 1.
  1029. #endif
  1030. #ifndef LIGHT_USE_GAMMA
  1031. #define LIGHT_USE_GAMMA 0 // Use gamma correction for color channels
  1032. #endif
  1033. #ifndef LIGHT_USE_RGB
  1034. #define LIGHT_USE_RGB 0 // Use RGB color selector (1=> RGB, 0=> HSV)
  1035. #endif
  1036. #ifndef LIGHT_WHITE_FACTOR
  1037. #define LIGHT_WHITE_FACTOR 1 // When using LIGHT_USE_WHITE with uneven brightness LEDs,
  1038. // this factor is used to scale the white channel to match brightness
  1039. #endif
  1040. #ifndef LIGHT_USE_TRANSITIONS
  1041. #define LIGHT_USE_TRANSITIONS 1 // Transitions between colors
  1042. #endif
  1043. #ifndef LIGHT_TRANSITION_STEP
  1044. #define LIGHT_TRANSITION_STEP 10 // Time in millis between each transtion step
  1045. #endif
  1046. #ifndef LIGHT_TRANSITION_TIME
  1047. #define LIGHT_TRANSITION_TIME 500 // Time in millis from color to color
  1048. #endif
  1049. #ifndef LIGHT_RELAY_ENABLED
  1050. #define LIGHT_RELAY_ENABLED 1 // Add a virtual switch that controls the global light state. Depends on RELAY_SUPPORT
  1051. #endif
  1052. // -----------------------------------------------------------------------------
  1053. // DOMOTICZ
  1054. // -----------------------------------------------------------------------------
  1055. #ifndef DOMOTICZ_SUPPORT
  1056. #define DOMOTICZ_SUPPORT MQTT_SUPPORT // Build with domoticz (if MQTT) support (1.72Kb)
  1057. #endif
  1058. #ifndef DOMOTICZ_ENABLED
  1059. #define DOMOTICZ_ENABLED 0 // Disable domoticz by default
  1060. #endif
  1061. #ifndef DOMOTICZ_IN_TOPIC
  1062. #define DOMOTICZ_IN_TOPIC "domoticz/in" // Default subscription topic
  1063. #endif
  1064. #ifndef DOMOTICZ_OUT_TOPIC
  1065. #define DOMOTICZ_OUT_TOPIC "domoticz/out" // Default publication topic
  1066. #endif
  1067. // -----------------------------------------------------------------------------
  1068. // HOME ASSISTANT
  1069. // -----------------------------------------------------------------------------
  1070. #ifndef HOMEASSISTANT_SUPPORT
  1071. #define HOMEASSISTANT_SUPPORT MQTT_SUPPORT // Build with home assistant support (if MQTT, 1.64Kb)
  1072. #endif
  1073. #ifndef HOMEASSISTANT_ENABLED
  1074. #define HOMEASSISTANT_ENABLED 0 // Integration not enabled by default
  1075. #endif
  1076. #ifndef HOMEASSISTANT_PREFIX
  1077. #define HOMEASSISTANT_PREFIX "homeassistant" // Default MQTT prefix
  1078. #endif
  1079. #ifndef HOMEASSISTANT_RETAIN
  1080. #define HOMEASSISTANT_RETAIN MQTT_RETAIN // Make broker retain the messages
  1081. #endif
  1082. // -----------------------------------------------------------------------------
  1083. // INFLUXDB
  1084. // -----------------------------------------------------------------------------
  1085. #ifndef INFLUXDB_SUPPORT
  1086. #define INFLUXDB_SUPPORT 0 // Disable InfluxDB support by default (4.38Kb)
  1087. #endif
  1088. #ifndef INFLUXDB_ENABLED
  1089. #define INFLUXDB_ENABLED 0 // InfluxDB disabled by default
  1090. #endif
  1091. #ifndef INFLUXDB_HOST
  1092. #define INFLUXDB_HOST "" // Default server
  1093. #endif
  1094. #ifndef INFLUXDB_PORT
  1095. #define INFLUXDB_PORT 8086 // Default InfluxDB port
  1096. #endif
  1097. #ifndef INFLUXDB_DATABASE
  1098. #define INFLUXDB_DATABASE "" // Default database
  1099. #endif
  1100. #ifndef INFLUXDB_USERNAME
  1101. #define INFLUXDB_USERNAME "" // Default username
  1102. #endif
  1103. #ifndef INFLUXDB_PASSWORD
  1104. #define INFLUXDB_PASSWORD "" // Default password
  1105. #endif
  1106. // -----------------------------------------------------------------------------
  1107. // THINGSPEAK
  1108. // -----------------------------------------------------------------------------
  1109. #ifndef THINGSPEAK_SUPPORT
  1110. #define THINGSPEAK_SUPPORT 1 // Enable Thingspeak support by default (2.56Kb)
  1111. #endif
  1112. #ifndef THINGSPEAK_ENABLED
  1113. #define THINGSPEAK_ENABLED 0 // Thingspeak disabled by default
  1114. #endif
  1115. #ifndef THINGSPEAK_APIKEY
  1116. #define THINGSPEAK_APIKEY "" // Default API KEY
  1117. #endif
  1118. #ifndef THINGSPEAK_CLEAR_CACHE
  1119. #define THINGSPEAK_CLEAR_CACHE 1 // Clear cache after sending values
  1120. // Not clearing it will result in latest values for each field being sent every time
  1121. #endif
  1122. #ifndef THINGSPEAK_USE_ASYNC
  1123. #define THINGSPEAK_USE_ASYNC 1 // Use AsyncClient instead of WiFiClientSecure
  1124. #endif
  1125. // THINGSPEAK OVER SSL
  1126. // Using THINGSPEAK over SSL works well but generates problems with the web interface,
  1127. // so you should compile it with WEB_SUPPORT to 0.
  1128. // When THINGSPEAK_USE_ASYNC is 1, requires EspAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and ESP8266 Arduino Core >= 2.4.0.
  1129. // When THINGSPEAK_USE_ASYNC is 0, requires Arduino Core >= 2.6.0 and SECURE_CLIENT_BEARSSL
  1130. //
  1131. // WARNING: Thingspeak servers do not support MFLN right now, connection requires at least 30KB of free RAM.
  1132. // Also see MQTT comments above.
  1133. #ifndef THINGSPEAK_USE_SSL
  1134. #define THINGSPEAK_USE_SSL 0 // Use secure connection
  1135. #endif
  1136. #ifndef THINGSPEAK_SECURE_CLIENT_CHECK
  1137. #define THINGSPEAK_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK
  1138. #endif
  1139. #ifndef THINGSPEAK_SECURE_CLIENT_MFLN
  1140. #define THINGSPEAK_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN
  1141. #endif
  1142. #ifndef THINGSPEAK_FINGERPRINT
  1143. #define THINGSPEAK_FINGERPRINT "78 60 18 44 81 35 BF DF 77 84 D4 0A 22 0D 9B 4E 6C DC 57 2C"
  1144. #endif
  1145. #ifndef THINGSPEAK_ADDRESS
  1146. #if THINGSPEAK_USE_SSL
  1147. #define THINGSPEAK_ADDRESS "https://api.thingspeak.com/update"
  1148. #else
  1149. #define THINGSPEAK_ADDRESS "http://api.thingspeak.com/update"
  1150. #endif
  1151. #endif // ifndef THINGSPEAK_ADDRESS
  1152. #ifndef THINGSPEAK_TRIES
  1153. #define THINGSPEAK_TRIES 3 // Number of tries when sending data (minimum 1)
  1154. #endif
  1155. #define THINGSPEAK_MIN_INTERVAL 15000 // Minimum interval between POSTs (in millis)
  1156. #define THINGSPEAK_FIELDS 8 // Number of fields
  1157. // -----------------------------------------------------------------------------
  1158. // SCHEDULER
  1159. // -----------------------------------------------------------------------------
  1160. #ifndef SCHEDULER_SUPPORT
  1161. #define SCHEDULER_SUPPORT 1 // Enable scheduler (2.45Kb)
  1162. #endif
  1163. #ifndef SCHEDULER_MAX_SCHEDULES
  1164. #define SCHEDULER_MAX_SCHEDULES 10 // Max schedules alowed
  1165. #endif
  1166. #ifndef SCHEDULER_RESTORE_LAST_SCHEDULE
  1167. #define SCHEDULER_RESTORE_LAST_SCHEDULE 0 // Restore the last schedule state on the device boot
  1168. #endif
  1169. #ifndef SCHEDULER_WEEKDAYS
  1170. #define SCHEDULER_WEEKDAYS "1,2,3,4,5,6,7" // (Default - Run the schedules every day)
  1171. #endif
  1172. // -----------------------------------------------------------------------------
  1173. // RPN RULES
  1174. // -----------------------------------------------------------------------------
  1175. #ifndef RPN_RULES_SUPPORT
  1176. #define RPN_RULES_SUPPORT 0 // Enable RPN Rules (8.6Kb)
  1177. #endif
  1178. #ifndef RPN_DELAY
  1179. #define RPN_DELAY 100 // Execute rules after 100ms without messages
  1180. #endif
  1181. #ifndef RPN_STICKY
  1182. #define RPN_STICKY 1 // Keeps variable after rule execution
  1183. #endif
  1184. // -----------------------------------------------------------------------------
  1185. // NTP
  1186. // -----------------------------------------------------------------------------
  1187. #ifndef NTP_SUPPORT
  1188. #define NTP_SUPPORT 1 // Build with NTP support by default (depends on Core version)
  1189. #endif
  1190. #ifndef NTP_SERVER
  1191. #define NTP_SERVER "pool.ntp.org" // Default NTP server
  1192. #endif
  1193. #ifndef NTP_TIMEZONE
  1194. #define NTP_TIMEZONE TZ_Etc_UTC // POSIX TZ variable. Default to UTC from TZ.h (which is PSTR("UTC0"))
  1195. // For the format documentation, see:
  1196. // - https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
  1197. // ESP8266 Core provides human-readable aliases for POSIX format, see:
  1198. // - Latest: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/TZ.h
  1199. // - PlatformIO: ~/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/TZ.h
  1200. // (or, possibly, c:\.platformio\... on Windows)
  1201. // - Arduino IDE: depends on platform, see `/dist/arduino_ide/README.md`
  1202. #endif
  1203. #ifndef NTP_UPDATE_INTERVAL
  1204. #define NTP_UPDATE_INTERVAL 1800 // NTP check every 30 minutes
  1205. #endif
  1206. #ifndef NTP_START_DELAY
  1207. #define NTP_START_DELAY 3 // Delay NTP start for 3 seconds
  1208. #endif
  1209. #ifndef NTP_WAIT_FOR_SYNC
  1210. #define NTP_WAIT_FOR_SYNC 1 // Do not report any datetime until NTP sync'ed
  1211. #endif
  1212. #ifndef NTP_DHCP_SERVER
  1213. #define NTP_DHCP_SERVER 1 // Automatically replace the NTP server value with the one received with the DHCP packet
  1214. #endif
  1215. // -----------------------------------------------------------------------------
  1216. // ALEXA
  1217. // -----------------------------------------------------------------------------
  1218. // This setting defines whether Alexa support should be built into the firmware
  1219. #ifndef ALEXA_SUPPORT
  1220. #define ALEXA_SUPPORT 1 // Enable Alexa support by default (10.84Kb)
  1221. #endif
  1222. // This is default value for the alexaEnabled setting that defines whether
  1223. // this device should be discoberable and respond to Alexa commands.
  1224. // Both ALEXA_SUPPORT and alexaEnabled should be 1 for Alexa support to work.
  1225. #ifndef ALEXA_ENABLED
  1226. #define ALEXA_ENABLED 1
  1227. #endif
  1228. #ifndef ALEXA_HOSTNAME
  1229. #define ALEXA_HOSTNAME ""
  1230. #endif
  1231. // -----------------------------------------------------------------------------
  1232. // RF BRIDGE
  1233. // -----------------------------------------------------------------------------
  1234. #ifndef RFB_SUPPORT
  1235. #define RFB_SUPPORT 0
  1236. #endif
  1237. #ifndef RFB_SEND_REPEATS
  1238. #define RFB_SEND_REPEATS 1 // How many times to send the message
  1239. #endif
  1240. // - RFB_PROVIDER_EFM8BB1
  1241. // Default option for the ITEAD_SONOFF_RFBRIDGE or any custom firmware implementing the protocol
  1242. // - RFB_PROVIDER_RCSWITCH
  1243. // Originally implemented for SONOFF BASIC
  1244. // https://tinkerman.cat/adding-rf-to-a-non-rf-itead-sonoff/
  1245. // Also possible to use with SONOFF RF BRIDGE, thanks to @wildwiz
  1246. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  1247. #ifndef RFB_PROVIDER
  1248. #define RFB_PROVIDER RFB_PROVIDER_RCSWITCH
  1249. #endif
  1250. #ifndef RFB_RX_PIN
  1251. #define RFB_RX_PIN GPIO_NONE
  1252. #endif
  1253. #ifndef RFB_TX_PIN
  1254. #define RFB_TX_PIN GPIO_NONE
  1255. #endif
  1256. #ifndef RFB_LEARN_TIMEOUT
  1257. #define RFB_LEARN_TIMEOUT 15000
  1258. #endif
  1259. #ifndef RFB_SEND_DELAY
  1260. #define RFB_SEND_DELAY 500 // Interval between sendings in ms
  1261. #endif
  1262. #ifndef RFB_RECEIVE_DELAY
  1263. #define RFB_RECEIVE_DELAY 500 // Interval between recieving in ms (avoid bouncing)
  1264. #endif
  1265. #ifndef RFB_TRANSMIT_REPEATS
  1266. #define RFB_TRANSMIT_REPEATS 5 // How many times RCSwitch will repeat the message
  1267. #endif
  1268. // -----------------------------------------------------------------------------
  1269. // IR Bridge
  1270. // -----------------------------------------------------------------------------
  1271. #ifndef IR_SUPPORT
  1272. #define IR_SUPPORT 0 // Do not build with IR support by default (10.25Kb)
  1273. #endif
  1274. //#define IR_RX_PIN 5 // GPIO the receiver is connected to
  1275. //#define IR_TX_PIN 4 // GPIO the transmitter is connected to
  1276. #ifndef IR_USE_RAW
  1277. #define IR_USE_RAW 0 // Use raw codes
  1278. #endif
  1279. #ifndef IR_BUFFER_SIZE
  1280. #define IR_BUFFER_SIZE 1024
  1281. #endif
  1282. #ifndef IR_TIMEOUT
  1283. #define IR_TIMEOUT 15U
  1284. #endif
  1285. #ifndef IR_REPEAT
  1286. #define IR_REPEAT 1
  1287. #endif
  1288. #ifndef IR_DELAY
  1289. #define IR_DELAY 100
  1290. #endif
  1291. #ifndef IR_DEBOUNCE
  1292. #define IR_DEBOUNCE 500 // IR debounce time in milliseconds
  1293. #endif
  1294. #ifndef IR_BUTTON_SET
  1295. #define IR_BUTTON_SET 0 // IR button set to use (see ../ir_button.h)
  1296. #endif
  1297. //--------------------------------------------------------------------------------
  1298. // Custom RFM69 to MQTT bridge
  1299. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  1300. // Enable support by passing RFM69_SUPPORT=1 build flag
  1301. //--------------------------------------------------------------------------------
  1302. #ifndef RFM69_SUPPORT
  1303. #define RFM69_SUPPORT 0
  1304. #endif
  1305. #ifndef RFM69_MAX_TOPICS
  1306. #define RFM69_MAX_TOPICS 50
  1307. #endif
  1308. #ifndef RFM69_MAX_NODES
  1309. #define RFM69_MAX_NODES 255
  1310. #endif
  1311. #ifndef RFM69_DEFAULT_TOPIC
  1312. #define RFM69_DEFAULT_TOPIC "/rfm69gw/{node}/{key}"
  1313. #endif
  1314. #ifndef RFM69_NODE_ID
  1315. #define RFM69_NODE_ID 1
  1316. #endif
  1317. #ifndef RFM69_GATEWAY_ID
  1318. #define RFM69_GATEWAY_ID 1
  1319. #endif
  1320. #ifndef RFM69_NETWORK_ID
  1321. #define RFM69_NETWORK_ID 164
  1322. #endif
  1323. #ifndef RFM69_PROMISCUOUS
  1324. #define RFM69_PROMISCUOUS 0
  1325. #endif
  1326. #ifndef RFM69_PROMISCUOUS_SENDS
  1327. #define RFM69_PROMISCUOUS_SENDS 0
  1328. #endif
  1329. #ifndef RFM69_FREQUENCY
  1330. #define RFM69_FREQUENCY RF69_868MHZ
  1331. #endif
  1332. #ifndef RFM69_ENCRYPTKEY
  1333. #define RFM69_ENCRYPTKEY "fibonacci0123456"
  1334. #endif
  1335. #ifndef RFM69_CS_PIN
  1336. #define RFM69_CS_PIN SS
  1337. #endif
  1338. #ifndef RFM69_IRQ_PIN
  1339. #define RFM69_IRQ_PIN 5
  1340. #endif
  1341. #ifndef RFM69_RESET_PIN
  1342. #define RFM69_RESET_PIN 7
  1343. #endif
  1344. #ifndef RFM69_IS_RFM69HW
  1345. #define RFM69_IS_RFM69HW 0
  1346. #endif
  1347. //--------------------------------------------------------------------------------
  1348. // TUYA switch & dimmer support
  1349. //--------------------------------------------------------------------------------
  1350. #ifndef TUYA_SUPPORT
  1351. #define TUYA_SUPPORT 0
  1352. #endif
  1353. #ifndef TUYA_SERIAL
  1354. #define TUYA_SERIAL Serial
  1355. #endif
  1356. #ifndef TUYA_FILTER_ENABLED
  1357. #define TUYA_FILTER_ENABLED 1
  1358. #endif
  1359. #ifndef TUYA_DEBUG_ENABLED
  1360. #define TUYA_DEBUG_ENABLED 1
  1361. #endif
  1362. //--------------------------------------------------------------------------------
  1363. // Support expander MCP23S08
  1364. //--------------------------------------------------------------------------------
  1365. #ifndef MCP23S08_SUPPORT
  1366. #define MCP23S08_SUPPORT 0
  1367. #endif
  1368. //--------------------------------------------------------------------------------
  1369. // Support prometheus metrics export
  1370. //--------------------------------------------------------------------------------
  1371. #ifndef PROMETHEUS_SUPPORT
  1372. #define PROMETHEUS_SUPPORT 0
  1373. #endif
  1374. //--------------------------------------------------------------------------------
  1375. // ITEAD iFan support
  1376. //--------------------------------------------------------------------------------
  1377. #ifndef IFAN_SUPPORT
  1378. #define IFAN_SUPPORT 0
  1379. #endif
  1380. // =============================================================================
  1381. // Configuration helpers to help detect features
  1382. // =============================================================================
  1383. #ifndef DEBUG_SUPPORT
  1384. #define DEBUG_SUPPORT ( \
  1385. DEBUG_SERIAL_SUPPORT || \
  1386. DEBUG_UDP_SUPPORT || \
  1387. DEBUG_TELNET_SUPPORT || \
  1388. DEBUG_WEB_SUPPORT \
  1389. )
  1390. #endif
  1391. #ifndef FAN_SUPPORT
  1392. #define FAN_SUPPORT IFAN_SUPPORT
  1393. #endif