MySensors Library & Examples  2.3.2-91-gc4565708
MyConfig.h
Go to the documentation of this file.
1 /*
2  * The MySensors Arduino library handles the wireless radio link and protocol
3  * between your home built sensors/actuators and HA controller of choice.
4  * The sensors forms a self healing radio network with optional repeaters. Each
5  * repeater and gateway builds a routing tables in RAM or EEPROM which keeps track of the
6  * network topology allowing messages to be routed to nodes.
7  *
8  * Created by Henrik Ekblad <[email protected]>
9  * Copyright (C) 2013-2026 Sensnology AB
10  * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11  *
12  * Documentation: http://www.mysensors.org
13  * Support Forum: http://forum.mysensors.org
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * version 2 as published by the Free Software Foundation.
18  */
19 
28 #ifndef MyConfig_h
29 #define MyConfig_h
30 
48 //#define MY_DEBUG
49 
64 //#define MY_DEBUGDEVICE
65 
86 //#define MY_DEBUG_OTA (0)
87 
97 //#define MY_DEBUG_OTA_DISABLE_ECHO
98 #if defined(MY_DEBUG_OTA_DISABLE_ACK) && !defined(DOXYGEN)
99 #warning MY_DEBUG_OTA_DISABLE_ACK is deprecated, please use MY_DEBUG_OTA_DISABLE_ECHO instead
100 #define MY_DEBUG_OTA_DISABLE_ECHO
101 #endif
102 
110 //#define MY_OTA_LOG_RECEIVER_FEATURE
111 
119 //#define MY_OTA_LOG_SENDER_FEATURE
120 
134 //#define MY_SPECIAL_DEBUG
135 
141 //#define MY_DIAGNOSTICS
142 
150 //#define MY_DIAGNOSTICS
151 
159 //#define MY_DISABLED_SERIAL
160 
168 //#define MY_SPLASH_SCREEN_DISABLED
169 
178 #ifndef MY_BAUD_RATE
179 #define MY_BAUD_RATE (115200ul)
180 #endif
181 
188 #ifndef MY_SERIAL_OUTPUT_SIZE
189 #define MY_SERIAL_OUTPUT_SIZE (120u)
190 #endif
191  // End of SerialDebugGrpPub group
192 
197 //#define MY_DEBUG_VERBOSE_OTA_UPDATE
198 
206 //#define MY_OTA_USE_I2C_EEPROM
207 
208 #ifdef MY_OTA_USE_I2C_EEPROM
209 // I2C address of EEPROM. Wire will shift this left, i.e. 0x50->0xA0
210 #ifndef MY_OTA_I2C_ADDR
211 #define MY_OTA_I2C_ADDR 0x50
212 #endif
213 #endif
214 
215 
234 //#define MY_PJON
235 
240 #ifndef MY_PJON_PIN
241 #define MY_PJON_PIN (12u)
242 #endif
243 
248 //#define MY_DEBUG_VERBOSE_PJON
249 
254 #ifndef MY_PJON_MAX_RETRIES
255 #define MY_PJON_MAX_RETRIES (5u)
256 #endif
257 
258 #ifdef MY_PJON
259 
260 #ifndef PJON_STRATEGY_ALL
261 #define PJON_STRATEGY_BITBANG
262 #endif
263 
264 #define PJON_NOT_ASSIGNED (253u)
265 #define PJON_BROADCAST (255u)
266 
267 #define SWBB_MAX_ATTEMPTS (50u)
268 #define PJON_INCLUDE_SWBB
269 #endif
270  // End of PJONSettingGrpPub group
272 
284 //#define MY_RS485
285 
290 #ifndef MY_RS485_BAUD_RATE
291 #define MY_RS485_BAUD_RATE (9600)
292 #endif
293 
298 #ifndef MY_RS485_MAX_MESSAGE_LENGTH
299 #define MY_RS485_MAX_MESSAGE_LENGTH (40)
300 #endif
301 
306 #ifndef MY_RS485_SOH_COUNT
307 #define MY_RS485_SOH_COUNT (1)
308 #endif
309 
310 
315 //#define MY_RS485_DE_PIN (2)
316 
321 //#define MY_RS485_DE_INVERSE
322 
329 //#define MY_RS485_HWSERIAL (Serial1) // End of RS485SettingGrpPub group
331 
352 // legacy - remove for 3.0.0
358 #ifdef MY_RADIO_NRF24
359 #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead.
360 #undef MY_RADIO_NRF24
361 #define MY_RADIO_RF24
362 #endif
363 
368 //#define MY_RADIO_RF24
369 
380 //#define MY_RF24_ENABLE_ENCRYPTION
381 
386 //#define MY_DEBUG_VERBOSE_RF24
387 
394 #ifndef MY_RF24_SPI_SPEED
395 #define MY_RF24_SPI_SPEED (2*1000000ul)
396 #endif
397 
402 #ifndef MY_RF24_CE_PIN
403 #define MY_RF24_CE_PIN (DEFAULT_RF24_CE_PIN)
404 #endif
405 
410 #ifndef MY_RF24_CS_PIN
411 #define MY_RF24_CS_PIN (DEFAULT_RF24_CS_PIN)
412 #endif
413 
418 //#define MY_RF24_IRQ_PIN (2)
419 
424 //#define MY_RF24_POWER_PIN (3)
425 
437 //#define MY_RX_MESSAGE_BUFFER_FEATURE
438 
445 #ifdef MY_RX_MESSAGE_BUFFER_FEATURE
446 #ifndef MY_RX_MESSAGE_BUFFER_SIZE
447 #define MY_RX_MESSAGE_BUFFER_SIZE (20)
448 #endif
449 #endif
450 
460 #ifndef MY_RF24_PA_LEVEL
461 #define MY_RF24_PA_LEVEL (RF24_PA_HIGH)
462 #endif
463 
484 #ifndef MY_RF24_CHANNEL
485 #define MY_RF24_CHANNEL (76)
486 #endif
487 
499 #ifndef MY_RF24_DATARATE
500 #define MY_RF24_DATARATE (RF24_250KBPS)
501 #endif
502 
510 #ifndef MY_RF24_BASE_RADIO_ID
511 #define MY_RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8
512 #endif
513 
518 #ifndef MY_RF24_ADDR_WIDTH
519 #define MY_RF24_ADDR_WIDTH (5)
520 #endif
521  // End of RF24SettingGrpPub group
522 
544 //#define MY_RADIO_NRF5_ESB
545 
556 //#define MY_NRF5_ESB_ENABLE_ENCRYPTION
557 
562 //#define MY_DEBUG_VERBOSE_NRF5_ESB
563 
573 #ifndef MY_NRF5_ESB_PA_LEVEL
574 #define MY_NRF5_ESB_PA_LEVEL (NRF5_PA_MAX)
575 #endif
576 
597 #ifndef MY_NRF5_ESB_CHANNEL
598 #define MY_NRF5_ESB_CHANNEL (76)
599 #endif
600 
610 #ifndef MY_NRF5_ESB_MODE
611 #ifdef RADIO_MODE_MODE_Nrf_250Kbit
612 #define MY_NRF5_ESB_MODE (NRF5_250KBPS)
613 #else
614 #define MY_NRF5_ESB_MODE (NRF5_1MBPS)
615 #endif
616 #endif
617 
625 #ifndef MY_NRF5_ESB_BASE_RADIO_ID
626 #define MY_NRF5_ESB_BASE_RADIO_ID 0x00, 0xFC, 0xE1, 0xA8, 0xA8
627 #endif
628 
633 #ifndef MY_NRF5_ESB_ADDR_WIDTH
634 #define MY_NRF5_ESB_ADDR_WIDTH (5)
635 #endif
636 
641 #ifndef MY_NRF5_ESB_RX_BUFFER_SIZE
642 #define MY_NRF5_ESB_RX_BUFFER_SIZE (20)
643 #endif
644 
649 //#define MY_NRF5_ESB_REVERSE_ACK_TX
650 
655 //#define MY_NRF5_ESB_REVERSE_ACK_RX // End of NRF5SettingGrpPub group
657 
674 //#define MY_RADIO_RFM69
675 
680 //#define MY_DEBUG_VERBOSE_RFM69
681 
686 //#define MY_DEBUG_VERBOSE_RFM69_REGISTERS
687 
694 //#define MY_RFM69_NEW_DRIVER
695 
711 #ifndef MY_RFM69_FREQUENCY
712 #define MY_RFM69_FREQUENCY (RFM69_868MHZ)
713 #endif
714 
719 //#define MY_IS_RFM69HW
720 
727 #ifdef MY_IS_RFM69HW
728 #define MY_RFM69HW true
729 #else
730 #define MY_RFM69HW false
731 #endif
732 
737 #ifndef MY_RFM69_TX_POWER_DBM
738 #define MY_RFM69_TX_POWER_DBM (5)
739 #endif
740 
745 #ifndef MY_RFM69_ATC_TARGET_RSSI_DBM
746 #define MY_RFM69_ATC_TARGET_RSSI_DBM (-80)
747 #endif
748 
753 //#define MY_RFM69_ATC_MODE_DISABLED
754 
766 //#define MY_RFM69_MAX_POWER_LEVEL_DBM (10u)
767 
772 #ifndef MY_RFM69_NETWORKID
773 #define MY_RFM69_NETWORKID (100)
774 #endif
775 
780 //#define MY_RFM69_RST_PIN (9)
781 
782 #ifdef MY_RF69_RESET
783 #warning MY_RF69_RESET is depreciated, please use MY_RFM69_RST_PIN instead.
784 #define MY_RFM69_RST_PIN MY_RF69_RESET
785 #endif
786 
791 //#define MY_RFM69_POWER_PIN (3)
792 
797 #ifndef MY_RFM69_IRQ_PIN
798 #ifdef MY_RF69_IRQ_PIN
799 #warning MY_RF69_IRQ_PIN is depreciated, please use MY_RFM69_IRQ_PIN instead.
800 #define MY_RFM69_IRQ_PIN MY_RF69_IRQ_PIN
801 #else
802 #define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN
803 #endif
804 #endif
805 
810 #ifndef MY_RFM69_IRQ_NUM
811 #ifdef MY_RF69_IRQ_NUM
812 #warning MY_RF69_IRQ_NUM is depreciated, please use MY_RFM69_IRQ_NUM instead.
813 #define MY_RFM69_IRQ_NUM MY_RF69_IRQ_NUM
814 #else
815 #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
816 #endif
817 #endif
818 
823 #ifndef MY_RFM69_CS_PIN
824 #ifdef MY_RF69_SPI_CS
825 #warning MY_RF69_SPI_CS is depreciated, please use MY_RFM69_CS_PIN instead.
826 #define MY_RFM69_CS_PIN MY_RF69_SPI_CS
827 #else
828 #define MY_RFM69_CS_PIN DEFAULT_RFM69_CS_PIN
829 #endif
830 #endif
831 
836 #ifndef MY_RFM69_SPI_SPEED
837 #define MY_RFM69_SPI_SPEED (4*1000000ul) // datasheet says 10Mhz max.
838 #endif
839 
848 //#define MY_RFM69_ENABLE_ENCRYPTION
849 
870 //#define MY_RFM69_MODEM_CONFIGURATION (RFM69_FSK_BR55_5_FD50)
871 
872  // End of RFM69SettingGrpPub group
874 
889 //#define MY_RADIO_RFM95
890 
895 //#define MY_DEBUG_VERBOSE_RFM95
896 
907 //#define MY_RFM95_ENABLE_ENCRYPTION
908 
923 #ifndef MY_RFM95_FREQUENCY
924 #define MY_RFM95_FREQUENCY (RFM95_868MHZ)
925 #endif
926 
943 #ifndef MY_RFM95_MODEM_CONFIGRUATION
944 #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128
945 #endif
946 
951 //#define MY_RFM95_RST_PIN (9)
952 
957 //#define MY_RFM95_POWER_PIN (3)
958 
963 #ifndef MY_RFM95_IRQ_PIN
964 #define MY_RFM95_IRQ_PIN DEFAULT_RFM95_IRQ_PIN
965 #endif
966 
971 #ifndef MY_RFM95_IRQ_NUM
972 #define MY_RFM95_IRQ_NUM digitalPinToInterrupt(MY_RFM95_IRQ_PIN)
973 #endif
974 
979 #ifndef MY_RFM95_CS_PIN
980 #define MY_RFM95_CS_PIN DEFAULT_RFM95_CS_PIN
981 #endif
982 
987 #ifndef MY_RFM95_SPI_SPEED
988 #define MY_RFM95_SPI_SPEED (4*1000000ul)
989 #endif
990 
997 #ifndef MY_RFM95_TX_POWER_DBM
998 #define MY_RFM95_TX_POWER_DBM (13u) // 20mW
999 #endif
1000 
1005 //#define MY_RFM95_ATC_MODE_DISABLED
1006 
1011 #ifndef MY_RFM95_ATC_TARGET_RSSI
1012 #define MY_RFM95_ATC_TARGET_RSSI (-70)
1013 #endif
1014 
1026 //#define MY_RFM95_MAX_POWER_LEVEL_DBM (10u)
1027 
1034 //#define MY_RFM95_TCXO // End of RFM95SettingGrpPub group
1036 
1052 //#define MY_RADIO_SX126x
1053 
1058 #ifndef MY_SX126x_CS_PIN
1059 #define MY_SX126x_CS_PIN DEFAULT_SX126x_CS_PIN
1060 #endif
1061 
1066 #ifndef MY_SX126x_IRQ_PIN
1067 #define MY_SX126x_IRQ_PIN DEFAULT_SX126x_IRQ_PIN
1068 #endif
1069 
1084 #ifndef MY_SX126x_FREQUENCY
1085 #define MY_SX126x_FREQUENCY (SX126x_868MHZ)
1086 #endif
1087 
1097 #ifndef MY_SX126x_LORA_SF
1098 #define MY_SX126x_LORA_SF LORA_SF7
1099 #endif
1100 
1121 #ifndef MY_SX126x_LORA_BW
1122 #define MY_SX126x_LORA_BW LORA_BW_125
1123 #endif
1124 
1139 #ifndef MY_SX126x_LORA_CR
1140 #define MY_SX126x_LORA_CR LORA_CR_4_5
1141 #endif
1142 
1160 //#define MY_SX126x_TCXO_VOLTAGE (SX126x_TCXO_3V3)
1161 
1162 
1170 #if !defined(MY_SX126c_TCXO_STARTUP_DELAY) && defined(MY_SX126x_TCXO_VOLTAGE)
1171 #define MY_SX126c_TCXO_STARTUP_DELAY (10)
1172 #endif
1173 
1180 #if !defined(MY_SX126x_USE_TCXO) && defined(MY_SX126x_TCXO_VOLTAGE)
1181 #define MY_SX126x_USE_TCXO
1182 #endif
1183 
1188 //#define MY_SX126x_USE_DIO2_ANT_SWITCH
1189 
1197 //#define MY_SX126x_ANT_SWITCH_PIN (GPIO3)
1198 
1207 #if !defined(MY_SX126x_VARIANT)
1208 #define MY_SX126x_VARIANT (1)
1209 #endif
1210 
1215 //#define MY_SX126x_POWER_PIN (3)
1216 
1221 //#define MY_SX126x_RESET_PIN (47)
1222 
1227 //#define MY_SX126x_BUSY_PIN (39)
1228 
1233 //#define MY_SX126x_DISABLE_ATC
1234 
1239 #ifndef MY_SX126x_ATC_TARGET_DBM
1240 #define MY_SX126x_ATC_TARGET_DBM (-70)
1241 #endif
1242 
1249 #ifndef MY_SX126x_MAX_POWER_LEVEL_DBM
1250 #define MY_SX126x_MAX_POWER_LEVEL_DBM (20)
1251 #endif
1252 
1257 #ifndef MY_SX126x_MIN_POWER_LEVEL_DBM
1258 #define MY_SX126x_MIN_POWER_LEVEL_DBM (-3)
1259 #endif
1260  // End of SX126xSettingGrpPub group
1262 
1280 //#define MY_SOFTSPI
1281 
1286 #ifndef MY_SOFT_SPI_SCK_PIN
1287 #define MY_SOFT_SPI_SCK_PIN (14)
1288 #endif
1289 
1294 #ifndef MY_SOFT_SPI_MISO_PIN
1295 #define MY_SOFT_SPI_MISO_PIN (16)
1296 #endif
1297 
1302 #ifndef MY_SOFT_SPI_MOSI_PIN
1303 #define MY_SOFT_SPI_MOSI_PIN (15)
1304 #endif
1305  // End of SoftSpiSettingGrpPub group
1306  // End of TransportSettingGrpPub group
1308 
1329 #ifndef MY_DISABLE_RAM_ROUTING_TABLE_FEATURE
1330 #define MY_RAM_ROUTING_TABLE_FEATURE
1331 #endif
1332 
1337 #ifndef MY_ROUTING_TABLE_SAVE_INTERVAL_MS
1338 #define MY_ROUTING_TABLE_SAVE_INTERVAL_MS (30*60*1000ul)
1339 #endif
1340 
1347 //#define MY_REPEATER_FEATURE
1348 
1358 //#define MY_PASSIVE_NODE
1359 
1364 #ifndef MY_NODE_ID
1365 #define MY_NODE_ID (AUTO)
1366 #endif
1367 
1372 #ifndef MY_PARENT_NODE_ID
1373 #define MY_PARENT_NODE_ID (AUTO)
1374 #endif
1375 
1380 //#define MY_PARENT_NODE_IS_STATIC
1381 
1388 //#define MY_TRANSPORT_SANITY_CHECK
1389 
1394 #ifndef MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS
1395 #define MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS (15*60*1000ul)
1396 #endif
1397 
1401 #ifndef MY_TRANSPORT_DISCOVERY_INTERVAL_MS
1402 #define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul)
1403 #endif
1404 
1409 //#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
1410 
1415 //#define MY_TRANSPORT_MAX_TX_FAILURES (10u)
1416 
1421 #ifndef MY_TRANSPORT_WAIT_READY_MS
1422 #define MY_TRANSPORT_WAIT_READY_MS (0)
1423 #endif
1424 
1430 //#define MY_SIGNAL_REPORT_ENABLED
1431  // End of RoutingNodeSettingGrpPub group
1433 
1446 #define MY_REGISTRATION_FEATURE
1447 
1453 #ifndef MY_REGISTRATION_RETRIES
1454 #define MY_REGISTRATION_RETRIES (3u)
1455 #endif
1456 
1462 #define MY_REGISTRATION_DEFAULT (true)
1463 
1468 //#define MY_REGISTRATION_CONTROLLER // End of RegistrationSettingGrpPub group
1470 
1481 //#define MY_CORE_ONLY
1482 
1488 #define MY_CORE_COMPATIBILITY_CHECK
1489  // End of CoreSettingGrpPub group
1490 
1501 #ifndef MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS
1502 #define MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS (10*1000ul)
1503 #endif
1504 
1512 #ifndef MY_SMART_SLEEP_WAIT_DURATION_MS
1513 #define MY_SMART_SLEEP_WAIT_DURATION_MS (500ul)
1514 #endif
1515 
1524 //#define MY_SLEEP_HANDLER // End of SleepSettingGrpPub group
1526 
1542 //#define MY_OTA_FIRMWARE_FEATURE
1543 
1548 #ifndef MY_OTA_FLASH_SS
1549 #define MY_OTA_FLASH_SS (8)
1550 #endif
1551 
1556 #ifndef MY_OTA_FLASH_JDECID
1557 #define MY_OTA_FLASH_JDECID (0x1F65)
1558 #endif
1559 
1564 //#define MY_DISABLE_REMOTE_RESET // End of OTASettingGrpPub group
1566 
1577 #ifndef MY_GATEWAY_MAX_RECEIVE_LENGTH
1578 #define MY_GATEWAY_MAX_RECEIVE_LENGTH (100u)
1579 #endif
1580 
1585 #ifndef MY_GATEWAY_MAX_SEND_LENGTH
1586 #define MY_GATEWAY_MAX_SEND_LENGTH (120u)
1587 #endif
1588 
1593 #ifndef MY_GATEWAY_MAX_CLIENTS
1594 #define MY_GATEWAY_MAX_CLIENTS (1u)
1595 #endif
1596 
1601 //#define MY_INCLUSION_MODE_FEATURE
1602 
1609 //#define MY_INCLUSION_BUTTON_FEATURE
1610 
1611 // Disable inclusion mode button if inclusion mode feature is not enabled
1612 #ifndef MY_INCLUSION_MODE_FEATURE
1613 #undef MY_INCLUSION_BUTTON_FEATURE
1614 #endif
1615 
1623 //#define MY_INCLUSION_LED_PIN (7)
1624 
1629 #ifndef MY_INCLUSION_MODE_BUTTON_PIN
1630 #if defined(ARDUINO_ARCH_ESP8266)
1631 #define MY_INCLUSION_MODE_BUTTON_PIN (5)
1632 #else
1633 #define MY_INCLUSION_MODE_BUTTON_PIN (3)
1634 #endif
1635 #endif
1636 
1641 #ifndef MY_INCLUSION_MODE_DURATION
1642 #define MY_INCLUSION_MODE_DURATION (60)
1643 #endif
1644 
1655 #if defined(MY_INCLUSION_BUTTON_EXTERNAL_PULLUP)
1656 #define MY_INCLUSION_BUTTON_PRESSED (HIGH)
1657 #else
1658 #define MY_INCLUSION_BUTTON_PRESSED (LOW)
1659 #endif
1660 
1661 /**************************************
1662 * Ethernet Gateway Transport Defaults
1663 ***************************************/
1684 // The gateway options available
1685 //#define MY_GATEWAY_W5100
1686 //#define MY_GATEWAY_ENC28J60
1687 //#define MY_GATEWAY_ESP8266
1688 //#define MY_GATEWAY_ESP8266_SECURE
1689 //#define MY_GATEWAY_ESP32
1690 //#define MY_GATEWAY_LINUX
1691 //#define MY_GATEWAY_TINYGSM
1692 //#define MY_GATEWAY_MQTT_CLIENT
1693 //#define MY_GATEWAY_SERIAL
1694 
1695 
1700 //#define MY_DEBUG_VERBOSE_GATEWAY
1701 
1706 //#define MY_WIFI_SSID "MySSID"
1707 
1712 #ifndef MY_WIFI_BSSID
1713 #define MY_WIFI_BSSID NULL
1714 #endif
1715 
1720 //#define MY_WIFI_PASSWORD "MyVerySecretPassword"
1721 
1726 #ifndef MY_HOSTNAME
1727 #define MY_HOSTNAME "MYSENSORS_DEVICE"
1728 #endif
1729 
1734 #ifndef MY_PORT
1735 #ifdef MY_GATEWAY_MQTT_CLIENT
1736 #define MY_PORT 1883
1737 #else
1738 #define MY_PORT 5003
1739 #endif
1740 #endif
1741 
1746 //#define MY_MQTT_CLIENT_PUBLISH_RETAIN
1747 
1756 //#define MY_MQTT_PASSWORD "secretpassword"
1757 
1766 //#define MY_MQTT_USER "username"
1767 
1775 //#define MY_MQTT_CLIENT_ID "mysensors-1"
1776 
1784 //#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
1785 
1793 //#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
1794 
1830 //#define MY_MQTT_CA_CERT1
1831 
1836 //#define MY_MQTT_CA_CERT2
1837 
1842 //#define MY_MQTT_CA_CERT3
1843 
1844 
1862 //#define MY_MQTT_FINGERPRINT
1863 
1881 //#define MY_MQTT_CLIENT_CERT
1882 
1900 //#define MY_MQTT_CLIENT_KEY
1901 
1908 //#define MY_IP_ADDRESS 192,168,178,66
1909 
1916 //#define MY_IP_GATEWAY_ADDRESS 192,168,1,1
1917 
1924 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
1925 
1931 //#define MY_USE_UDP
1932 
1938 #ifndef MY_MAC_ADDRESS
1939 #define MY_MAC_ADDRESS 0xDE,0xAD,0xBE,0xEF,0xFE,0xED
1940 #endif
1941 
1952 //#define MY_CONTROLLER_IP_ADDRESS 192,168,178,254
1953 
1964 //#define MY_CONTROLLER_URL_ADDRESS "test.mosquitto.org"
1965  // End of GatewaySettingGrpPub group
1967 
1978 //#define MY_GSM_APN
1983 //#define MY_GSM_BAUDRATE (9600u)
1988 //#define MY_GSM_PIN
1993 //#define MY_GSM_PSW
1998 //#define MY_GSM_RX
2003 //#define MY_GSM_SSID
2008 //#define MY_GSM_TX
2013 //#define MY_GSM_USR
2014  // End of GSMSettingGrpPub group
2016 
2031 //#define MY_DEFAULT_ERR_LED_PIN (6)
2032 
2041 //#define MY_DEFAULT_TX_LED_PIN (7)
2042 
2051 //#define MY_DEFAULT_RX_LED_PIN (8)
2052 
2059 //#define MY_WITH_LEDS_BLINKING_INVERSE
2060 
2065 //#define MY_INDICATION_HANDLER
2066 
2071 #ifndef MY_DEFAULT_LED_BLINK_PERIOD
2072 #define MY_DEFAULT_LED_BLINK_PERIOD 300
2073 #endif
2074  // End of LEDSettingGrpPub group
2075 
2116 //#define MY_SECURITY_SIMPLE_PASSWD "MyInsecurePassword"
2117 #if defined(MY_SECURITY_SIMPLE_PASSWD)
2118 #define MY_SIGNING_SIMPLE_PASSWD MY_SECURITY_SIMPLE_PASSWD
2119 #define MY_ENCRYPTION_SIMPLE_PASSWD MY_SECURITY_SIMPLE_PASSWD
2120 #endif
2121 
2134 //#define MY_DEBUG_VERBOSE_SIGNING
2135 
2165 //#define MY_SIGNING_SIMPLE_PASSWD "MyInsecurePassword"
2166 #if defined(MY_SIGNING_SIMPLE_PASSWD)
2167 #define MY_SIGNING_SOFT
2168 #define MY_SIGNING_REQUEST_SIGNATURES
2169 #endif
2170 
2175 //#define MY_SIGNING_ATSHA204
2176 
2181 //#define MY_SIGNING_SOFT
2182 
2191 //#define MY_SIGNING_REQUEST_SIGNATURES
2192 
2209 //#define MY_SIGNING_WEAK_SECURITY
2210 
2222 #ifndef MY_VERIFICATION_TIMEOUT_MS
2223 #define MY_VERIFICATION_TIMEOUT_MS (5*1000ul)
2224 #endif
2225 
2242 //#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
2243 
2248 #ifndef MY_SIGNING_ATSHA204_PIN
2249 #define MY_SIGNING_ATSHA204_PIN (17)
2250 #endif
2251 
2258 #ifndef MY_SIGNING_SOFT_RANDOMSEED_PIN
2259 #define MY_SIGNING_SOFT_RANDOMSEED_PIN (7)
2260 #endif
2261 
2277 //#define MY_LOCK_DEVICE
2278 
2284 #if defined(MY_SIGNING_ATSHA204) || defined(MY_SIGNING_SOFT)
2285 #define MY_SIGNING_FEATURE
2286 #endif
2287  // End of SigningSettingGrpPub group
2288 
2317 //#define MY_ENCRYPTION_SIMPLE_PASSWD "MyInsecurePassword"
2318 #if defined(MY_ENCRYPTION_SIMPLE_PASSWD)
2319 #ifndef MY_RF24_ENABLE_ENCRYPTION
2320 #define MY_RF24_ENABLE_ENCRYPTION
2321 #endif
2322 #ifndef MY_RFM69_ENABLE_ENCRYPTION
2323 #define MY_RFM69_ENABLE_ENCRYPTION
2324 #endif
2325 #ifndef MY_NRF5_ESB_ENABLE_ENCRYPTION
2326 #define MY_NRF5_ESB_ENABLE_ENCRYPTION
2327 #endif
2328 #ifndef MY_RFM95_ENABLE_ENCRYPTION
2329 #define MY_RFM95_ENABLE_ENCRYPTION
2330 #endif
2331 #endif
2332 
2339 #if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION) || defined(MY_NRF5_ESB_ENABLE_ENCRYPTION) || defined(MY_RFM95_ENABLE_ENCRYPTION)
2340 #define MY_ENCRYPTION_FEATURE
2341 #endif
2342  // End of EncryptionSettingGrpPub group
2343 
2383 //#define MY_NODE_LOCK_FEATURE
2384 
2393 #ifndef MY_NODE_UNLOCK_PIN
2394 #define MY_NODE_UNLOCK_PIN (14)
2395 #endif
2396 
2403 #ifndef MY_NODE_LOCK_COUNTER_MAX
2404 #define MY_NODE_LOCK_COUNTER_MAX (5)
2405 #endif
2406  // Node lock group // End of SecuritySettingGrpPub group
2408 
2429 #ifndef MY_ESP8266_SERIAL_MODE
2430 #define MY_ESP8266_SERIAL_MODE SERIAL_FULL
2431 #endif
2432  // End of ESP8266SettingGrpPub group
2433 
2441 //
2442 // no ESP32 settings
2443 //
2444  // End of ESP32SettingGrpPub group
2446 
2458 //#define MY_LINUX_SERIAL_PORT "/dev/ttyUSB0"
2459 
2464 #ifdef MY_LINUX_SERIAL_PTY
2465 #warning MY_LINUX_SERIAL_PTY is deprecated, please use MY_LINUX_SERIAL_PORT
2466 #define MY_LINUX_SERIAL_PORT MY_LINUX_SERIAL_PTY
2467 #endif
2468 
2473 #ifdef MY_LINUX_IS_SERIAL_PTY
2474 #warning MY_LINUX_IS_SERIAL_PTY is deprecated, please use MY_LINUX_SERIAL_IS_PTY
2475 #define MY_LINUX_SERIAL_IS_PTY
2476 #endif
2477 
2485 //#define MY_LINUX_SERIAL_IS_PTY
2486 
2491 //#define MY_LINUX_SERIAL_GROUPNAME "tty"
2492 
2499 #ifndef MY_LINUX_CONFIG_FILE
2500 #define MY_LINUX_CONFIG_FILE "/etc/mysensors.conf"
2501 #endif
2502  // End of LinuxSettingGrpPub group // End of PlatformSettingGrpPub group
2504 
2505 /*
2506 * "Helper" definitions
2507 */
2508 
2509 /*
2510  * Detect node type
2511  * MY_GATEWAY_FEATURE is set for gateway sketches.
2512  * MY_IS_GATEWAY is true when @ref MY_GATEWAY_FEATURE is set.
2513  * MY_NODE_TYPE contain a string describing the class of sketch/node (gateway/repeater/node).
2514  */
2515 #if defined(MY_GATEWAY_SERIAL) || defined(MY_GATEWAY_W5100) || defined(MY_GATEWAY_ENC28J60) || defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_ESP32)|| defined(MY_GATEWAY_LINUX) || defined(MY_GATEWAY_MQTT_CLIENT) || defined(MY_GATEWAY_TINYGSM)
2516 #define MY_GATEWAY_FEATURE
2517 #define MY_IS_GATEWAY (true)
2518 #define MY_NODE_TYPE "GW"
2519 #elif defined(MY_REPEATER_FEATURE)
2520 #define MY_IS_GATEWAY (false)
2521 #define MY_NODE_TYPE "REPEATER"
2522 #elif defined(DOXYGEN)
2523 #define MY_IS_GATEWAY
2524 #define MY_NODE_TYPE
2525 #else
2526 #define MY_IS_GATEWAY (false)
2527 #define MY_NODE_TYPE "NODE"
2528 #endif
2529 
2530 // DEBUG
2531 #if defined(MY_DISABLED_SERIAL) && !defined(MY_DEBUG_OTA)
2532 #undef MY_DEBUG
2533 #endif
2534 #if defined(MY_DEBUG)
2535 // standard debug output
2536 #define MY_DEBUG_VERBOSE_CORE
2537 #define MY_DEBUG_VERBOSE_TRANSPORT
2538 #define MY_DEBUG_VERBOSE_GATEWAY
2539 #define MY_DEBUG_VERBOSE_OTA_UPDATE
2540 #endif
2541 
2542 #if defined(MY_DEBUG) || defined(MY_DEBUG_VERBOSE_CORE) || defined(MY_DEBUG_VERBOSE_TRANSPORT) || defined(MY_DEBUG_VERBOSE_GATEWAY) || defined(MY_DEBUG_VERBOSE_SIGNING) || defined(MY_DEBUG_VERBOSE_OTA_UPDATE) || defined(MY_DEBUG_VERBOSE_RF24) || defined(MY_DEBUG_VERBOSE_NRF5_ESB) || defined(MY_DEBUG_VERBOSE_RFM69) || defined(MY_DEBUG_VERBOSE_RFM95) || defined(MY_DEBUG_VERBOSE_SX126x) || defined(MY_DEBUG_VERBOSE_TRANSPORT_HAL)
2543 #define DEBUG_OUTPUT_ENABLED
2544 #ifndef MY_DEBUG_OTA
2545 #define DEBUG_OUTPUT(x,...) hwDebugPrint(x, ##__VA_ARGS__)
2546 #else
2547 #ifndef MY_OTA_LOG_SENDER_FEATURE
2548 #define MY_OTA_LOG_SENDER_FEATURE
2549 #endif
2550 #ifndef MY_DEBUG_OTA_DISABLE_ECHO
2551 #define DEBUG_OUTPUT(x,...) OTALog((MY_DEBUG_OTA), true, x, ##__VA_ARGS__)
2552 #else
2553 #define DEBUG_OUTPUT(x,...) OTALog((MY_DEBUG_OTA), false, x, ##__VA_ARGS__)
2554 #endif
2555 // disable radio related debugging messages
2556 #undef MY_DEBUG_VERBOSE_RF24
2557 #undef MY_DEBUG_VERBOSE_NRF5_ESB
2558 #undef MY_DEBUG_VERBOSE_RFM69
2559 #undef MY_DEBUG_VERBOSE_RFM69_REGISTERS
2560 #undef MY_DEBUG_VERBOSE_RFM95
2561 #undef MY_DEBUG_VERBOSE_SX126x
2562 #endif
2563 #else
2564 #define DEBUG_OUTPUT(x,...)
2565 #endif
2566 
2567 // temp. workaround for nRF5 verifier: redirect RF24 to NRF_ESB
2568 #if defined(ARDUINO_ARCH_NRF5) && (defined(MY_RADIO_RF24) )
2569 #undef MY_RADIO_RF24
2570 #define MY_RADIO_NRF5_ESB
2571 #endif
2572 
2573 // Enable sensor network "feature" if one of the transport types was enabled
2574 #if defined(MY_RADIO_RF24) || defined(MY_RADIO_NRF5_ESB) || defined(MY_RADIO_RFM69) || defined(MY_RADIO_RFM95) || defined(MY_RADIO_SX126x) || defined(MY_RS485) || defined(MY_PJON)
2575 #define MY_SENSOR_NETWORK
2576 #endif
2577 
2578 // LEDS
2579 #if !defined(MY_DEFAULT_ERR_LED_PIN) && defined(MY_HW_ERR_LED_PIN)
2580 #define MY_DEFAULT_ERR_LED_PIN MY_HW_ERR_LED_PIN
2581 #endif
2582 
2583 #if !defined(MY_DEFAULT_TX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
2584 #define MY_DEFAULT_TX_LED_PIN MY_HW_TX_LED_PIN
2585 #endif
2586 
2587 #if !defined(MY_DEFAULT_RX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
2588 #define MY_DEFAULT_RX_LED_PIN MY_HW_TX_LED_PIN
2589 #endif
2590 
2591 #endif // MyConfig_h
2592 
2593 // Doxygen specific constructs, not included when built normally
2594 // This is used to enable disabled macros/definitions to be included in the documentation as well.
2595 #if DOXYGEN
2596 
2600 #define ARDUINO_ARCH_SAMD
2601 
2606 #define ARDUINO_ARCH_NRF5
2607 
2612 #define ARDUINO_ARCH_ESP8266
2613 
2618 #define ARDUINO_ARCH_ESP32
2619 
2624 #define ARDUINO_ARCH_AVR
2625 
2630 #define ARDUINO_ARCH_MEGAAVR
2631 
2636 #define ARDUINO_ARCH_STM32
2637 
2642 #define TEENSYDUINO
2643 
2644 // debug
2645 #define MY_DEBUG
2646 #define MY_DEBUGDEVICE
2647 #define MY_DEBUG_OTA
2648 #define MY_DEBUG_OTA_DISABLE_ECHO
2649 #define MY_SPECIAL_DEBUG
2650 #define MY_DISABLED_SERIAL
2651 #define MY_SPLASH_SCREEN_DISABLED
2652 #define MY_DIAGNOSTICS
2653 #define MY_DIAGNOSTICS_CRYPTO
2654 // linux
2655 #define MY_LINUX_SERIAL_PORT
2656 #define MY_LINUX_SERIAL_IS_PTY
2657 #define MY_LINUX_SERIAL_GROUPNAME
2658 #define MY_LINUX_SERIAL_PTY
2659 #define MY_LINUX_IS_SERIAL_PTY
2660 // inclusion mode
2661 #define MY_INCLUSION_MODE_FEATURE
2662 #define MY_INCLUSION_BUTTON_FEATURE
2663 // OTA logging and debug
2664 #define MY_OTA_LOG_RECEIVER_FEATURE
2665 #define MY_OTA_LOG_SENDER_FEATURE
2666 // transport
2667 #define MY_PARENT_NODE_IS_STATIC
2668 #define MY_REGISTRATION_CONTROLLER
2669 #define MY_TRANSPORT_UPLINK_CHECK_DISABLED
2670 #define MY_TRANSPORT_SANITY_CHECK
2671 #define MY_NODE_LOCK_FEATURE
2672 #define MY_REPEATER_FEATURE
2673 #define MY_PASSIVE_NODE
2674 #define MY_MQTT_CLIENT_PUBLISH_RETAIN
2675 #define MY_MQTT_PASSWORD
2676 #define MY_MQTT_USER
2677 #define MY_MQTT_CLIENT_ID
2678 #define MY_MQTT_PUBLISH_TOPIC_PREFIX
2679 #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX
2680 #define MY_MQTT_CA_CERT1
2681 #define MY_MQTT_CA_CERT2
2682 #define MY_MQTT_CA_CERT3
2683 #define MY_MQTT_FINGERPRINT
2684 #define MY_MQTT_CLIENT_CERT
2685 #define MY_MQTT_CLIENT_KEY
2686 #define MY_SIGNAL_REPORT_ENABLED
2687 // general
2688 #define MY_WITH_LEDS_BLINKING_INVERSE
2689 #define MY_INDICATION_HANDLER
2690 #define MY_DISABLE_REMOTE_RESET
2691 #define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE
2692 #define MY_LOCK_DEVICE
2693 #define MY_SLEEP_HANDLER
2694 // core
2695 #define MY_CORE_ONLY
2696 // GW
2697 #define MY_DEBUG_VERBOSE_GATEWAY
2698 #define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
2699 #define MY_INCLUSION_LED_PIN
2700 #define MY_GATEWAY_W5100
2701 #define MY_GATEWAY_ENC28J60
2702 #define MY_GATEWAY_ESP8266
2703 #define MY_GATEWAY_ESP32
2704 #define MY_WIFI_SSID
2705 #define MY_WIFI_BSSID
2706 #define MY_WIFI_PASSWORD
2707 #define MY_GATEWAY_LINUX
2708 #define MY_GATEWAY_TINYGSM
2709 #define MY_GATEWAY_MQTT_CLIENT
2710 #define MY_GATEWAY_SERIAL
2711 #define MY_IP_ADDRESS
2712 #define MY_IP_GATEWAY_ADDRESS
2713 #define MY_IP_SUBNET_ADDRESS
2714 #define MY_USE_UDP
2715 #define MY_CONTROLLER_IP_ADDRESS
2716 #define MY_CONTROLLER_URL_ADDRESS
2717 // TinyGSM
2718 #define MY_GSM_APN
2719 #define MY_GSM_BAUDRATE
2720 #define MY_GSM_PIN
2721 #define MY_GSM_PSW
2722 #define MY_GSM_RX
2723 #define MY_GSM_SSID
2724 #define MY_GSM_TX
2725 #define MY_GSM_USR
2726 // LED
2727 #define MY_DEFAULT_ERR_LED_PIN
2728 #define MY_DEFAULT_TX_LED_PIN
2729 #define MY_DEFAULT_RX_LED_PIN
2730 // signing
2731 #define MY_SECURITY_SIMPLE_PASSWD
2732 #define MY_SIGNING_SIMPLE_PASSWD
2733 #define MY_ENCRYPTION_SIMPLE_PASSWD
2734 #define MY_SIGNING_ATSHA204
2735 #define MY_SIGNING_SOFT
2736 #define MY_SIGNING_REQUEST_SIGNATURES
2737 #define MY_SIGNING_WEAK_SECURITY
2738 #define MY_SIGNING_NODE_WHITELISTING
2739 #define MY_DEBUG_VERBOSE_SIGNING
2740 #define MY_SIGNING_FEATURE
2741 #define MY_ENCRYPTION_FEATURE
2742 // FOTA update
2743 #define MY_DEBUG_VERBOSE_OTA_UPDATE
2744 #define MY_OTA_USE_I2C_EEPROM
2745 // RS485
2746 #define MY_RS485
2747 #define MY_RS485_DE_PIN
2748 #define MY_RS485_DE_INVERSE
2749 #define MY_RS485_HWSERIAL
2750 // PJON
2751 #define MY_PJON
2752 #define MY_DEBUG_VERBOSE_PJON
2753 // RF24
2754 #define MY_RADIO_RF24
2755 #define MY_RADIO_NRF24 //deprecated
2756 #define MY_DEBUG_VERBOSE_RF24
2757 #define MY_RF24_POWER_PIN
2758 #define MY_RF24_IRQ_PIN
2759 #define MY_RF24_ENABLE_ENCRYPTION
2760 #define MY_RX_MESSAGE_BUFFER_FEATURE
2761 #define MY_RX_MESSAGE_BUFFER_SIZE
2762 // NRF5_ESB
2763 #define MY_RADIO_NRF5_ESB
2764 #define MY_NRF5_ESB_ENABLE_ENCRYPTION
2765 #define MY_DEBUG_VERBOSE_NRF5_ESB
2766 #define MY_NRF5_ESB_REVERSE_ACK_RX
2767 #define MY_NRF5_ESB_REVERSE_ACK_TX
2768 // RFM69
2769 #define MY_RADIO_RFM69
2770 #define MY_IS_RFM69HW
2771 #define MY_RFM69_NEW_DRIVER
2772 #define MY_RFM69_POWER_PIN
2773 #define MY_RFM69_MODEM_CONFIGURATION
2774 #define MY_RFM69_ENABLE_ENCRYPTION
2775 #define MY_RFM69_ATC_MODE_DISABLED
2776 #define MY_RFM69_MAX_POWER_LEVEL_DBM
2777 #define MY_RFM69_RST_PIN
2778 #define MY_DEBUG_VERBOSE_RFM69
2779 #define MY_DEBUG_VERBOSE_RFM69_REGISTERS
2780 // RFM95
2781 #define MY_RADIO_RFM95
2782 #define MY_DEBUG_VERBOSE_RFM95
2783 #define MY_RFM95_ENABLE_ENCRYPTION
2784 #define MY_RFM95_ATC_MODE_DISABLED
2785 #define MY_RFM95_RST_PIN
2786 #define MY_RFM95_MODEM_CONFIGRUATION
2787 #define MY_RFM95_POWER_PIN
2788 #define MY_RFM95_TCXO
2789 #define MY_RFM95_MAX_POWER_LEVEL_DBM
2790 // SX126x
2791 #define MY_RADIO_SX126x
2792 #define MY_SX126x_TCXO_VOLTAGE
2793 #define MY_SX126c_TCXO_STARTUP_DELAY
2794 #define MY_SX126x_USE_TCXO
2795 #define MY_SX126x_USE_DIO2_ANT_SWITCH
2796 #define MY_SX126x_ANT_SWITCH_PIN
2797 #define MY_SX126x_POWER_PIN
2798 #define MY_SX126x_RESET_PIN
2799 #define MY_SX126x_BUSY_PIN
2800 #define MY_SX126x_DISABLE_ATC
2801 #define MY_SX126x_MIN_POWER_LEVEL_DBM
2802 #define MY_SX126x_MAX_POWER_LEVEL_DBM
2803 // SOFT-SPI
2804 #define MY_SOFTSPI
2805 
2810 #define MY_ROUTES_SIZE
2811 
2812 #endif
2813  // End of MyConfig group