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.

1760 lines
59 KiB

8 years ago
8 years ago
6 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
6 years ago
6 years ago
6 years ago
8 years ago
8 years ago
6 years ago
6 years ago
6 years ago
6 years ago
8 years ago
6 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. #define DEVICE_NAME MANUFACTURER "_" DEVICE // Concatenate both to get a unique device name
  10. // When defined, ADMIN_PASS must be 8..63 printable ASCII characters. See:
  11. // https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access#Target_users_(authentication_key_distribution)
  12. // https://github.com/xoseperez/espurna/issues/1151
  13. #ifndef ADMIN_PASS
  14. #define ADMIN_PASS "fibonacci" // Default password (WEB, OTA, WIFI SoftAP)
  15. #endif
  16. #ifndef USE_PASSWORD
  17. #define USE_PASSWORD 1 // Insecurity caution! Disabling this will disable password querying completely.
  18. #endif
  19. #ifndef LOOP_DELAY_TIME
  20. #define LOOP_DELAY_TIME 10 // Delay for the main loop, in millis [0-250]
  21. // Recommended minimum is 10, see:
  22. // https://github.com/xoseperez/espurna/issues/1541
  23. // https://github.com/xoseperez/espurna/issues/1631
  24. // https://github.com/esp8266/Arduino/issues/5825
  25. #endif
  26. //------------------------------------------------------------------------------
  27. // DEBUG
  28. //------------------------------------------------------------------------------
  29. #ifndef DEBUG_LOG_MODE
  30. #define DEBUG_LOG_MODE DebugLogMode::Enabled // Set global logger mode. One of:
  31. // ::Enabled, ::Disabled or ::SkipBoot
  32. #endif
  33. // Serial debug log
  34. #ifndef DEBUG_SERIAL_SUPPORT
  35. #define DEBUG_SERIAL_SUPPORT 1 // Enable serial debug log
  36. #endif
  37. #ifndef DEBUG_PORT
  38. #define DEBUG_PORT Serial // Default debugging port
  39. #endif
  40. #ifndef SERIAL_BAUDRATE
  41. #define SERIAL_BAUDRATE 115200 // Default baudrate
  42. #endif
  43. #ifndef DEBUG_ADD_TIMESTAMP
  44. #define DEBUG_ADD_TIMESTAMP 1 // Add timestamp to debug messages
  45. // (in millis overflowing every 1000 seconds)
  46. #endif
  47. // Second serial port (used for RX)
  48. #ifndef SERIAL_RX_ENABLED
  49. #define SERIAL_RX_ENABLED 0 // Secondary serial port for RX
  50. #endif
  51. #ifndef SERIAL_RX_PORT
  52. #define SERIAL_RX_PORT Serial // This setting is usually defined
  53. // in the hardware.h file for those
  54. // boards that require it
  55. #endif
  56. #ifndef SERIAL_RX_BAUDRATE
  57. #define SERIAL_RX_BAUDRATE 115200 // Default baudrate
  58. #endif
  59. //------------------------------------------------------------------------------
  60. // UDP debug log
  61. // To receive the message son the destination computer use nc:
  62. // nc -ul 8113
  63. #ifndef DEBUG_UDP_SUPPORT
  64. #define DEBUG_UDP_SUPPORT 0 // Enable UDP debug log
  65. #endif
  66. #ifndef DEBUG_UDP_IP
  67. #define DEBUG_UDP_IP IPAddress(192, 168, 1, 100)
  68. #endif
  69. #ifndef DEBUG_UDP_PORT
  70. #define DEBUG_UDP_PORT 514
  71. #endif
  72. // If DEBUG_UDP_PORT is set to 514 syslog format is assumed
  73. // (https://tools.ietf.org/html/rfc3164)
  74. // DEBUG_UDP_FAC_PRI is the facility+priority
  75. #define DEBUG_UDP_FAC_PRI (SYSLOG_LOCAL0 | SYSLOG_DEBUG)
  76. //------------------------------------------------------------------------------
  77. #ifndef DEBUG_TELNET_SUPPORT
  78. #define DEBUG_TELNET_SUPPORT 1 // Enable telnet debug log (will only work if TELNET_SUPPORT is also 1)
  79. #endif
  80. //------------------------------------------------------------------------------
  81. #ifndef DEBUG_WEB_SUPPORT
  82. #define DEBUG_WEB_SUPPORT 1 // Enable web debug log (will only work if WEB_SUPPORT is also 1)
  83. #endif
  84. //------------------------------------------------------------------------------
  85. #ifndef DEBUG_LOG_BUFFER_SUPPORT
  86. #define DEBUG_LOG_BUFFER_SUPPORT 1 // Support boot log buffer (1.2Kb)
  87. // Will only work if DEBUG_LOG_BUFFER_ENABLED or runtime setting is also 1
  88. #endif
  89. #ifndef DEBUG_LOG_BUFFER_ENABLED
  90. #define DEBUG_LOG_BUFFER_ENABLED 0 // Disable boot log buffer by default
  91. #endif
  92. #ifndef DEBUG_LOG_BUFFER_SIZE
  93. #define DEBUG_LOG_BUFFER_SIZE 4096 // Store 4 Kb of log strings
  94. // WARNING! Memory is only reclaimed after `debug.buffer` prints the buffer contents
  95. #endif
  96. //------------------------------------------------------------------------------
  97. // TELNET
  98. //------------------------------------------------------------------------------
  99. #ifndef TELNET_SUPPORT
  100. #define TELNET_SUPPORT 1 // Enable telnet support by default (3.34Kb)
  101. #endif
  102. #ifndef TELNET_STA
  103. #define TELNET_STA 0 // By default, disallow connections via STA interface
  104. #endif
  105. #ifndef TELNET_AUTHENTICATION
  106. #define TELNET_AUTHENTICATION 1 // Request password to start telnet session by default
  107. #endif
  108. #ifndef TELNET_PORT
  109. #define TELNET_PORT 23 // Port to listen to telnet clients
  110. #endif
  111. #ifndef TELNET_MAX_CLIENTS
  112. #define TELNET_MAX_CLIENTS 1 // Max number of concurrent telnet clients
  113. #endif
  114. #ifndef TELNET_SERVER
  115. #define TELNET_SERVER TELNET_SERVER_ASYNC // Can be either TELNET_SERVER_ASYNC (using ESPAsyncTCP) or TELNET_SERVER_WIFISERVER (using WiFiServer)
  116. #endif
  117. #ifndef TELNET_SERVER_ASYNC_BUFFERED
  118. #define TELNET_SERVER_ASYNC_BUFFERED 0 // Enable buffered output for telnet server (+1Kb)
  119. // Helps to avoid lost data with lwip2 TCP_MSS=536 option
  120. #endif
  121. // Enable this flag to add support for reverse telnet (+800 bytes)
  122. // This is useful to telnet to a device behind a NAT or firewall
  123. // 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
  124. #ifndef TELNET_REVERSE_SUPPORT
  125. #define TELNET_REVERSE_SUPPORT 0
  126. #endif
  127. //------------------------------------------------------------------------------
  128. // TERMINAL
  129. //------------------------------------------------------------------------------
  130. #ifndef TERMINAL_SUPPORT
  131. #define TERMINAL_SUPPORT 1 // Enable terminal commands (0.97Kb)
  132. #endif
  133. #define TERMINAL_BUFFER_SIZE 128 // Max size for commands commands
  134. //------------------------------------------------------------------------------
  135. // SYSTEM CHECK
  136. //------------------------------------------------------------------------------
  137. #ifndef SYSTEM_CHECK_ENABLED
  138. #define SYSTEM_CHECK_ENABLED 1 // Enable crash check by default
  139. #endif
  140. #ifndef SYSTEM_CHECK_TIME
  141. #define SYSTEM_CHECK_TIME 60000 // The system is considered stable after these many millis
  142. #endif
  143. #ifndef SYSTEM_CHECK_MAX
  144. #define SYSTEM_CHECK_MAX 5 // After this many crashes on boot
  145. // the system is flagged as unstable
  146. #endif
  147. //------------------------------------------------------------------------------
  148. // EEPROM
  149. //------------------------------------------------------------------------------
  150. #define EEPROM_SIZE SPI_FLASH_SEC_SIZE // EEPROM size in bytes (1 sector = 4096 bytes)
  151. //#define EEPROM_RORATE_SECTORS 2 // Number of sectors to use for EEPROM rotation
  152. // If not defined the firmware will use a number based
  153. // on the number of available sectors
  154. #define EEPROM_RELAY_STATUS 0 // Address for the relay status (1 byte)
  155. #define EEPROM_ENERGY_COUNT 1 // Address for the energy counter (4 bytes)
  156. #define EEPROM_CUSTOM_RESET 5 // Address for the reset reason (1 byte)
  157. #define EEPROM_CRASH_COUNTER 6 // Address for the crash counter (1 byte)
  158. #define EEPROM_MESSAGE_ID 7 // Address for the MQTT message id (4 bytes)
  159. #define EEPROM_ROTATE_DATA 11 // Reserved for the EEPROM_ROTATE library (3 bytes)
  160. #define EEPROM_DATA_END 14 // End of custom EEPROM data block
  161. #ifndef SAVE_CRASH_ENABLED
  162. #define SAVE_CRASH_ENABLED 1 // Save stack trace to EEPROM by default
  163. // Depends on DEBUG_SUPPORT == 1
  164. #endif
  165. #ifndef SAVE_CRASH_STACK_TRACE_MAX
  166. #define SAVE_CRASH_STACK_TRACE_MAX 0x80 // limit at 128 bytes (increment/decrement by 16)
  167. #endif
  168. //------------------------------------------------------------------------------
  169. // THERMOSTAT
  170. //------------------------------------------------------------------------------
  171. #ifndef THERMOSTAT_SUPPORT
  172. #define THERMOSTAT_SUPPORT 0
  173. #endif
  174. #ifndef THERMOSTAT_DISPLAY_SUPPORT
  175. #define THERMOSTAT_DISPLAY_SUPPORT 0
  176. #endif
  177. #define THERMOSTAT_SERVER_LOST_INTERVAL 120000 //server means lost after 2 min from last response
  178. #define THERMOSTAT_REMOTE_TEMP_MAX_WAIT 120 // 2 min
  179. //------------------------------------------------------------------------------
  180. // HEARTBEAT
  181. //------------------------------------------------------------------------------
  182. #define HEARTBEAT_NONE 0 // Never send heartbeat
  183. #define HEARTBEAT_ONCE 1 // Send it only once upon MQTT connection
  184. #define HEARTBEAT_REPEAT 2 // Send it upon MQTT connection and every HEARTBEAT_INTERVAL
  185. #define HEARTBEAT_REPEAT_STATUS 3 // Send it upon MQTT connection and every HEARTBEAT_INTERVAL only STATUS report
  186. // Backwards compatibility check
  187. #if defined(HEARTBEAT_ENABLED) && (HEARTBEAT_ENABLED == 0)
  188. #define HEARTBEAT_MODE HEARTBEAT_NONE
  189. #endif
  190. #ifndef HEARTBEAT_MODE
  191. #define HEARTBEAT_MODE HEARTBEAT_REPEAT
  192. #endif
  193. #ifndef HEARTBEAT_INTERVAL
  194. #define HEARTBEAT_INTERVAL 300UL // Interval between heartbeat messages (in sec)
  195. #endif
  196. #define UPTIME_OVERFLOW 4294967295UL // Uptime overflow value
  197. // Values that will be reported in heartbeat
  198. #ifndef HEARTBEAT_REPORT_STATUS
  199. #define HEARTBEAT_REPORT_STATUS 1
  200. #endif
  201. #ifndef HEARTBEAT_REPORT_SSID
  202. #define HEARTBEAT_REPORT_SSID 1
  203. #endif
  204. #ifndef HEARTBEAT_REPORT_IP
  205. #define HEARTBEAT_REPORT_IP 1
  206. #endif
  207. #ifndef HEARTBEAT_REPORT_MAC
  208. #define HEARTBEAT_REPORT_MAC 1
  209. #endif
  210. #ifndef HEARTBEAT_REPORT_RSSI
  211. #define HEARTBEAT_REPORT_RSSI 1
  212. #endif
  213. #ifndef HEARTBEAT_REPORT_UPTIME
  214. #define HEARTBEAT_REPORT_UPTIME 1
  215. #endif
  216. #ifndef HEARTBEAT_REPORT_DATETIME
  217. #define HEARTBEAT_REPORT_DATETIME 1
  218. #endif
  219. #ifndef HEARTBEAT_REPORT_FREEHEAP
  220. #define HEARTBEAT_REPORT_FREEHEAP 1
  221. #endif
  222. #ifndef HEARTBEAT_REPORT_VCC
  223. #define HEARTBEAT_REPORT_VCC 1
  224. #endif
  225. #ifndef HEARTBEAT_REPORT_RELAY
  226. #define HEARTBEAT_REPORT_RELAY 1
  227. #endif
  228. #ifndef HEARTBEAT_REPORT_LIGHT
  229. #define HEARTBEAT_REPORT_LIGHT 1
  230. #endif
  231. #ifndef HEARTBEAT_REPORT_HOSTNAME
  232. #define HEARTBEAT_REPORT_HOSTNAME 1
  233. #endif
  234. #ifndef HEARTBEAT_REPORT_DESCRIPTION
  235. #define HEARTBEAT_REPORT_DESCRIPTION 1
  236. #endif
  237. #ifndef HEARTBEAT_REPORT_APP
  238. #define HEARTBEAT_REPORT_APP 1
  239. #endif
  240. #ifndef HEARTBEAT_REPORT_VERSION
  241. #define HEARTBEAT_REPORT_VERSION 1
  242. #endif
  243. #ifndef HEARTBEAT_REPORT_BOARD
  244. #define HEARTBEAT_REPORT_BOARD 1
  245. #endif
  246. #ifndef HEARTBEAT_REPORT_LOADAVG
  247. #define HEARTBEAT_REPORT_LOADAVG 1
  248. #endif
  249. #ifndef HEARTBEAT_REPORT_INTERVAL
  250. #define HEARTBEAT_REPORT_INTERVAL 0
  251. #endif
  252. #ifndef HEARTBEAT_REPORT_RANGE
  253. #define HEARTBEAT_REPORT_RANGE THERMOSTAT_SUPPORT
  254. #endif
  255. #ifndef HEARTBEAT_REPORT_REMOTE_TEMP
  256. #define HEARTBEAT_REPORT_REMOTE_TEMP THERMOSTAT_SUPPORT
  257. #endif
  258. #ifndef HEARTBEAT_REPORT_BSSID
  259. #define HEARTBEAT_REPORT_BSSID 0
  260. #endif
  261. //------------------------------------------------------------------------------
  262. // Load average
  263. //------------------------------------------------------------------------------
  264. #ifndef LOADAVG_INTERVAL
  265. #define LOADAVG_INTERVAL 30000 // Interval between calculating load average (in ms)
  266. #endif
  267. //------------------------------------------------------------------------------
  268. // BUTTON
  269. //------------------------------------------------------------------------------
  270. #ifndef BUTTON_SUPPORT
  271. #define BUTTON_SUPPORT 1
  272. #endif
  273. #ifndef BUTTON_DEBOUNCE_DELAY
  274. #define BUTTON_DEBOUNCE_DELAY 50 // Debounce delay (ms)
  275. #endif
  276. #ifndef BUTTON_DBLCLICK_DELAY
  277. #define BUTTON_DBLCLICK_DELAY 500 // Time in ms to wait for a second (or third...) click
  278. #endif
  279. #ifndef BUTTON_LNGCLICK_DELAY
  280. #define BUTTON_LNGCLICK_DELAY 1000 // Time in ms holding the button down to get a long click
  281. #endif
  282. #ifndef BUTTON_LNGLNGCLICK_DELAY
  283. #define BUTTON_LNGLNGCLICK_DELAY 10000 // Time in ms holding the button down to get a long-long click
  284. #endif
  285. #ifndef BUTTON_MQTT_SEND_ALL_EVENTS
  286. #define BUTTON_MQTT_SEND_ALL_EVENTS 0 // 0 - to send only events the are bound to actions
  287. // 1 - to send all button events to MQTT
  288. #endif
  289. #ifndef BUTTON_MQTT_RETAIN
  290. #define BUTTON_MQTT_RETAIN 1
  291. #endif
  292. #ifndef BUTTON_EVENTS_SOURCE
  293. #define BUTTON_EVENTS_SOURCE BUTTON_EVENTS_SOURCE_GENERIC // Type of button event source. One of:
  294. // BUTTON_EVENTS_SOURCE_GENERIC - GPIOs (virtual or real)
  295. // BUTTON_EVENTS_SOURCE_SONOFF_DUAL - hardware specific, drive buttons through serial connection
  296. // BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL - similar to Itead Sonoff Dual, hardware specific
  297. #endif
  298. //------------------------------------------------------------------------------
  299. // ENCODER
  300. //------------------------------------------------------------------------------
  301. #ifndef ENCODER_SUPPORT
  302. #define ENCODER_SUPPORT 0
  303. #endif
  304. #ifndef ENCODER_MINIMUM_DELTA
  305. #define ENCODER_MINIMUM_DELTA 1
  306. #endif
  307. //------------------------------------------------------------------------------
  308. // LED
  309. //------------------------------------------------------------------------------
  310. #ifndef LED_SUPPORT
  311. #define LED_SUPPORT 1
  312. #endif
  313. //------------------------------------------------------------------------------
  314. // RELAY
  315. //------------------------------------------------------------------------------
  316. // Default boot mode: 0 means OFF, 1 ON and 2 whatever was before
  317. #ifndef RELAY_BOOT_MODE
  318. #define RELAY_BOOT_MODE RELAY_BOOT_OFF
  319. #endif
  320. // 0 means ANY, 1 zero or one and 2 one and only one
  321. #ifndef RELAY_SYNC
  322. #define RELAY_SYNC RELAY_SYNC_ANY
  323. #endif
  324. // Default pulse mode: 0 means no pulses, 1 means normally off, 2 normally on
  325. #ifndef RELAY_PULSE_MODE
  326. #define RELAY_PULSE_MODE RELAY_PULSE_NONE
  327. #endif
  328. // Default pulse time in seconds
  329. #ifndef RELAY_PULSE_TIME
  330. #define RELAY_PULSE_TIME 1.0
  331. #endif
  332. // Relay requests flood protection window - in seconds
  333. #ifndef RELAY_FLOOD_WINDOW
  334. #define RELAY_FLOOD_WINDOW 3.0
  335. #endif
  336. // Allowed actual relay changes inside requests flood protection window
  337. #ifndef RELAY_FLOOD_CHANGES
  338. #define RELAY_FLOOD_CHANGES 5
  339. #endif
  340. // Pulse with in milliseconds for a latched relay
  341. #ifndef RELAY_LATCHING_PULSE
  342. #define RELAY_LATCHING_PULSE 10
  343. #endif
  344. // Do not save relay state after these many milliseconds
  345. #ifndef RELAY_SAVE_DELAY
  346. #define RELAY_SAVE_DELAY 1000
  347. #endif
  348. #ifndef RELAY_REPORT_STATUS
  349. #define RELAY_REPORT_STATUS 1
  350. #endif
  351. // Configure the MQTT payload for ON, OFF and TOGGLE
  352. #ifndef RELAY_MQTT_OFF
  353. #define RELAY_MQTT_OFF "0"
  354. #endif
  355. #ifndef RELAY_MQTT_ON
  356. #define RELAY_MQTT_ON "1"
  357. #endif
  358. #ifndef RELAY_MQTT_TOGGLE
  359. #define RELAY_MQTT_TOGGLE "2"
  360. #endif
  361. // -----------------------------------------------------------------------------
  362. // WIFI
  363. // -----------------------------------------------------------------------------
  364. #ifndef WIFI_CONNECT_TIMEOUT
  365. #define WIFI_CONNECT_TIMEOUT 60000 // Connecting timeout for WIFI in ms
  366. #endif
  367. #ifndef WIFI_RECONNECT_INTERVAL
  368. #define WIFI_RECONNECT_INTERVAL 180000 // If could not connect to WIFI, retry after this time in ms
  369. #endif
  370. #ifndef WIFI_MAX_NETWORKS
  371. #define WIFI_MAX_NETWORKS 5 // Max number of WIFI connection configurations
  372. #endif
  373. #ifndef WIFI_AP_CAPTIVE
  374. #define WIFI_AP_CAPTIVE 1 // Captive portal enabled when in AP mode
  375. #endif
  376. #ifndef WIFI_FALLBACK_APMODE
  377. #define WIFI_FALLBACK_APMODE 1 // Fallback to AP mode if no STA connection
  378. #endif
  379. #ifndef WIFI_SLEEP_MODE
  380. #define WIFI_SLEEP_MODE WIFI_NONE_SLEEP // WIFI_NONE_SLEEP, WIFI_LIGHT_SLEEP or WIFI_MODEM_SLEEP
  381. #endif
  382. #ifndef WIFI_SCAN_NETWORKS
  383. #define WIFI_SCAN_NETWORKS 1 // Perform a network scan before connecting
  384. #endif
  385. // Optional hardcoded configuration (up to 5 networks, depending on WIFI_MAX_NETWORKS and espurna/wifi_config.h)
  386. #ifndef WIFI1_SSID
  387. #define WIFI1_SSID ""
  388. #endif
  389. #ifndef WIFI1_PASS
  390. #define WIFI1_PASS ""
  391. #endif
  392. #ifndef WIFI1_IP
  393. #define WIFI1_IP ""
  394. #endif
  395. #ifndef WIFI1_GW
  396. #define WIFI1_GW ""
  397. #endif
  398. #ifndef WIFI1_MASK
  399. #define WIFI1_MASK ""
  400. #endif
  401. #ifndef WIFI1_DNS
  402. #define WIFI1_DNS ""
  403. #endif
  404. #ifndef WIFI2_SSID
  405. #define WIFI2_SSID ""
  406. #endif
  407. #ifndef WIFI2_PASS
  408. #define WIFI2_PASS ""
  409. #endif
  410. #ifndef WIFI2_IP
  411. #define WIFI2_IP ""
  412. #endif
  413. #ifndef WIFI2_GW
  414. #define WIFI2_GW ""
  415. #endif
  416. #ifndef WIFI2_MASK
  417. #define WIFI2_MASK ""
  418. #endif
  419. #ifndef WIFI2_DNS
  420. #define WIFI2_DNS ""
  421. #endif
  422. #ifndef WIFI3_SSID
  423. #define WIFI3_SSID ""
  424. #endif
  425. #ifndef WIFI3_PASS
  426. #define WIFI3_PASS ""
  427. #endif
  428. #ifndef WIFI3_IP
  429. #define WIFI3_IP ""
  430. #endif
  431. #ifndef WIFI3_GW
  432. #define WIFI3_GW ""
  433. #endif
  434. #ifndef WIFI3_MASK
  435. #define WIFI3_MASK ""
  436. #endif
  437. #ifndef WIFI3_DNS
  438. #define WIFI3_DNS ""
  439. #endif
  440. #ifndef WIFI4_SSID
  441. #define WIFI4_SSID ""
  442. #endif
  443. #ifndef WIFI4_PASS
  444. #define WIFI4_PASS ""
  445. #endif
  446. #ifndef WIFI4_IP
  447. #define WIFI4_IP ""
  448. #endif
  449. #ifndef WIFI4_GW
  450. #define WIFI4_GW ""
  451. #endif
  452. #ifndef WIFI4_MASK
  453. #define WIFI4_MASK ""
  454. #endif
  455. #ifndef WIFI4_DNS
  456. #define WIFI4_DNS ""
  457. #endif
  458. #ifndef WIFI5_SSID
  459. #define WIFI5_SSID ""
  460. #endif
  461. #ifndef WIFI5_PASS
  462. #define WIFI5_PASS ""
  463. #endif
  464. #ifndef WIFI5_IP
  465. #define WIFI5_IP ""
  466. #endif
  467. #ifndef WIFI5_GW
  468. #define WIFI5_GW ""
  469. #endif
  470. #ifndef WIFI5_MASK
  471. #define WIFI5_MASK ""
  472. #endif
  473. #ifndef WIFI5_DNS
  474. #define WIFI5_DNS ""
  475. #endif
  476. #ifndef WIFI_RSSI_1M
  477. #define WIFI_RSSI_1M -30 // Calibrate it with your router reading the RSSI at 1m
  478. #endif
  479. #ifndef WIFI_PROPAGATION_CONST
  480. #define WIFI_PROPAGATION_CONST 4 // This is typically something between 2.7 to 4.3 (free space is 2)
  481. #endif
  482. // ref: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html#config-lwip-esp-gratuitous-arp
  483. // ref: https://github.com/xoseperez/espurna/pull/1877#issuecomment-525612546
  484. //
  485. // Broadcast gratuitous ARP periodically to update ARP tables on the AP and all devices on the same network.
  486. // Helps to solve compatibility issues when ESP fails to timely reply to ARP requests, causing the device's ARP table entry to expire.
  487. #ifndef WIFI_GRATUITOUS_ARP_SUPPORT
  488. #define WIFI_GRATUITOUS_ARP_SUPPORT 1
  489. #endif
  490. // Interval is randomized on each boot in range from ..._MIN to ..._MAX (ms)
  491. #ifndef WIFI_GRATUITOUS_ARP_INTERVAL_MIN
  492. #define WIFI_GRATUITOUS_ARP_INTERVAL_MIN 15000
  493. #endif
  494. #ifndef WIFI_GRATUITOUS_ARP_INTERVAL_MAX
  495. #define WIFI_GRATUITOUS_ARP_INTERVAL_MAX 30000
  496. #endif
  497. // ref: https://github.com/esp8266/Arduino/issues/6471
  498. // ref: https://github.com/esp8266/Arduino/issues/6366
  499. //
  500. // Issue #6366 turned out to be high tx power causing weird behavior. Lowering tx power achieved stability.
  501. #ifndef WIFI_OUTPUT_POWER_DBM
  502. #define WIFI_OUTPUT_POWER_DBM 20.0f
  503. #endif
  504. // -----------------------------------------------------------------------------
  505. // WEB
  506. // -----------------------------------------------------------------------------
  507. #ifndef WEB_SUPPORT
  508. #define WEB_SUPPORT 1 // Enable web support (http, api, 121.65Kb)
  509. #endif
  510. #ifndef WEB_EMBEDDED
  511. #define WEB_EMBEDDED 1 // Build the firmware with the web interface embedded in
  512. #endif
  513. // Requires ESPAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and Arduino Core version >= 2.4.0
  514. // XXX: This is not working at the moment!! Pending https://github.com/me-no-dev/ESPAsyncTCP/issues/95
  515. #ifndef WEB_SSL_ENABLED
  516. #define WEB_SSL_ENABLED 0 // Use HTTPS web interface
  517. #endif
  518. #ifndef WEB_USERNAME
  519. #define WEB_USERNAME "admin" // HTTP username
  520. #endif
  521. #ifndef WEB_FORCE_PASS_CHANGE
  522. #define WEB_FORCE_PASS_CHANGE 1 // Force the user to change the password if default one
  523. #endif
  524. #ifndef WEB_PORT
  525. #define WEB_PORT 80 // HTTP port
  526. #endif
  527. // Defining a WEB_REMOTE_DOMAIN will enable Cross-Origin Resource Sharing (CORS)
  528. // so you will be able to login to this device from another domain. This will allow
  529. // you to manage all ESPurna devices in your local network from a unique installation
  530. // of the web UI. This installation could be in a local server (a Raspberry Pi, for instance)
  531. // or in the Internet. Since the WebUI is just one compressed file with HTML, CSS and JS
  532. // there are no special requirements. Any static web server will do (NGinx, Apache, Lighttpd,...).
  533. // The only requirement is that the resource must be available under this domain.
  534. #ifndef WEB_REMOTE_DOMAIN
  535. #define WEB_REMOTE_DOMAIN "http://espurna.io"
  536. #endif
  537. // -----------------------------------------------------------------------------
  538. // WEBSOCKETS
  539. // -----------------------------------------------------------------------------
  540. // This will only be enabled if WEB_SUPPORT is 1 (this is the default value)
  541. #ifndef WS_AUTHENTICATION
  542. #define WS_AUTHENTICATION 1 // WS authentication ON by default (see #507)
  543. #endif
  544. #ifndef WS_BUFFER_SIZE
  545. #define WS_BUFFER_SIZE 5 // Max number of secured websocket connections
  546. #endif
  547. #ifndef WS_TIMEOUT
  548. #define WS_TIMEOUT 1800000 // Timeout for secured websocket
  549. #endif
  550. #ifndef WS_UPDATE_INTERVAL
  551. #define WS_UPDATE_INTERVAL 30000 // Update clients every 30 seconds
  552. #endif
  553. // -----------------------------------------------------------------------------
  554. // API
  555. // -----------------------------------------------------------------------------
  556. #ifndef API_SUPPORT
  557. #define API_SUPPORT 1 // API (REST & RPC) support built in
  558. #endif
  559. // This will only be enabled if WEB_SUPPORT is 1 (this is the default value)
  560. #ifndef API_ENABLED
  561. #define API_ENABLED 0 // Do not enable API by default
  562. #endif
  563. #ifndef API_KEY
  564. #define API_KEY "" // Do not enable API by default. WebUI will automatically generate the key
  565. #endif
  566. #ifndef API_RESTFUL
  567. #define API_RESTFUL 1 // A restful API requires changes to be issued as PUT requests
  568. // Setting this to 0 will allow using GET to change relays, for instance
  569. #endif
  570. #ifndef API_BUFFER_SIZE
  571. #define API_BUFFER_SIZE 64 // Size of the buffer for HTTP GET API responses
  572. #endif
  573. #ifndef API_REAL_TIME_VALUES
  574. #define API_REAL_TIME_VALUES 0 // Show filtered/median values by default (0 => median, 1 => real time)
  575. #endif
  576. // -----------------------------------------------------------------------------
  577. // MDNS / LLMNR / NETBIOS / SSDP
  578. // -----------------------------------------------------------------------------
  579. #ifndef MDNS_SERVER_SUPPORT
  580. #define MDNS_SERVER_SUPPORT 1 // Publish services using mDNS by default (1.48Kb)
  581. #endif
  582. #ifndef MDNS_CLIENT_SUPPORT
  583. #define MDNS_CLIENT_SUPPORT 0 // Resolve mDNS names (3.44Kb)
  584. #endif
  585. #ifndef LLMNR_SUPPORT
  586. #define LLMNR_SUPPORT 0 // Publish device using LLMNR protocol by default (1.95Kb) - requires Core version >= 2.4.0
  587. #endif
  588. #ifndef NETBIOS_SUPPORT
  589. #define NETBIOS_SUPPORT 0 // Publish device using NetBIOS protocol by default (1.26Kb) - requires Core version >= 2.4.0
  590. #endif
  591. #ifndef SSDP_SUPPORT
  592. #define SSDP_SUPPORT 0 // Publish device using SSDP protocol by default (4.59Kb)
  593. // Not compatible with ALEXA_SUPPORT at the moment
  594. #endif
  595. #ifndef SSDP_DEVICE_TYPE
  596. #define SSDP_DEVICE_TYPE "upnp:rootdevice"
  597. //#define SSDP_DEVICE_TYPE "urn:schemas-upnp-org:device:BinaryLight:1"
  598. #endif
  599. // -----------------------------------------------------------------------------
  600. // SPIFFS
  601. // -----------------------------------------------------------------------------
  602. #ifndef SPIFFS_SUPPORT
  603. #define SPIFFS_SUPPORT 0 // Do not add support for SPIFFS by default
  604. #endif
  605. // -----------------------------------------------------------------------------
  606. // SSL Client ** EXPERIMENTAL **
  607. // -----------------------------------------------------------------------------
  608. #ifndef SECURE_CLIENT
  609. #define SECURE_CLIENT SECURE_CLIENT_NONE // What variant of WiFiClient to use
  610. // SECURE_CLIENT_NONE - No secure client support (default)
  611. // SECURE_CLIENT_AXTLS - axTLS client secure support (All Core versions, ONLY TLS 1.1)
  612. // SECURE_CLIENT_BEARSSL - BearSSL client secure support (starting with 2.5.0, TLS 1.2)
  613. //
  614. // axTLS marked for derecation since Arduino Core 2.4.2 and **will** be removed in the future
  615. #endif
  616. // Security check that is performed when the connection is established:
  617. // SECURE_CLIENT_CHECK_CA - Use Trust Anchor / Root Certificate
  618. // Supported only by the SECURE_CLIENT_BEARSSL
  619. // (See respective ..._SECURE_CLIENT_INCLUDE_CA options per-module)
  620. // SECURE_CLIENT_CHECK_FINGERPRINT - Check certificate fingerprint
  621. // SECURE_CLIENT_CHECK_NONE - Allow insecure connections
  622. #ifndef SECURE_CLIENT_CHECK
  623. #if SECURE_CLIENT == SECURE_CLIENT_BEARSSL
  624. #define SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK_CA
  625. #else
  626. #define SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK_FINGERPRINT
  627. #endif
  628. #endif // SECURE_CLIENT_CHECK
  629. // Support Maximum Fragment Length Negotiation TLS extension
  630. // "...negotiate a smaller maximum fragment length due to memory limitations or bandwidth limitations."
  631. // - https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/bearssl-client-secure-class.html#mfln-or-maximum-fragment-length-negotiation-saving-ram
  632. // - https://tools.ietf.org/html/rfc6066#section-4
  633. #ifndef SECURE_CLIENT_MFLN
  634. #define SECURE_CLIENT_MFLN 0 // The only possible values are: 512, 1024, 2048 and 4096
  635. // Set to 0 to disable (default)
  636. #endif
  637. // -----------------------------------------------------------------------------
  638. // OTA
  639. // -----------------------------------------------------------------------------
  640. #ifndef OTA_PORT
  641. #define OTA_PORT 8266 // Port for ArduinoOTA
  642. #endif
  643. #ifndef OTA_MQTT_SUPPORT
  644. #define OTA_MQTT_SUPPORT 0 // Listen for HTTP(s) URLs at '<root topic>/ota'. Depends on OTA_CLIENT
  645. #endif
  646. #ifndef OTA_ARDUINOOTA_SUPPORT
  647. #define OTA_ARDUINOOTA_SUPPORT 1 // Support ArduinoOTA by default (4.2Kb)
  648. // Implicitly depends on ESP8266mDNS library, thus increasing firmware size
  649. #endif
  650. #ifndef OTA_CLIENT
  651. #define OTA_CLIENT OTA_CLIENT_ASYNCTCP // Terminal / MQTT OTA support
  652. // OTA_CLIENT_ASYNCTCP (ESPAsyncTCP library)
  653. // OTA_CLIENT_HTTPUPDATE (Arduino Core library)
  654. #endif
  655. #define OTA_GITHUB_FP "CA:06:F5:6B:25:8B:7A:0D:4F:2B:05:47:09:39:47:86:51:15:19:84"
  656. #ifndef OTA_FINGERPRINT
  657. #define OTA_FINGERPRINT OTA_GITHUB_FP
  658. #endif
  659. #ifndef OTA_SECURE_CLIENT_CHECK
  660. #define OTA_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK
  661. #endif
  662. #ifndef OTA_SECURE_CLIENT_MFLN
  663. #define OTA_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN
  664. #endif
  665. #ifndef OTA_SECURE_CLIENT_INCLUDE_CA
  666. #define OTA_SECURE_CLIENT_INCLUDE_CA 0 // Use user-provided CA. Only PROGMEM PEM option is supported.
  667. // TODO: eventually should be replaced with pre-parsed structs, read directly from flash
  668. // (ref: https://github.com/earlephilhower/bearssl-esp8266/pull/14)
  669. //
  670. // When enabled, current implementation includes "static/ota_client_trusted_root_ca.h" with
  671. // const char _ota_client_trusted_root_ca[] PROGMEM = "...PEM data...";
  672. // By default, using DigiCert root in "static/digicert_evroot_pem.h" (for https://github.com)
  673. #endif
  674. // -----------------------------------------------------------------------------
  675. // NOFUSS
  676. // -----------------------------------------------------------------------------
  677. #ifndef NOFUSS_SUPPORT
  678. #define NOFUSS_SUPPORT 0 // Do not enable support for NoFuss by default (12.65Kb)
  679. #endif
  680. #ifndef NOFUSS_ENABLED
  681. #define NOFUSS_ENABLED 0 // Do not perform NoFUSS updates by default
  682. #endif
  683. #ifndef NOFUSS_SERVER
  684. #define NOFUSS_SERVER "" // Default NoFuss Server
  685. #endif
  686. #ifndef NOFUSS_INTERVAL
  687. #define NOFUSS_INTERVAL 3600000 // Check for updates every hour
  688. #endif
  689. // -----------------------------------------------------------------------------
  690. // UART <-> MQTT
  691. // -----------------------------------------------------------------------------
  692. #ifndef UART_MQTT_SUPPORT
  693. #define UART_MQTT_SUPPORT 0 // No support by default
  694. #endif
  695. #ifndef UART_MQTT_USE_SOFT
  696. #define UART_MQTT_USE_SOFT 0 // Use SoftwareSerial
  697. #endif
  698. #ifndef UART_MQTT_HW_PORT
  699. #define UART_MQTT_HW_PORT Serial // Hardware serial port (if UART_MQTT_USE_SOFT == 0)
  700. #endif
  701. #ifndef UART_MQTT_RX_PIN
  702. #define UART_MQTT_RX_PIN 4 // RX PIN (if UART_MQTT_USE_SOFT == 1)
  703. #endif
  704. #ifndef UART_MQTT_TX_PIN
  705. #define UART_MQTT_TX_PIN 5 // TX PIN (if UART_MQTT_USE_SOFT == 1)
  706. #endif
  707. #ifndef UART_MQTT_BAUDRATE
  708. #define UART_MQTT_BAUDRATE 115200 // Serial speed
  709. #endif
  710. #ifndef UART_MQTT_TERMINATION
  711. #define UART_MQTT_TERMINATION '\n' // Termination character
  712. #endif
  713. #define UART_MQTT_BUFFER_SIZE 100 // UART buffer size
  714. // -----------------------------------------------------------------------------
  715. // MQTT
  716. // -----------------------------------------------------------------------------
  717. #ifndef MQTT_SUPPORT
  718. #define MQTT_SUPPORT 1 // MQTT support (22.38Kb async, 12.48Kb sync)
  719. #endif
  720. #ifndef MQTT_LIBRARY
  721. #define MQTT_LIBRARY MQTT_LIBRARY_ASYNCMQTTCLIENT // MQTT_LIBRARY_ASYNCMQTTCLIENT (default, https://github.com/marvinroger/async-mqtt-client)
  722. // MQTT_LIBRARY_PUBSUBCLIENT (https://github.com/knolleary/pubsubclient)
  723. // MQTT_LIBRARY_ARDUINOMQTT (https://github.com/256dpi/arduino-mqtt)
  724. #endif
  725. // -----------------------------------------------------------------------------
  726. // MQTT OVER SSL
  727. // -----------------------------------------------------------------------------
  728. //
  729. // Requires SECURE_CLIENT set to SECURE_CLIENT_AXTLS or SECURE_CLIENT_BEARSSL
  730. // It is recommended to use MQTT_LIBRARY_ARDUINOMQTT or MQTT_LIBRARY_PUBSUBCLIENT
  731. // It is recommended to use SECURE_CLIENT_BEARSSL
  732. // It is recommended to use ESP8266 Arduino Core >= 2.5.2 with SECURE_CLIENT_BEARSSL
  733. //
  734. // Current version of MQTT_LIBRARY_ASYNCMQTTCLIENT only supports SECURE_CLIENT_AXTLS
  735. //
  736. // It is recommended to use WEB_SUPPORT=0 with either SECURE_CLIENT option, as there are miscellaneous problems when using them simultaneously
  737. // (although, things might've improved, and I'd encourage to check whether this is true or not)
  738. //
  739. // When using MQTT_LIBRARY_PUBSUBCLIENT or MQTT_LIBRARY_ARDUINOMQTT, you will have to disable every module that uses ESPAsyncTCP:
  740. // ALEXA_SUPPORT=0, INFLUXDB_SUPPORT=0, TELNET_SUPPORT=0, THINGSPEAK_SUPPORT=0, DEBUG_TELNET_SUPPORT=0 and WEB_SUPPORT=0
  741. // Or, use "sync" versions instead (note that not every module has this option):
  742. // THINGSPEAK_USE_ASYNC=0, TELNET_SERVER=TELNET_SERVER_WIFISERVER
  743. //
  744. // See SECURE_CLIENT_CHECK for all possible connection verification options.
  745. //
  746. // The simpliest way to verify SSL connection is to use fingerprinting.
  747. // For example, to get Google's MQTT server certificate fingerprint, run the following command:
  748. // $ echo -n | openssl s_client -connect mqtt.googleapis.com:8883 2>&1 | openssl x509 -noout -fingerprint -sha1 | cut -d\= -f2
  749. // Note that fingerprint will change when certificate changes e.g. LetsEncrypt renewals or when the CSR updates
  750. #ifndef MQTT_SSL_ENABLED
  751. #define MQTT_SSL_ENABLED 0 // By default MQTT over SSL will not be enabled
  752. #endif
  753. #ifndef MQTT_SSL_FINGERPRINT
  754. #define MQTT_SSL_FINGERPRINT "" // SSL fingerprint of the server
  755. #endif
  756. #ifndef MQTT_SECURE_CLIENT_CHECK
  757. #define MQTT_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK // Use global verification setting by default
  758. #endif
  759. #ifndef MQTT_SECURE_CLIENT_MFLN
  760. #define MQTT_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN // Use global MFLN setting by default
  761. #endif
  762. #ifndef MQTT_SECURE_CLIENT_INCLUDE_CA
  763. #define MQTT_SECURE_CLIENT_INCLUDE_CA 0 // Use user-provided CA. Only PROGMEM PEM option is supported.
  764. // When enabled, current implementation includes "static/mqtt_client_trusted_root_ca.h" with
  765. // const char _mqtt_client_trusted_root_ca[] PROGMEM = "...PEM data...";
  766. // By default, using LetsEncrypt X3 root in "static/letsencrypt_isrgroot_pem.h"
  767. #endif
  768. #ifndef MQTT_ENABLED
  769. #define MQTT_ENABLED 0 // Do not enable MQTT connection by default
  770. #endif
  771. #ifndef MQTT_AUTOCONNECT
  772. #define MQTT_AUTOCONNECT 1 // If enabled and MDNS_SERVER_SUPPORT=1 will perform an autodiscover and
  773. // autoconnect to the first MQTT broker found if none defined
  774. #endif
  775. #ifndef MQTT_SERVER
  776. #define MQTT_SERVER "" // Default MQTT broker address
  777. #endif
  778. #ifndef MQTT_USER
  779. #define MQTT_USER "" // Default MQTT broker usename
  780. #endif
  781. #ifndef MQTT_PASS
  782. #define MQTT_PASS "" // Default MQTT broker password
  783. #endif
  784. #ifndef MQTT_PORT
  785. #define MQTT_PORT 1883 // MQTT broker port
  786. #endif
  787. #ifndef MQTT_TOPIC
  788. #define MQTT_TOPIC "{hostname}" // Default MQTT base topic
  789. #endif
  790. #ifndef MQTT_RETAIN
  791. #define MQTT_RETAIN true // MQTT retain flag
  792. #endif
  793. #ifndef MQTT_QOS
  794. #define MQTT_QOS 0 // MQTT QoS value for all messages
  795. #endif
  796. #ifndef MQTT_KEEPALIVE
  797. #define MQTT_KEEPALIVE 120 // MQTT keepalive value
  798. #endif
  799. #ifndef MQTT_RECONNECT_DELAY_MIN
  800. #define MQTT_RECONNECT_DELAY_MIN 5000 // Try to reconnect in 5 seconds upon disconnection
  801. #endif
  802. #ifndef MQTT_RECONNECT_DELAY_STEP
  803. #define MQTT_RECONNECT_DELAY_STEP 5000 // Increase the reconnect delay in 5 seconds after each failed attempt
  804. #endif
  805. #ifndef MQTT_RECONNECT_DELAY_MAX
  806. #define MQTT_RECONNECT_DELAY_MAX 120000 // Set reconnect time to 2 minutes at most
  807. #endif
  808. #ifndef MQTT_SKIP_RETAINED
  809. #define MQTT_SKIP_RETAINED 1 // Skip retained messages on connection
  810. #endif
  811. #ifndef MQTT_SKIP_TIME
  812. #define MQTT_SKIP_TIME 1000 // Skip messages for 1 second anter connection
  813. #endif
  814. #if THERMOSTAT_SUPPORT == 1
  815. #ifndef MQTT_USE_JSON
  816. #define MQTT_USE_JSON 1 // Group messages in a JSON body
  817. #endif
  818. #else
  819. #ifndef MQTT_USE_JSON
  820. #define MQTT_USE_JSON 0 // Don't group messages in a JSON body (default)
  821. #endif
  822. #endif
  823. #ifndef MQTT_USE_JSON_DELAY
  824. #define MQTT_USE_JSON_DELAY 100 // Wait this many ms before grouping messages
  825. #endif
  826. #ifndef MQTT_QUEUE_MAX_SIZE
  827. #define MQTT_QUEUE_MAX_SIZE 20 // Size of the MQTT queue when MQTT_USE_JSON is enabled
  828. #endif
  829. // These are the properties that will be sent when useJson is true
  830. #ifndef MQTT_ENQUEUE_IP
  831. #define MQTT_ENQUEUE_IP 1
  832. #endif
  833. #ifndef MQTT_ENQUEUE_MAC
  834. #define MQTT_ENQUEUE_MAC 1
  835. #endif
  836. #ifndef MQTT_ENQUEUE_HOSTNAME
  837. #define MQTT_ENQUEUE_HOSTNAME 1
  838. #endif
  839. #ifndef MQTT_ENQUEUE_DATETIME
  840. #define MQTT_ENQUEUE_DATETIME 1
  841. #endif
  842. #ifndef MQTT_ENQUEUE_MESSAGE_ID
  843. #define MQTT_ENQUEUE_MESSAGE_ID 1
  844. #endif
  845. // These particles will be concatenated to the MQTT_TOPIC base to form the actual topic
  846. #define MQTT_TOPIC_JSON "data"
  847. #define MQTT_TOPIC_ACTION "action"
  848. #define MQTT_TOPIC_RELAY "relay"
  849. #define MQTT_TOPIC_LED "led"
  850. #define MQTT_TOPIC_BUTTON "button"
  851. #define MQTT_TOPIC_IP "ip"
  852. #define MQTT_TOPIC_SSID "ssid"
  853. #define MQTT_TOPIC_BSSID "bssid"
  854. #define MQTT_TOPIC_VERSION "version"
  855. #define MQTT_TOPIC_UPTIME "uptime"
  856. #define MQTT_TOPIC_DATETIME "datetime"
  857. #define MQTT_TOPIC_TIMESTAMP "timestamp"
  858. #define MQTT_TOPIC_FREEHEAP "freeheap"
  859. #define MQTT_TOPIC_VCC "vcc"
  860. #ifndef MQTT_TOPIC_STATUS
  861. #define MQTT_TOPIC_STATUS "status"
  862. #endif
  863. #define MQTT_TOPIC_MAC "mac"
  864. #define MQTT_TOPIC_RSSI "rssi"
  865. #define MQTT_TOPIC_MESSAGE_ID "id"
  866. #define MQTT_TOPIC_APP "app"
  867. #define MQTT_TOPIC_INTERVAL "interval"
  868. #define MQTT_TOPIC_HOSTNAME "host"
  869. #define MQTT_TOPIC_DESCRIPTION "desc"
  870. #define MQTT_TOPIC_TIME "time"
  871. #define MQTT_TOPIC_RFOUT "rfout"
  872. #define MQTT_TOPIC_RFIN "rfin"
  873. #define MQTT_TOPIC_RFLEARN "rflearn"
  874. #define MQTT_TOPIC_RFRAW "rfraw"
  875. #define MQTT_TOPIC_UARTIN "uartin"
  876. #define MQTT_TOPIC_UARTOUT "uartout"
  877. #define MQTT_TOPIC_LOADAVG "loadavg"
  878. #define MQTT_TOPIC_BOARD "board"
  879. #define MQTT_TOPIC_PULSE "pulse"
  880. #define MQTT_TOPIC_SPEED "speed"
  881. #define MQTT_TOPIC_IRIN "irin"
  882. #define MQTT_TOPIC_IROUT "irout"
  883. #define MQTT_TOPIC_OTA "ota"
  884. #define MQTT_TOPIC_TELNET_REVERSE "telnet_reverse"
  885. // Light module
  886. #define MQTT_TOPIC_CHANNEL "channel"
  887. #define MQTT_TOPIC_COLOR_RGB "rgb"
  888. #define MQTT_TOPIC_COLOR_HSV "hsv"
  889. #define MQTT_TOPIC_ANIM_MODE "anim_mode"
  890. #define MQTT_TOPIC_ANIM_SPEED "anim_speed"
  891. #define MQTT_TOPIC_BRIGHTNESS "brightness"
  892. #define MQTT_TOPIC_MIRED "mired"
  893. #define MQTT_TOPIC_KELVIN "kelvin"
  894. #define MQTT_TOPIC_TRANSITION "transition"
  895. // Thermostat module
  896. #define MQTT_TOPIC_HOLD_TEMP "hold_temp"
  897. #define MQTT_TOPIC_HOLD_TEMP_MIN "min"
  898. #define MQTT_TOPIC_HOLD_TEMP_MAX "max"
  899. #define MQTT_TOPIC_REMOTE_TEMP "remote_temp"
  900. #define MQTT_TOPIC_ASK_TEMP_RANGE "ask_temp_range"
  901. #define MQTT_TOPIC_NOTIFY_TEMP_RANGE_MIN "notify_temp_range_min"
  902. #define MQTT_TOPIC_NOTIFY_TEMP_RANGE_MAX "notify_temp_range_max"
  903. #ifndef MQTT_STATUS_ONLINE
  904. #define MQTT_STATUS_ONLINE "1" // Value for the device ON message
  905. #endif
  906. #ifndef MQTT_STATUS_OFFLINE
  907. #define MQTT_STATUS_OFFLINE "0" // Value for the device OFF message (will)
  908. #endif
  909. #define MQTT_ACTION_RESET "reboot" // RESET MQTT topic particle
  910. // Custom get and set postfixes
  911. // Use something like "/status" or "/set", with leading slash
  912. // Since 1.9.0 the default value is "" for getter and "/set" for setter
  913. #ifndef MQTT_GETTER
  914. #define MQTT_GETTER ""
  915. #endif
  916. #ifndef MQTT_SETTER
  917. #define MQTT_SETTER "/set"
  918. #endif
  919. // -----------------------------------------------------------------------------
  920. // BROKER
  921. // -----------------------------------------------------------------------------
  922. #ifndef BROKER_SUPPORT
  923. #define BROKER_SUPPORT 1 // The broker is a poor-man's pubsub manager
  924. #endif
  925. // -----------------------------------------------------------------------------
  926. // SETTINGS
  927. // -----------------------------------------------------------------------------
  928. #ifndef SETTINGS_AUTOSAVE
  929. #define SETTINGS_AUTOSAVE 1 // Autosave settings or force manual commit
  930. #endif
  931. #define SETTINGS_MAX_LIST_COUNT 16 // Maximum index for settings lists
  932. // -----------------------------------------------------------------------------
  933. // LIGHT
  934. // -----------------------------------------------------------------------------
  935. // LIGHT_PROVIDER_DIMMER can have from 1 to 5 different channels.
  936. // They have to be defined for each device in the hardware.h file.
  937. // If 3 or more channels first 3 will be considered RGB.
  938. // Usual configurations are:
  939. // 1 channels => W
  940. // 2 channels => WW
  941. // 3 channels => RGB
  942. // 4 channels => RGBW
  943. // 5 channels => RGBWW
  944. #ifndef LIGHT_SAVE_ENABLED
  945. #define LIGHT_SAVE_ENABLED 1 // Light channel values saved by default after each change
  946. #endif
  947. #ifndef LIGHT_COMMS_DELAY
  948. #define LIGHT_COMMS_DELAY 100 // Delay communication after light update (in ms)
  949. #endif
  950. #ifndef LIGHT_SAVE_DELAY
  951. #define LIGHT_SAVE_DELAY 5 // Persist color after 5 seconds to avoid wearing out
  952. #endif
  953. #ifndef LIGHT_MIN_PWM
  954. #define LIGHT_MIN_PWM 0
  955. #endif
  956. #ifndef LIGHT_MAX_PWM
  957. #if LIGHT_PROVIDER == LIGHT_PROVIDER_MY92XX
  958. #define LIGHT_MAX_PWM 255
  959. #elif LIGHT_PROVIDER == LIGHT_PROVIDER_DIMMER
  960. #define LIGHT_MAX_PWM 10000 // 10000 * 200ns => 2 kHz
  961. #else
  962. #define LIGHT_MAX_PWM 0
  963. #endif
  964. #endif // LIGHT_MAX_PWM
  965. #ifndef LIGHT_LIMIT_PWM
  966. #define LIGHT_LIMIT_PWM LIGHT_MAX_PWM // Limit PWM to this value (prevent 100% power)
  967. #endif
  968. #ifndef LIGHT_MIN_VALUE
  969. #define LIGHT_MIN_VALUE 0 // Minimum light value
  970. #endif
  971. #ifndef LIGHT_MAX_VALUE
  972. #define LIGHT_MAX_VALUE 255 // Maximum light value
  973. #endif
  974. #ifndef LIGHT_MIN_BRIGHTNESS
  975. #define LIGHT_MIN_BRIGHTNESS 0 // Minimum brightness value
  976. #endif
  977. #ifndef LIGHT_MAX_BRIGHTNESS
  978. #define LIGHT_MAX_BRIGHTNESS 255 // Maximum brightness value
  979. #endif
  980. // Default mireds & kelvin to the Philips Hue limits
  981. // https://developers.meethue.com/documentation/core-concepts
  982. //
  983. // Home Assistant also uses these, see Light::min_mireds, Light::max_mireds
  984. // https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/__init__.py
  985. // Used when LIGHT_USE_WHITE AND LIGHT_USE_CCT is 1 - (1000000/Kelvin = MiReds)
  986. // Warning! Don't change this yet, NOT FULLY IMPLEMENTED!
  987. #ifndef LIGHT_COLDWHITE_MIRED
  988. #define LIGHT_COLDWHITE_MIRED 153 // Coldwhite Strip, Value must be __BELOW__ W2!! (Default: 6535 Kelvin/153 MiRed)
  989. #endif
  990. #ifndef LIGHT_WARMWHITE_MIRED
  991. #define LIGHT_WARMWHITE_MIRED 500 // Warmwhite Strip, Value must be __ABOVE__ W1!! (Default: 2000 Kelvin/500 MiRed)
  992. #endif
  993. #ifndef LIGHT_STEP
  994. #define LIGHT_STEP 32 // Step size
  995. #endif
  996. #ifndef LIGHT_USE_COLOR
  997. #define LIGHT_USE_COLOR 1 // Use 3 first channels as RGB
  998. #endif
  999. #ifndef LIGHT_USE_WHITE
  1000. #define LIGHT_USE_WHITE 0 // Use the 4th channel as (Warm-)White LEDs
  1001. #endif
  1002. #ifndef LIGHT_USE_CCT
  1003. #define LIGHT_USE_CCT 0 // Use the 5th channel as Coldwhite LEDs, LIGHT_USE_WHITE must be 1.
  1004. #endif
  1005. #ifndef LIGHT_USE_GAMMA
  1006. #define LIGHT_USE_GAMMA 0 // Use gamma correction for color channels
  1007. #endif
  1008. #ifndef LIGHT_USE_CSS
  1009. #define LIGHT_USE_CSS 1 // Use CSS style to report colors (1=> "#FF0000", 0=> "255,0,0")
  1010. #endif
  1011. #ifndef LIGHT_USE_RGB
  1012. #define LIGHT_USE_RGB 0 // Use RGB color selector (1=> RGB, 0=> HSV)
  1013. #endif
  1014. #ifndef LIGHT_WHITE_FACTOR
  1015. #define LIGHT_WHITE_FACTOR 1 // When using LIGHT_USE_WHITE with uneven brightness LEDs,
  1016. // this factor is used to scale the white channel to match brightness
  1017. #endif
  1018. #ifndef LIGHT_USE_TRANSITIONS
  1019. #define LIGHT_USE_TRANSITIONS 1 // Transitions between colors
  1020. #endif
  1021. #ifndef LIGHT_TRANSITION_STEP
  1022. #define LIGHT_TRANSITION_STEP 10 // Time in millis between each transtion step
  1023. #endif
  1024. #ifndef LIGHT_TRANSITION_TIME
  1025. #define LIGHT_TRANSITION_TIME 500 // Time in millis from color to color
  1026. #endif
  1027. // -----------------------------------------------------------------------------
  1028. // DOMOTICZ
  1029. // -----------------------------------------------------------------------------
  1030. #ifndef DOMOTICZ_SUPPORT
  1031. #define DOMOTICZ_SUPPORT MQTT_SUPPORT // Build with domoticz (if MQTT) support (1.72Kb)
  1032. #endif
  1033. #ifndef DOMOTICZ_ENABLED
  1034. #define DOMOTICZ_ENABLED 0 // Disable domoticz by default
  1035. #endif
  1036. #ifndef DOMOTICZ_IN_TOPIC
  1037. #define DOMOTICZ_IN_TOPIC "domoticz/in" // Default subscription topic
  1038. #endif
  1039. #ifndef DOMOTICZ_OUT_TOPIC
  1040. #define DOMOTICZ_OUT_TOPIC "domoticz/out" // Default publication topic
  1041. #endif
  1042. // -----------------------------------------------------------------------------
  1043. // HOME ASSISTANT
  1044. // -----------------------------------------------------------------------------
  1045. #ifndef HOMEASSISTANT_SUPPORT
  1046. #define HOMEASSISTANT_SUPPORT MQTT_SUPPORT // Build with home assistant support (if MQTT, 1.64Kb)
  1047. #endif
  1048. #ifndef HOMEASSISTANT_ENABLED
  1049. #define HOMEASSISTANT_ENABLED 0 // Integration not enabled by default
  1050. #endif
  1051. #ifndef HOMEASSISTANT_PREFIX
  1052. #define HOMEASSISTANT_PREFIX "homeassistant" // Default MQTT prefix
  1053. #endif
  1054. // -----------------------------------------------------------------------------
  1055. // INFLUXDB
  1056. // -----------------------------------------------------------------------------
  1057. #ifndef INFLUXDB_SUPPORT
  1058. #define INFLUXDB_SUPPORT 0 // Disable InfluxDB support by default (4.38Kb)
  1059. #endif
  1060. #ifndef INFLUXDB_ENABLED
  1061. #define INFLUXDB_ENABLED 0 // InfluxDB disabled by default
  1062. #endif
  1063. #ifndef INFLUXDB_HOST
  1064. #define INFLUXDB_HOST "" // Default server
  1065. #endif
  1066. #ifndef INFLUXDB_PORT
  1067. #define INFLUXDB_PORT 8086 // Default InfluxDB port
  1068. #endif
  1069. #ifndef INFLUXDB_DATABASE
  1070. #define INFLUXDB_DATABASE "" // Default database
  1071. #endif
  1072. #ifndef INFLUXDB_USERNAME
  1073. #define INFLUXDB_USERNAME "" // Default username
  1074. #endif
  1075. #ifndef INFLUXDB_PASSWORD
  1076. #define INFLUXDB_PASSWORD "" // Default password
  1077. #endif
  1078. // -----------------------------------------------------------------------------
  1079. // THINGSPEAK
  1080. // -----------------------------------------------------------------------------
  1081. #ifndef THINGSPEAK_SUPPORT
  1082. #define THINGSPEAK_SUPPORT 1 // Enable Thingspeak support by default (2.56Kb)
  1083. #endif
  1084. #ifndef THINGSPEAK_ENABLED
  1085. #define THINGSPEAK_ENABLED 0 // Thingspeak disabled by default
  1086. #endif
  1087. #ifndef THINGSPEAK_APIKEY
  1088. #define THINGSPEAK_APIKEY "" // Default API KEY
  1089. #endif
  1090. #ifndef THINGSPEAK_CLEAR_CACHE
  1091. #define THINGSPEAK_CLEAR_CACHE 1 // Clear cache after sending values
  1092. // Not clearing it will result in latest values for each field being sent every time
  1093. #endif
  1094. #ifndef THINGSPEAK_USE_ASYNC
  1095. #define THINGSPEAK_USE_ASYNC 1 // Use AsyncClient instead of WiFiClientSecure
  1096. #endif
  1097. // THINGSPEAK OVER SSL
  1098. // Using THINGSPEAK over SSL works well but generates problems with the web interface,
  1099. // so you should compile it with WEB_SUPPORT to 0.
  1100. // When THINGSPEAK_USE_ASYNC is 1, requires EspAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and ESP8266 Arduino Core >= 2.4.0.
  1101. // When THINGSPEAK_USE_ASYNC is 0, requires Arduino Core >= 2.6.0 and SECURE_CLIENT_BEARSSL
  1102. //
  1103. // WARNING: Thingspeak servers do not support MFLN right now, connection requires at least 30KB of free RAM.
  1104. // Also see MQTT comments above.
  1105. #ifndef THINGSPEAK_USE_SSL
  1106. #define THINGSPEAK_USE_SSL 0 // Use secure connection
  1107. #endif
  1108. #ifndef THINGSPEAK_SECURE_CLIENT_CHECK
  1109. #define THINGSPEAK_SECURE_CLIENT_CHECK SECURE_CLIENT_CHECK
  1110. #endif
  1111. #ifndef THINGSPEAK_SECURE_CLIENT_MFLN
  1112. #define THINGSPEAK_SECURE_CLIENT_MFLN SECURE_CLIENT_MFLN
  1113. #endif
  1114. #ifndef THINGSPEAK_FINGERPRINT
  1115. #define THINGSPEAK_FINGERPRINT "78 60 18 44 81 35 BF DF 77 84 D4 0A 22 0D 9B 4E 6C DC 57 2C"
  1116. #endif
  1117. #ifndef THINGSPEAK_ADDRESS
  1118. #if THINGSPEAK_USE_SSL
  1119. #define THINGSPEAK_ADDRESS "https://api.thingspeak.com/update"
  1120. #else
  1121. #define THINGSPEAK_ADDRESS "http://api.thingspeak.com/update"
  1122. #endif
  1123. #endif // ifndef THINGSPEAK_ADDRESS
  1124. #ifndef THINGSPEAK_TRIES
  1125. #define THINGSPEAK_TRIES 3 // Number of tries when sending data (minimum 1)
  1126. #endif
  1127. #define THINGSPEAK_MIN_INTERVAL 15000 // Minimum interval between POSTs (in millis)
  1128. #define THINGSPEAK_FIELDS 8 // Number of fields
  1129. // -----------------------------------------------------------------------------
  1130. // SCHEDULER
  1131. // -----------------------------------------------------------------------------
  1132. #ifndef SCHEDULER_SUPPORT
  1133. #define SCHEDULER_SUPPORT 1 // Enable scheduler (2.45Kb)
  1134. #endif
  1135. #ifndef SCHEDULER_MAX_SCHEDULES
  1136. #define SCHEDULER_MAX_SCHEDULES 10 // Max schedules alowed
  1137. #endif
  1138. #ifndef SCHEDULER_RESTORE_LAST_SCHEDULE
  1139. #define SCHEDULER_RESTORE_LAST_SCHEDULE 0 // Restore the last schedule state on the device boot
  1140. #endif
  1141. #ifndef SCHEDULER_WEEKDAYS
  1142. #define SCHEDULER_WEEKDAYS "1,2,3,4,5,6,7" // (Default - Run the schedules every day)
  1143. #endif
  1144. // -----------------------------------------------------------------------------
  1145. // RPN RULES
  1146. // -----------------------------------------------------------------------------
  1147. #ifndef RPN_RULES_SUPPORT
  1148. #define RPN_RULES_SUPPORT 0 // Enable RPN Rules (8.6Kb)
  1149. #endif
  1150. #ifndef RPN_DELAY
  1151. #define RPN_DELAY 100 // Execute rules after 100ms without messages
  1152. #endif
  1153. #ifndef RPN_STICKY
  1154. #define RPN_STICKY 1 // Keeps variable after rule execution
  1155. #endif
  1156. // -----------------------------------------------------------------------------
  1157. // NTP
  1158. // -----------------------------------------------------------------------------
  1159. #ifndef NTP_SUPPORT
  1160. #define NTP_SUPPORT 1 // Build with NTP support by default (depends on Core version)
  1161. #endif
  1162. #ifndef NTP_SERVER
  1163. #define NTP_SERVER "pool.ntp.org" // Default NTP server
  1164. #endif
  1165. #ifndef NTP_TIMEZONE
  1166. #define NTP_TIMEZONE TZ_Etc_UTC // POSIX TZ variable. Default to UTC from TZ.h (which is PSTR("UTC0"))
  1167. // For the format documentation, see:
  1168. // - https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
  1169. // ESP8266 Core provides human-readable aliases for POSIX format, see:
  1170. // - Latest: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/TZ.h
  1171. // - PlatformIO: ~/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/TZ.h
  1172. // (or, possibly, c:\.platformio\... on Windows)
  1173. // - Arduino IDE: depends on platform, see `/dist/arduino_ide/README.md`
  1174. #endif
  1175. #ifndef NTP_UPDATE_INTERVAL
  1176. #define NTP_UPDATE_INTERVAL 1800 // NTP check every 30 minutes
  1177. #endif
  1178. #ifndef NTP_START_DELAY
  1179. #define NTP_START_DELAY 3 // Delay NTP start for 3 seconds
  1180. #endif
  1181. #ifndef NTP_WAIT_FOR_SYNC
  1182. #define NTP_WAIT_FOR_SYNC 1 // Do not report any datetime until NTP sync'ed
  1183. #endif
  1184. // WARNING: legacy NTP settings. can be ignored with Core 2.6.2+
  1185. #ifndef NTP_TIMEOUT
  1186. #define NTP_TIMEOUT 1000 // Set NTP request timeout to 2 seconds (issue #452)
  1187. #endif
  1188. #ifndef NTP_TIME_OFFSET
  1189. #define NTP_TIME_OFFSET 60 // Default timezone offset (GMT+1)
  1190. #endif
  1191. #ifndef NTP_DAY_LIGHT
  1192. #define NTP_DAY_LIGHT 1 // Enable daylight time saving by default
  1193. #endif
  1194. #ifndef NTP_SYNC_INTERVAL
  1195. #define NTP_SYNC_INTERVAL 60 // NTP initial check every minute
  1196. #endif
  1197. #ifndef NTP_DST_REGION
  1198. #define NTP_DST_REGION 0 // 0 for Europe, 1 for USA (defined in NtpClientLib)
  1199. #endif
  1200. // -----------------------------------------------------------------------------
  1201. // ALEXA
  1202. // -----------------------------------------------------------------------------
  1203. // This setting defines whether Alexa support should be built into the firmware
  1204. #ifndef ALEXA_SUPPORT
  1205. #define ALEXA_SUPPORT 1 // Enable Alexa support by default (10.84Kb)
  1206. #endif
  1207. // This is default value for the alexaEnabled setting that defines whether
  1208. // this device should be discoberable and respond to Alexa commands.
  1209. // Both ALEXA_SUPPORT and alexaEnabled should be 1 for Alexa support to work.
  1210. #ifndef ALEXA_ENABLED
  1211. #define ALEXA_ENABLED 1
  1212. #endif
  1213. #ifndef ALEXA_HOSTNAME
  1214. #define ALEXA_HOSTNAME ""
  1215. #endif
  1216. // -----------------------------------------------------------------------------
  1217. // MQTT RF BRIDGE
  1218. // -----------------------------------------------------------------------------
  1219. #ifndef RF_SUPPORT
  1220. #define RF_SUPPORT 0
  1221. #endif
  1222. #ifndef RF_DEBOUNCE
  1223. #define RF_DEBOUNCE 500
  1224. #endif
  1225. #ifndef RF_LEARN_TIMEOUT
  1226. #define RF_LEARN_TIMEOUT 60000
  1227. #endif
  1228. #ifndef RF_SEND_TIMES
  1229. #define RF_SEND_TIMES 4 // How many times to send the message
  1230. #endif
  1231. #ifndef RF_SEND_DELAY
  1232. #define RF_SEND_DELAY 500 // Interval between sendings in ms
  1233. #endif
  1234. #ifndef RF_RECEIVE_DELAY
  1235. #define RF_RECEIVE_DELAY 500 // Interval between recieving in ms (avoid debouncing)
  1236. #endif
  1237. // Enable RCSwitch support
  1238. // Originally implemented for SONOFF BASIC
  1239. // https://tinkerman.cat/adding-rf-to-a-non-rf-itead-sonoff/
  1240. // Also possible to use with SONOFF RF BRIDGE, thanks to @wildwiz
  1241. // https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
  1242. #ifndef RFB_DIRECT
  1243. #define RFB_DIRECT 0
  1244. #endif
  1245. #ifndef RFB_RX_PIN
  1246. #define RFB_RX_PIN GPIO_NONE
  1247. #endif
  1248. #ifndef RFB_TX_PIN
  1249. #define RFB_TX_PIN GPIO_NONE
  1250. #endif
  1251. // -----------------------------------------------------------------------------
  1252. // IR Bridge
  1253. // -----------------------------------------------------------------------------
  1254. #ifndef IR_SUPPORT
  1255. #define IR_SUPPORT 0 // Do not build with IR support by default (10.25Kb)
  1256. #endif
  1257. //#define IR_RX_PIN 5 // GPIO the receiver is connected to
  1258. //#define IR_TX_PIN 4 // GPIO the transmitter is connected to
  1259. #ifndef IR_USE_RAW
  1260. #define IR_USE_RAW 0 // Use raw codes
  1261. #endif
  1262. #ifndef IR_BUFFER_SIZE
  1263. #define IR_BUFFER_SIZE 1024
  1264. #endif
  1265. #ifndef IR_TIMEOUT
  1266. #define IR_TIMEOUT 15U
  1267. #endif
  1268. #ifndef IR_REPEAT
  1269. #define IR_REPEAT 1
  1270. #endif
  1271. #ifndef IR_DELAY
  1272. #define IR_DELAY 100
  1273. #endif
  1274. #ifndef IR_DEBOUNCE
  1275. #define IR_DEBOUNCE 500 // IR debounce time in milliseconds
  1276. #endif
  1277. #ifndef IR_BUTTON_SET
  1278. #define IR_BUTTON_SET 0 // IR button set to use (see ../ir_button.h)
  1279. #endif
  1280. //--------------------------------------------------------------------------------
  1281. // Custom RFM69 to MQTT bridge
  1282. // Check http://tinkerman.cat/rfm69-wifi-gateway/
  1283. // Enable support by passing RFM69_SUPPORT=1 build flag
  1284. //--------------------------------------------------------------------------------
  1285. #ifndef RFM69_SUPPORT
  1286. #define RFM69_SUPPORT 0
  1287. #endif
  1288. #ifndef RFM69_MAX_TOPICS
  1289. #define RFM69_MAX_TOPICS 50
  1290. #endif
  1291. #ifndef RFM69_MAX_NODES
  1292. #define RFM69_MAX_NODES 255
  1293. #endif
  1294. #ifndef RFM69_DEFAULT_TOPIC
  1295. #define RFM69_DEFAULT_TOPIC "/rfm69gw/{node}/{key}"
  1296. #endif
  1297. #ifndef RFM69_NODE_ID
  1298. #define RFM69_NODE_ID 1
  1299. #endif
  1300. #ifndef RFM69_GATEWAY_ID
  1301. #define RFM69_GATEWAY_ID 1
  1302. #endif
  1303. #ifndef RFM69_NETWORK_ID
  1304. #define RFM69_NETWORK_ID 164
  1305. #endif
  1306. #ifndef RFM69_PROMISCUOUS
  1307. #define RFM69_PROMISCUOUS 0
  1308. #endif
  1309. #ifndef RFM69_PROMISCUOUS_SENDS
  1310. #define RFM69_PROMISCUOUS_SENDS 0
  1311. #endif
  1312. #ifndef RFM69_FREQUENCY
  1313. #define RFM69_FREQUENCY RF69_868MHZ
  1314. #endif
  1315. #ifndef RFM69_ENCRYPTKEY
  1316. #define RFM69_ENCRYPTKEY "fibonacci0123456"
  1317. #endif
  1318. #ifndef RFM69_CS_PIN
  1319. #define RFM69_CS_PIN SS
  1320. #endif
  1321. #ifndef RFM69_IRQ_PIN
  1322. #define RFM69_IRQ_PIN 5
  1323. #endif
  1324. #ifndef RFM69_RESET_PIN
  1325. #define RFM69_RESET_PIN 7
  1326. #endif
  1327. #ifndef RFM69_IS_RFM69HW
  1328. #define RFM69_IS_RFM69HW 0
  1329. #endif
  1330. //--------------------------------------------------------------------------------
  1331. // TUYA switch & dimmer support
  1332. //--------------------------------------------------------------------------------
  1333. #ifndef TUYA_SUPPORT
  1334. #define TUYA_SUPPORT 0
  1335. #endif
  1336. #ifndef TUYA_SERIAL
  1337. #define TUYA_SERIAL Serial
  1338. #endif
  1339. // =============================================================================
  1340. // Configuration helpers
  1341. // =============================================================================
  1342. //------------------------------------------------------------------------------
  1343. // Provide generic way to detect debugging support
  1344. //------------------------------------------------------------------------------
  1345. #ifndef DEBUG_SUPPORT
  1346. #define DEBUG_SUPPORT ( \
  1347. DEBUG_SERIAL_SUPPORT || \
  1348. DEBUG_UDP_SUPPORT || \
  1349. DEBUG_TELNET_SUPPORT || \
  1350. DEBUG_WEB_SUPPORT \
  1351. )
  1352. #endif