MySensors Library & Examples  2.3.2-115-ge413c938
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 
528 //#define MY_RF24_INVERTED_ACK
529 
541 #ifndef MY_RF24_DATARATE
542 #define MY_RF24_DATARATE (RF24_250KBPS)
543 #endif
544 
552 #ifndef MY_RF24_BASE_RADIO_ID
553 #define MY_RF24_BASE_RADIO_ID 0x00,0xFC,0xE1,0xA8,0xA8
554 #endif
555 
560 #ifndef MY_RF24_ADDR_WIDTH
561 #define MY_RF24_ADDR_WIDTH (5)
562 #endif
563  // End of RF24SettingGrpPub group
564 
586 //#define MY_RADIO_NRF5_ESB
587 
598 //#define MY_NRF5_ESB_ENABLE_ENCRYPTION
599 
604 //#define MY_DEBUG_VERBOSE_NRF5_ESB
605 
615 #ifndef MY_NRF5_ESB_PA_LEVEL
616 #define MY_NRF5_ESB_PA_LEVEL (NRF5_PA_MAX)
617 #endif
618 
639 #ifndef MY_NRF5_ESB_CHANNEL
640 #define MY_NRF5_ESB_CHANNEL (76)
641 #endif
642 
652 #ifndef MY_NRF5_ESB_MODE
653 #ifdef RADIO_MODE_MODE_Nrf_250Kbit
654 #define MY_NRF5_ESB_MODE (NRF5_250KBPS)
655 #else
656 #define MY_NRF5_ESB_MODE (NRF5_1MBPS)
657 #endif
658 #endif
659 
667 #ifndef MY_NRF5_ESB_BASE_RADIO_ID
668 #define MY_NRF5_ESB_BASE_RADIO_ID 0x00, 0xFC, 0xE1, 0xA8, 0xA8
669 #endif
670 
675 #ifndef MY_NRF5_ESB_ADDR_WIDTH
676 #define MY_NRF5_ESB_ADDR_WIDTH (5)
677 #endif
678 
683 #ifndef MY_NRF5_ESB_RX_BUFFER_SIZE
684 #define MY_NRF5_ESB_RX_BUFFER_SIZE (20)
685 #endif
686 
691 //#define MY_NRF5_ESB_REVERSE_ACK_TX
692 
697 //#define MY_NRF5_ESB_REVERSE_ACK_RX // End of NRF5SettingGrpPub group
699 
716 //#define MY_RADIO_RFM69
717 
722 //#define MY_DEBUG_VERBOSE_RFM69
723 
728 //#define MY_DEBUG_VERBOSE_RFM69_REGISTERS
729 
736 //#define MY_RFM69_NEW_DRIVER
737 
753 #ifndef MY_RFM69_FREQUENCY
754 #define MY_RFM69_FREQUENCY (RFM69_868MHZ)
755 #endif
756 
761 //#define MY_IS_RFM69HW
762 
769 #ifdef MY_IS_RFM69HW
770 #define MY_RFM69HW true
771 #else
772 #define MY_RFM69HW false
773 #endif
774 
779 #ifndef MY_RFM69_TX_POWER_DBM
780 #define MY_RFM69_TX_POWER_DBM (5)
781 #endif
782 
787 #ifndef MY_RFM69_ATC_TARGET_RSSI_DBM
788 #define MY_RFM69_ATC_TARGET_RSSI_DBM (-80)
789 #endif
790 
795 //#define MY_RFM69_ATC_MODE_DISABLED
796 
808 //#define MY_RFM69_MAX_POWER_LEVEL_DBM (10u)
809 
814 #ifndef MY_RFM69_NETWORKID
815 #define MY_RFM69_NETWORKID (100)
816 #endif
817 
822 //#define MY_RFM69_RST_PIN (9)
823 
824 #ifdef MY_RF69_RESET
825 #warning MY_RF69_RESET is depreciated, please use MY_RFM69_RST_PIN instead.
826 #define MY_RFM69_RST_PIN MY_RF69_RESET
827 #endif
828 
833 //#define MY_RFM69_POWER_PIN (3)
834 
839 #ifndef MY_RFM69_IRQ_PIN
840 #ifdef MY_RF69_IRQ_PIN
841 #warning MY_RF69_IRQ_PIN is depreciated, please use MY_RFM69_IRQ_PIN instead.
842 #define MY_RFM69_IRQ_PIN MY_RF69_IRQ_PIN
843 #else
844 #define MY_RFM69_IRQ_PIN DEFAULT_RFM69_IRQ_PIN
845 #endif
846 #endif
847 
852 #ifndef MY_RFM69_IRQ_NUM
853 #ifdef MY_RF69_IRQ_NUM
854 #warning MY_RF69_IRQ_NUM is depreciated, please use MY_RFM69_IRQ_NUM instead.
855 #define MY_RFM69_IRQ_NUM MY_RF69_IRQ_NUM
856 #else
857 #define MY_RFM69_IRQ_NUM digitalPinToInterrupt(MY_RFM69_IRQ_PIN)
858 #endif
859 #endif
860 
865 #ifndef MY_RFM69_CS_PIN
866 #ifdef MY_RF69_SPI_CS
867 #warning MY_RF69_SPI_CS is depreciated, please use MY_RFM69_CS_PIN instead.
868 #define MY_RFM69_CS_PIN MY_RF69_SPI_CS
869 #else
870 #define MY_RFM69_CS_PIN DEFAULT_RFM69_CS_PIN
871 #endif
872 #endif
873 
878 #ifndef MY_RFM69_SPI_SPEED
879 #define MY_RFM69_SPI_SPEED (4*1000000ul) // datasheet says 10Mhz max.
880 #endif
881 
890 //#define MY_RFM69_ENABLE_ENCRYPTION
891 
912 //#define MY_RFM69_MODEM_CONFIGURATION (RFM69_FSK_BR55_5_FD50)
913 
914  // End of RFM69SettingGrpPub group
916 
931 //#define MY_RADIO_RFM95
932 
937 //#define MY_DEBUG_VERBOSE_RFM95
938 
949 //#define MY_RFM95_ENABLE_ENCRYPTION
950 
965 #ifndef MY_RFM95_FREQUENCY
966 #define MY_RFM95_FREQUENCY (RFM95_868MHZ)
967 #endif
968 
985 #ifndef MY_RFM95_MODEM_CONFIGRUATION
986 #define MY_RFM95_MODEM_CONFIGRUATION RFM95_BW125CR45SF128
987 #endif
988 
993 //#define MY_RFM95_RST_PIN (9)
994 
999 //#define MY_RFM95_POWER_PIN (3)
1000 
1005 #ifndef MY_RFM95_IRQ_PIN
1006 #define MY_RFM95_IRQ_PIN DEFAULT_RFM95_IRQ_PIN
1007 #endif
1008 
1013 #ifndef MY_RFM95_IRQ_NUM
1014 #define MY_RFM95_IRQ_NUM digitalPinToInterrupt(MY_RFM95_IRQ_PIN)
1015 #endif
1016 
1021 #ifndef MY_RFM95_CS_PIN
1022 #define MY_RFM95_CS_PIN DEFAULT_RFM95_CS_PIN
1023 #endif
1024 
1029 #ifndef MY_RFM95_SPI_SPEED
1030 #define MY_RFM95_SPI_SPEED (4*1000000ul)
1031 #endif
1032 
1039 #ifndef MY_RFM95_TX_POWER_DBM
1040 #define MY_RFM95_TX_POWER_DBM (13u) // 20mW
1041 #endif
1042 
1047 //#define MY_RFM95_ATC_MODE_DISABLED
1048 
1053 #ifndef MY_RFM95_ATC_TARGET_RSSI
1054 #define MY_RFM95_ATC_TARGET_RSSI (-70)
1055 #endif
1056 
1068 //#define MY_RFM95_MAX_POWER_LEVEL_DBM (10u)
1069 
1076 //#define MY_RFM95_TCXO // End of RFM95SettingGrpPub group
1078 
1094 //#define MY_RADIO_SX126x
1095 
1100 #ifndef MY_SX126x_CS_PIN
1101 #define MY_SX126x_CS_PIN DEFAULT_SX126x_CS_PIN
1102 #endif
1103 
1108 #ifndef MY_SX126x_IRQ_PIN
1109 #define MY_SX126x_IRQ_PIN DEFAULT_SX126x_IRQ_PIN
1110 #endif
1111 
1116 #ifndef MY_SX126x_IRQ_NUM
1117 #define MY_SX126x_IRQ_NUM digitalPinToInterrupt(DEFAULT_SX126x_IRQ_PIN)
1118 #endif
1119 
1134 #ifndef MY_SX126x_FREQUENCY
1135 #define MY_SX126x_FREQUENCY (SX126x_868MHZ)
1136 #endif
1137 
1147 #ifndef MY_SX126x_LORA_SF
1148 #define MY_SX126x_LORA_SF LORA_SF7
1149 #endif
1150 
1171 #ifndef MY_SX126x_LORA_BW
1172 #define MY_SX126x_LORA_BW LORA_BW_125
1173 #endif
1174 
1189 #ifndef MY_SX126x_LORA_CR
1190 #define MY_SX126x_LORA_CR LORA_CR_4_5
1191 #endif
1192 
1210 //#define MY_SX126x_TCXO_VOLTAGE (SX126x_TCXO_3V3)
1211 
1212 
1220 #if !defined(MY_SX126c_TCXO_STARTUP_DELAY) && defined(MY_SX126x_TCXO_VOLTAGE)
1221 #define MY_SX126c_TCXO_STARTUP_DELAY (10)
1222 #endif
1223 
1230 #if !defined(MY_SX126x_USE_TCXO) && defined(MY_SX126x_TCXO_VOLTAGE)
1231 #define MY_SX126x_USE_TCXO
1232 #endif
1233 
1238 //#define MY_SX126x_USE_DIO2_ANT_SWITCH
1239 
1247 //#define MY_SX126x_ANT_SWITCH_PIN (GPIO3)
1248 
1257 #if !defined(MY_SX126x_VARIANT)
1258 #define MY_SX126x_VARIANT (1)
1259 #endif
1260 
1265 //#define MY_SX126x_POWER_PIN (3)
1266 
1271 //#define MY_SX126x_RESET_PIN (47)
1272 
1277 //#define MY_SX126x_BUSY_PIN (39)
1278 
1283 //#define MY_SX126x_DISABLE_ATC
1284 
1289 #ifndef MY_SX126x_ATC_TARGET_DBM
1290 #define MY_SX126x_ATC_TARGET_DBM (-70)
1291 #endif
1292 
1299 #ifndef MY_SX126x_MAX_POWER_LEVEL_DBM
1300 #define MY_SX126x_MAX_POWER_LEVEL_DBM (20)
1301 #endif
1302 
1307 #ifndef MY_SX126x_MIN_POWER_LEVEL_DBM
1308 #define MY_SX126x_MIN_POWER_LEVEL_DBM (-3)
1309 #endif
1310  // End of SX126xSettingGrpPub group
1312 
1327 //#define MY_RADIO_CC1101
1328 
1333 #ifndef MY_CC1101_CS_PIN
1334 #define MY_CC1101_CS_PIN DEFAULT_CC1101_CS_PIN
1335 #endif
1336 
1341 #ifndef MY_CC1101_GD0_PIN
1342 #define MY_CC1101_GD0_PIN DEFAULT_CC1101_GD0_PIN
1343 #endif
1344 #define MY_CC1101_GD0_NUM digitalPinToInterrupt(MY_CC1101_GD0_PIN)
1345 
1358 #ifndef MY_CC1101_FREQUENCY
1359 #define MY_CC1101_FREQUENCY (CC1101_433MHZ)
1360 #endif
1361 
1372 #ifndef MY_CC1101_CHANNEL
1373 #define MY_CC1101_CHANNEL 4
1374 #endif
1375 
1385 //#define MY_CC1101_SYNC_WORD 0xF543
1386 
1402 //#define MY_CC1101_MODEM_CONFIGURATION CC1101_MODEM_M_BR38_4_FD20
1403 
1420 //#define MY_CC1101_POWER_LEVEL CC1101_POWER_AUTO
1421 
1426 #ifndef MY_CC1101_ATC_TARGET_DBM
1427 #define MY_CC1101_ATC_TARGET_DBM (-50)
1428 #endif
1429 
1436 //#define MY_CC1101_MAX_POWER_LEVEL (7)
1437 
1442 //#define MY_CC1101_MIN_POWER_LEVEL (0)
1443  // End of CC1101SettingGrpPub group
1445 
1446 
1447 
1465 //#define MY_SOFTSPI
1466 
1471 #ifndef MY_SOFT_SPI_SCK_PIN
1472 #define MY_SOFT_SPI_SCK_PIN (14)
1473 #endif
1474 
1479 #ifndef MY_SOFT_SPI_MISO_PIN
1480 #define MY_SOFT_SPI_MISO_PIN (16)
1481 #endif
1482 
1487 #ifndef MY_SOFT_SPI_MOSI_PIN
1488 #define MY_SOFT_SPI_MOSI_PIN (15)
1489 #endif
1490  // End of SoftSpiSettingGrpPub group
1491  // End of TransportSettingGrpPub group
1493 
1514 #ifndef MY_DISABLE_RAM_ROUTING_TABLE_FEATURE
1515 #define MY_RAM_ROUTING_TABLE_FEATURE
1516 #endif
1517 
1522 #ifndef MY_ROUTING_TABLE_SAVE_INTERVAL_MS
1523 #define MY_ROUTING_TABLE_SAVE_INTERVAL_MS (30*60*1000ul)
1524 #endif
1525 
1532 //#define MY_REPEATER_FEATURE
1533 
1543 //#define MY_PASSIVE_NODE
1544 
1549 #ifndef MY_NODE_ID
1550 #define MY_NODE_ID (AUTO)
1551 #endif
1552 
1557 #ifndef MY_PARENT_NODE_ID
1558 #define MY_PARENT_NODE_ID (AUTO)
1559 #endif
1560 
1565 //#define MY_PARENT_NODE_IS_STATIC
1566 
1573 //#define MY_TRANSPORT_SANITY_CHECK
1574 
1579 #ifndef MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS
1580 #define MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS (15*60*1000ul)
1581 #endif
1582 
1586 #ifndef MY_TRANSPORT_DISCOVERY_INTERVAL_MS
1587 #define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul)
1588 #endif
1589 
1597 //#define MY_TRANSPORT_SEND_RETRIES (5)
1598 
1603 //#define MY_TRANSPORT_UPLINK_CHECK_DISABLED
1604 
1609 //#define MY_TRANSPORT_MAX_TX_FAILURES (10u)
1610 
1615 #ifndef MY_TRANSPORT_WAIT_READY_MS
1616 #define MY_TRANSPORT_WAIT_READY_MS (0)
1617 #endif
1618 
1624 //#define MY_SIGNAL_REPORT_ENABLED
1625  // End of RoutingNodeSettingGrpPub group
1627 
1640 #define MY_REGISTRATION_FEATURE
1641 
1647 #ifndef MY_REGISTRATION_RETRIES
1648 #define MY_REGISTRATION_RETRIES (3u)
1649 #endif
1650 
1656 #define MY_REGISTRATION_DEFAULT (true)
1657 
1662 //#define MY_REGISTRATION_CONTROLLER // End of RegistrationSettingGrpPub group
1664 
1675 //#define MY_CORE_ONLY
1676 
1682 #define MY_CORE_COMPATIBILITY_CHECK
1683 
1689 //#define MY_DISABLE_CONFIG_REQUEST
1690  // End of CoreSettingGrpPub group
1692 
1703 #ifndef MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS
1704 #define MY_SLEEP_TRANSPORT_RECONNECT_TIMEOUT_MS (10*1000ul)
1705 #endif
1706 
1714 #ifndef MY_SMART_SLEEP_WAIT_DURATION_MS
1715 #define MY_SMART_SLEEP_WAIT_DURATION_MS (500ul)
1716 #endif
1717 
1726 //#define MY_SLEEP_HANDLER // End of SleepSettingGrpPub group
1728 
1744 //#define MY_OTA_FIRMWARE_FEATURE
1745 
1750 #ifndef MY_OTA_FLASH_SS
1751 #define MY_OTA_FLASH_SS (8)
1752 #endif
1753 
1758 #ifndef MY_OTA_FLASH_JDECID
1759 #define MY_OTA_FLASH_JDECID (0x1F65)
1760 #endif
1761 
1766 //#define MY_DISABLE_REMOTE_RESET // End of OTASettingGrpPub group
1768 
1779 #ifndef MY_GATEWAY_MAX_RECEIVE_LENGTH
1780 #define MY_GATEWAY_MAX_RECEIVE_LENGTH (100u)
1781 #endif
1782 
1787 #ifndef MY_GATEWAY_MAX_SEND_LENGTH
1788 #define MY_GATEWAY_MAX_SEND_LENGTH (120u)
1789 #endif
1790 
1795 #ifndef MY_GATEWAY_MAX_CLIENTS
1796 #define MY_GATEWAY_MAX_CLIENTS (1u)
1797 #endif
1798 
1803 //#define MY_INCLUSION_MODE_FEATURE
1804 
1811 //#define MY_INCLUSION_BUTTON_FEATURE
1812 
1813 // Disable inclusion mode button if inclusion mode feature is not enabled
1814 #ifndef MY_INCLUSION_MODE_FEATURE
1815 #undef MY_INCLUSION_BUTTON_FEATURE
1816 #endif
1817 
1825 //#define MY_INCLUSION_LED_PIN (7)
1826 
1831 #ifndef MY_INCLUSION_MODE_BUTTON_PIN
1832 #if defined(ARDUINO_ARCH_ESP8266)
1833 #define MY_INCLUSION_MODE_BUTTON_PIN (5)
1834 #else
1835 #define MY_INCLUSION_MODE_BUTTON_PIN (3)
1836 #endif
1837 #endif
1838 
1843 #ifndef MY_INCLUSION_MODE_DURATION
1844 #define MY_INCLUSION_MODE_DURATION (60)
1845 #endif
1846 
1857 #if defined(MY_INCLUSION_BUTTON_EXTERNAL_PULLUP)
1858 #define MY_INCLUSION_BUTTON_PRESSED (HIGH)
1859 #else
1860 #define MY_INCLUSION_BUTTON_PRESSED (LOW)
1861 #endif
1862 
1863 /**************************************
1864 * Ethernet Gateway Transport Defaults
1865 ***************************************/
1886 // The gateway options available
1887 //#define MY_GATEWAY_W5100
1888 //#define MY_GATEWAY_ENC28J60
1889 //#define MY_GATEWAY_ESP8266
1890 //#define MY_GATEWAY_ESP8266_SECURE
1891 //#define MY_GATEWAY_ESP32
1892 //#define MY_GATEWAY_LINUX
1893 //#define MY_GATEWAY_TINYGSM
1894 //#define MY_GATEWAY_MQTT_CLIENT
1895 //#define MY_GATEWAY_SERIAL
1896 
1897 
1902 //#define MY_DEBUG_VERBOSE_GATEWAY
1903 
1908 //#define MY_WIFI_SSID "MySSID"
1909 
1914 #ifndef MY_WIFI_BSSID
1915 #define MY_WIFI_BSSID NULL
1916 #endif
1917 
1922 //#define MY_WIFI_PASSWORD "MyVerySecretPassword"
1923 
1928 #ifndef MY_HOSTNAME
1929 #define MY_HOSTNAME "MYSENSORS_DEVICE"
1930 #endif
1931 
1936 #ifndef MY_PORT
1937 #ifdef MY_GATEWAY_MQTT_CLIENT
1938 #define MY_PORT 1883
1939 #else
1940 #define MY_PORT 5003
1941 #endif
1942 #endif
1943 
1948 //#define MY_MQTT_CLIENT_PUBLISH_RETAIN
1949 
1958 //#define MY_MQTT_PASSWORD "secretpassword"
1959 
1968 //#define MY_MQTT_USER "username"
1969 
1977 //#define MY_MQTT_CLIENT_ID "mysensors-1"
1978 
1986 //#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
1987 
1995 //#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
1996 
2032 //#define MY_MQTT_CA_CERT1
2033 
2038 //#define MY_MQTT_CA_CERT2
2039 
2044 //#define MY_MQTT_CA_CERT3
2045 
2046 
2064 //#define MY_MQTT_FINGERPRINT
2065 
2083 //#define MY_MQTT_CLIENT_CERT
2084 
2102 //#define MY_MQTT_CLIENT_KEY
2103 
2110 //#define MY_IP_ADDRESS 192,168,178,66
2111 
2118 //#define MY_IP_GATEWAY_ADDRESS 192,168,1,1
2119 
2126 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
2127 
2133 //#define MY_USE_UDP
2134 
2140 #ifndef MY_MAC_ADDRESS
2141 #define MY_MAC_ADDRESS 0xDE,0xAD,0xBE,0xEF,0xFE,0xED
2142 #endif
2143 
2154 //#define MY_CONTROLLER_IP_ADDRESS 192,168,178,254
2155 
2166 //#define MY_CONTROLLER_URL_ADDRESS "test.mosquitto.org"
2167  // End of GatewaySettingGrpPub group
2169 
2180 //#define MY_GSM_APN
2185 //#define MY_GSM_BAUDRATE (9600u)
2190 //#define MY_GSM_PIN
2195 //#define MY_GSM_PSW
2200 //#define MY_GSM_RX
2205 //#define MY_GSM_SSID
2210 //#define MY_GSM_TX
2215 //#define MY_GSM_USR
2216  // End of GSMSettingGrpPub group
2218 
2233 //#define MY_DEFAULT_ERR_LED_PIN (6)
2234 
2243 //#define MY_DEFAULT_TX_LED_PIN (7)
2244 
2253 //#define MY_DEFAULT_RX_LED_PIN (8)
2254 
2261 //#define MY_WITH_LEDS_BLINKING_INVERSE
2262 
2267 //#define MY_INDICATION_HANDLER
2268 
2273 #ifndef MY_DEFAULT_LED_BLINK_PERIOD
2274 #define MY_DEFAULT_LED_BLINK_PERIOD 300
2275 #endif
2276  // End of LEDSettingGrpPub group
2277 
2318 //#define MY_SECURITY_SIMPLE_PASSWD "MyInsecurePassword"
2319 #if defined(MY_SECURITY_SIMPLE_PASSWD)
2320 #define MY_SIGNING_SIMPLE_PASSWD MY_SECURITY_SIMPLE_PASSWD
2321 #define MY_ENCRYPTION_SIMPLE_PASSWD MY_SECURITY_SIMPLE_PASSWD
2322 #endif
2323 
2336 //#define MY_DEBUG_VERBOSE_SIGNING
2337 
2367 //#define MY_SIGNING_SIMPLE_PASSWD "MyInsecurePassword"
2368 #if defined(MY_SIGNING_SIMPLE_PASSWD)
2369 #define MY_SIGNING_SOFT
2370 #define MY_SIGNING_REQUEST_SIGNATURES
2371 #endif
2372 
2377 //#define MY_SIGNING_ATSHA204
2378 
2383 //#define MY_SIGNING_SOFT
2384 
2393 //#define MY_SIGNING_REQUEST_SIGNATURES
2394 
2411 //#define MY_SIGNING_WEAK_SECURITY
2412 
2424 #ifndef MY_VERIFICATION_TIMEOUT_MS
2425 #define MY_VERIFICATION_TIMEOUT_MS (5*1000ul)
2426 #endif
2427 
2444 //#define MY_SIGNING_NODE_WHITELISTING {{.nodeId = GATEWAY_ADDRESS,.serial = {0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01}}}
2445 
2450 #ifndef MY_SIGNING_ATSHA204_PIN
2451 #define MY_SIGNING_ATSHA204_PIN (17)
2452 #endif
2453 
2460 #ifndef MY_SIGNING_SOFT_RANDOMSEED_PIN
2461 #define MY_SIGNING_SOFT_RANDOMSEED_PIN (7)
2462 #endif
2463 
2479 //#define MY_LOCK_DEVICE
2480 
2486 #if defined(MY_SIGNING_ATSHA204) || defined(MY_SIGNING_SOFT)
2487 #define MY_SIGNING_FEATURE
2488 #endif
2489  // End of SigningSettingGrpPub group
2490 
2519 //#define MY_ENCRYPTION_SIMPLE_PASSWD "MyInsecurePassword"
2520 #if defined(MY_ENCRYPTION_SIMPLE_PASSWD)
2521 #ifndef MY_RF24_ENABLE_ENCRYPTION
2522 #define MY_RF24_ENABLE_ENCRYPTION
2523 #endif
2524 #ifndef MY_RFM69_ENABLE_ENCRYPTION
2525 #define MY_RFM69_ENABLE_ENCRYPTION
2526 #endif
2527 #ifndef MY_NRF5_ESB_ENABLE_ENCRYPTION
2528 #define MY_NRF5_ESB_ENABLE_ENCRYPTION
2529 #endif
2530 #ifndef MY_RFM95_ENABLE_ENCRYPTION
2531 #define MY_RFM95_ENABLE_ENCRYPTION
2532 #endif
2533 #endif
2534 
2541 #if defined(MY_RF24_ENABLE_ENCRYPTION) || defined(MY_RFM69_ENABLE_ENCRYPTION) || defined(MY_NRF5_ESB_ENABLE_ENCRYPTION) || defined(MY_RFM95_ENABLE_ENCRYPTION)
2542 #define MY_ENCRYPTION_FEATURE
2543 #endif
2544  // End of EncryptionSettingGrpPub group
2545 
2585 //#define MY_NODE_LOCK_FEATURE
2586 
2595 #ifndef MY_NODE_UNLOCK_PIN
2596 #define MY_NODE_UNLOCK_PIN (14)
2597 #endif
2598 
2605 #ifndef MY_NODE_LOCK_COUNTER_MAX
2606 #define MY_NODE_LOCK_COUNTER_MAX (5)
2607 #endif
2608  // Node lock group // End of SecuritySettingGrpPub group
2610 
2631 #ifndef MY_ESP8266_SERIAL_MODE
2632 #define MY_ESP8266_SERIAL_MODE SERIAL_FULL
2633 #endif
2634  // End of ESP8266SettingGrpPub group
2635 
2643 //
2644 // no ESP32 settings
2645 //
2646  // End of ESP32SettingGrpPub group
2648 
2660 //#define MY_LINUX_SERIAL_PORT "/dev/ttyUSB0"
2661 
2666 #ifdef MY_LINUX_SERIAL_PTY
2667 #warning MY_LINUX_SERIAL_PTY is deprecated, please use MY_LINUX_SERIAL_PORT
2668 #define MY_LINUX_SERIAL_PORT MY_LINUX_SERIAL_PTY
2669 #endif
2670 
2675 #ifdef MY_LINUX_IS_SERIAL_PTY
2676 #warning MY_LINUX_IS_SERIAL_PTY is deprecated, please use MY_LINUX_SERIAL_IS_PTY
2677 #define MY_LINUX_SERIAL_IS_PTY
2678 #endif
2679 
2687 //#define MY_LINUX_SERIAL_IS_PTY
2688 
2693 //#define MY_LINUX_SERIAL_GROUPNAME "tty"
2694 
2701 #ifndef MY_LINUX_CONFIG_FILE
2702 #define MY_LINUX_CONFIG_FILE "/etc/mysensors.conf"
2703 #endif
2704  // End of LinuxSettingGrpPub group // End of PlatformSettingGrpPub group
2706 
2707 /*
2708 * "Helper" definitions
2709 */
2710 
2711 /*
2712  * Detect node type
2713  * MY_GATEWAY_FEATURE is set for gateway sketches.
2714  * MY_IS_GATEWAY is true when @ref MY_GATEWAY_FEATURE is set.
2715  * MY_NODE_TYPE contain a string describing the class of sketch/node (gateway/repeater/node).
2716  */
2717 #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)
2718 #define MY_GATEWAY_FEATURE
2719 #define MY_IS_GATEWAY (true)
2720 #define MY_NODE_TYPE "GW"
2721 #elif defined(MY_REPEATER_FEATURE)
2722 #define MY_IS_GATEWAY (false)
2723 #define MY_NODE_TYPE "REPEATER"
2724 #elif defined(DOXYGEN)
2725 #define MY_IS_GATEWAY
2726 #define MY_NODE_TYPE
2727 #else
2728 #define MY_IS_GATEWAY (false)
2729 #define MY_NODE_TYPE "NODE"
2730 #endif
2731 
2732 // DEBUG
2733 #if defined(MY_DISABLED_SERIAL) && !defined(MY_DEBUG_OTA)
2734 #undef MY_DEBUG
2735 #endif
2736 #if defined(MY_DEBUG)
2737 // standard debug output
2738 #define MY_DEBUG_VERBOSE_CORE
2739 #define MY_DEBUG_VERBOSE_TRANSPORT
2740 #define MY_DEBUG_VERBOSE_GATEWAY
2741 #define MY_DEBUG_VERBOSE_OTA_UPDATE
2742 #endif
2743 
2744 #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)
2745 #define DEBUG_OUTPUT_ENABLED
2746 #ifndef MY_DEBUG_OTA
2747 #define DEBUG_OUTPUT(x,...) hwDebugPrint(x, ##__VA_ARGS__)
2748 #else
2749 #ifndef MY_OTA_LOG_SENDER_FEATURE
2750 #define MY_OTA_LOG_SENDER_FEATURE
2751 #endif
2752 #ifndef MY_DEBUG_OTA_DISABLE_ECHO
2753 #define DEBUG_OUTPUT(x,...) OTALog((MY_DEBUG_OTA), true, x, ##__VA_ARGS__)
2754 #else
2755 #define DEBUG_OUTPUT(x,...) OTALog((MY_DEBUG_OTA), false, x, ##__VA_ARGS__)
2756 #endif
2757 // disable radio related debugging messages
2758 #undef MY_DEBUG_VERBOSE_RF24
2759 #undef MY_DEBUG_VERBOSE_NRF5_ESB
2760 #undef MY_DEBUG_VERBOSE_RFM69
2761 #undef MY_DEBUG_VERBOSE_RFM69_REGISTERS
2762 #undef MY_DEBUG_VERBOSE_RFM95
2763 #undef MY_DEBUG_VERBOSE_SX126x
2764 #endif
2765 #else
2766 #define DEBUG_OUTPUT(x,...)
2767 #endif
2768 
2769 // temp. workaround for nRF5 verifier: redirect RF24 to NRF_ESB
2770 #if defined(ARDUINO_ARCH_NRF5) && (defined(MY_RADIO_RF24) )
2771 #undef MY_RADIO_RF24
2772 #define MY_RADIO_NRF5_ESB
2773 #endif
2774 
2775 // Enable sensor network "feature" if one of the transport types was enabled
2776 #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) || defined(MY_RADIO_CC1101)
2777 #define MY_SENSOR_NETWORK
2778 #endif
2779 
2780 // LEDS
2781 #if !defined(MY_DEFAULT_ERR_LED_PIN) && defined(MY_HW_ERR_LED_PIN)
2782 #define MY_DEFAULT_ERR_LED_PIN MY_HW_ERR_LED_PIN
2783 #endif
2784 
2785 #if !defined(MY_DEFAULT_TX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
2786 #define MY_DEFAULT_TX_LED_PIN MY_HW_TX_LED_PIN
2787 #endif
2788 
2789 #if !defined(MY_DEFAULT_RX_LED_PIN) && defined(MY_HW_TX_LED_PIN)
2790 #define MY_DEFAULT_RX_LED_PIN MY_HW_TX_LED_PIN
2791 #endif
2792 
2793 #endif // MyConfig_h
2794 
2795 // Doxygen specific constructs, not included when built normally
2796 // This is used to enable disabled macros/definitions to be included in the documentation as well.
2797 #if DOXYGEN
2798 
2802 #define ARDUINO_ARCH_SAMD
2803 
2808 #define ARDUINO_ARCH_NRF5
2809 
2814 #define ARDUINO_ARCH_ESP8266
2815 
2820 #define ARDUINO_ARCH_ESP32
2821 
2826 #define ARDUINO_ARCH_AVR
2827 
2832 #define ARDUINO_ARCH_MEGAAVR
2833 
2838 #define ARDUINO_ARCH_STM32
2839 
2844 #define TEENSYDUINO
2845 
2846 // debug
2847 #define MY_DEBUG
2848 #define MY_DEBUGDEVICE
2849 #define MY_DEBUG_OTA
2850 #define MY_DEBUG_OTA_DISABLE_ECHO
2851 #define MY_SPECIAL_DEBUG
2852 #define MY_DISABLED_SERIAL
2853 #define MY_SPLASH_SCREEN_DISABLED
2854 #define MY_DIAGNOSTICS
2855 #define MY_DIAGNOSTICS_CRYPTO
2856 // linux
2857 #define MY_LINUX_SERIAL_PORT
2858 #define MY_LINUX_SERIAL_IS_PTY
2859 #define MY_LINUX_SERIAL_GROUPNAME
2860 #define MY_LINUX_SERIAL_PTY
2861 #define MY_LINUX_IS_SERIAL_PTY
2862 // inclusion mode
2863 #define MY_INCLUSION_MODE_FEATURE
2864 #define MY_INCLUSION_BUTTON_FEATURE
2865 // OTA logging and debug
2866 #define MY_OTA_LOG_RECEIVER_FEATURE
2867 #define MY_OTA_LOG_SENDER_FEATURE
2868 // transport
2869 #define MY_PARENT_NODE_IS_STATIC
2870 #define MY_REGISTRATION_CONTROLLER
2871 #define MY_TRANSPORT_UPLINK_CHECK_DISABLED
2872 #define MY_TRANSPORT_SANITY_CHECK
2873 #define MY_NODE_LOCK_FEATURE
2874 #define MY_REPEATER_FEATURE
2875 #define MY_PASSIVE_NODE
2876 #define MY_MQTT_CLIENT_PUBLISH_RETAIN
2877 #define MY_MQTT_PASSWORD
2878 #define MY_MQTT_USER
2879 #define MY_MQTT_CLIENT_ID
2880 #define MY_MQTT_PUBLISH_TOPIC_PREFIX
2881 #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX
2882 #define MY_MQTT_CA_CERT1
2883 #define MY_MQTT_CA_CERT2
2884 #define MY_MQTT_CA_CERT3
2885 #define MY_MQTT_FINGERPRINT
2886 #define MY_MQTT_CLIENT_CERT
2887 #define MY_MQTT_CLIENT_KEY
2888 #define MY_SIGNAL_REPORT_ENABLED
2889 // general
2890 #define MY_WITH_LEDS_BLINKING_INVERSE
2891 #define MY_INDICATION_HANDLER
2892 #define MY_DISABLE_REMOTE_RESET
2893 #define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE
2894 #define MY_LOCK_DEVICE
2895 #define MY_SLEEP_HANDLER
2896 // core
2897 #define MY_CORE_ONLY
2898 // GW
2899 #define MY_DEBUG_VERBOSE_GATEWAY
2900 #define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
2901 #define MY_INCLUSION_LED_PIN
2902 #define MY_GATEWAY_W5100
2903 #define MY_GATEWAY_ENC28J60
2904 #define MY_GATEWAY_ESP8266
2905 #define MY_GATEWAY_ESP32
2906 #define MY_WIFI_SSID
2907 #define MY_WIFI_BSSID
2908 #define MY_WIFI_PASSWORD
2909 #define MY_GATEWAY_LINUX
2910 #define MY_GATEWAY_TINYGSM
2911 #define MY_GATEWAY_MQTT_CLIENT
2912 #define MY_GATEWAY_SERIAL
2913 #define MY_IP_ADDRESS
2914 #define MY_IP_GATEWAY_ADDRESS
2915 #define MY_IP_SUBNET_ADDRESS
2916 #define MY_USE_UDP
2917 #define MY_CONTROLLER_IP_ADDRESS
2918 #define MY_CONTROLLER_URL_ADDRESS
2919 // TinyGSM
2920 #define MY_GSM_APN
2921 #define MY_GSM_BAUDRATE
2922 #define MY_GSM_PIN
2923 #define MY_GSM_PSW
2924 #define MY_GSM_RX
2925 #define MY_GSM_SSID
2926 #define MY_GSM_TX
2927 #define MY_GSM_USR
2928 // LED
2929 #define MY_DEFAULT_ERR_LED_PIN
2930 #define MY_DEFAULT_TX_LED_PIN
2931 #define MY_DEFAULT_RX_LED_PIN
2932 // signing
2933 #define MY_SECURITY_SIMPLE_PASSWD
2934 #define MY_SIGNING_SIMPLE_PASSWD
2935 #define MY_ENCRYPTION_SIMPLE_PASSWD
2936 #define MY_SIGNING_ATSHA204
2937 #define MY_SIGNING_SOFT
2938 #define MY_SIGNING_REQUEST_SIGNATURES
2939 #define MY_SIGNING_WEAK_SECURITY
2940 #define MY_SIGNING_NODE_WHITELISTING
2941 #define MY_DEBUG_VERBOSE_SIGNING
2942 #define MY_SIGNING_FEATURE
2943 #define MY_ENCRYPTION_FEATURE
2944 // FOTA update
2945 #define MY_DEBUG_VERBOSE_OTA_UPDATE
2946 #define MY_OTA_USE_I2C_EEPROM
2947 // RS485
2948 #define MY_RS485
2949 #define MY_RS485_DE_PIN
2950 #define MY_RS485_DE_INVERSE
2951 #define MY_RS485_HWSERIAL
2952 // PJON
2953 #define MY_PJON
2954 #define MY_DEBUG_VERBOSE_PJON
2955 // RF24
2956 #define MY_RADIO_RF24
2957 #define MY_RADIO_NRF24 //deprecated
2958 #define MY_DEBUG_VERBOSE_RF24
2959 #define MY_RF24_POWER_PIN
2960 #define MY_RF24_IRQ_PIN
2961 #define MY_RF24_ENABLE_ENCRYPTION
2962 #define MY_RX_MESSAGE_BUFFER_FEATURE
2963 #define MY_RX_MESSAGE_BUFFER_SIZE
2964 // NRF5_ESB
2965 #define MY_RADIO_NRF5_ESB
2966 #define MY_NRF5_ESB_ENABLE_ENCRYPTION
2967 #define MY_DEBUG_VERBOSE_NRF5_ESB
2968 #define MY_NRF5_ESB_REVERSE_ACK_RX
2969 #define MY_NRF5_ESB_REVERSE_ACK_TX
2970 // RFM69
2971 #define MY_RADIO_RFM69
2972 #define MY_IS_RFM69HW
2973 #define MY_RFM69_NEW_DRIVER
2974 #define MY_RFM69_POWER_PIN
2975 #define MY_RFM69_MODEM_CONFIGURATION
2976 #define MY_RFM69_ENABLE_ENCRYPTION
2977 #define MY_RFM69_ATC_MODE_DISABLED
2978 #define MY_RFM69_MAX_POWER_LEVEL_DBM
2979 #define MY_RFM69_RST_PIN
2980 #define MY_DEBUG_VERBOSE_RFM69
2981 #define MY_DEBUG_VERBOSE_RFM69_REGISTERS
2982 // RFM95
2983 #define MY_RADIO_RFM95
2984 #define MY_DEBUG_VERBOSE_RFM95
2985 #define MY_RFM95_ENABLE_ENCRYPTION
2986 #define MY_RFM95_ATC_MODE_DISABLED
2987 #define MY_RFM95_RST_PIN
2988 #define MY_RFM95_MODEM_CONFIGRUATION
2989 #define MY_RFM95_POWER_PIN
2990 #define MY_RFM95_TCXO
2991 #define MY_RFM95_MAX_POWER_LEVEL_DBM
2992 // SX126x
2993 #define MY_RADIO_SX126x
2994 #define MY_SX126x_TCXO_VOLTAGE
2995 #define MY_SX126c_TCXO_STARTUP_DELAY
2996 #define MY_SX126x_USE_TCXO
2997 #define MY_SX126x_USE_DIO2_ANT_SWITCH
2998 #define MY_SX126x_ANT_SWITCH_PIN
2999 #define MY_SX126x_POWER_PIN
3000 #define MY_SX126x_RESET_PIN
3001 #define MY_SX126x_BUSY_PIN
3002 #define MY_SX126x_DISABLE_ATC
3003 #define MY_SX126x_MIN_POWER_LEVEL_DBM
3004 #define MY_SX126x_MAX_POWER_LEVEL_DBM
3005 // SOFT-SPI
3006 #define MY_SOFTSPI
3007 
3012 #define MY_ROUTES_SIZE
3013 
3014 #endif
3015  // End of MyConfig group