user_config_override_sample.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. user_config_override.h - user configuration overrides my_user_config.h for Sonoff-Tasmota
  3. Copyright (C) 2018 Theo Arends
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef _USER_CONFIG_OVERRIDE_H_
  16. #define _USER_CONFIG_OVERRIDE_H_
  17. // force the compiler to show a warning to confirm that this file is inlcuded
  18. #warning **** user_config_override.h: Using Settings from this File ****
  19. /*****************************************************************************************************\
  20. * USAGE:
  21. * To modify the stock configuration without changing the my_user_config.h file:
  22. * (1) copy this file to "user_config_override.h" (It will be ignored by Git)
  23. * (2) define your own settings below
  24. * (3) for platformio:
  25. * define USE_CONFIG_OVERRIDE as a build flags.
  26. * ie1 : export PLATFORMIO_BUILD_FLAGS='-DUSE_CONFIG_OVERRIDE'
  27. * ie2 : enable in file platformio.ini "build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CONFIG_OVERRIDE"
  28. * for Arduino IDE:
  29. * enable define USE_CONFIG_OVERRIDE in my_user_config.h
  30. ******************************************************************************************************
  31. * ATTENTION:
  32. * - Changes to SECTION1 PARAMETER defines will only override flash settings if you change define CFG_HOLDER.
  33. * - Expect compiler warnings when no ifdef/undef/endif sequence is used.
  34. * - You still need to update my_user_config.h for major define USE_MQTT_TLS.
  35. * - All parameters can be persistent changed online using commands via MQTT, WebConsole or Serial.
  36. \*****************************************************************************************************/
  37. /*
  38. Examples :
  39. // -- Master parameter control --------------------
  40. #undef CFG_HOLDER
  41. #define CFG_HOLDER 4617 // [Reset 1] Change this value to load SECTION1 configuration parameters to flash
  42. // -- Setup your own Wifi settings ---------------
  43. #undef STA_SSID1
  44. #define STA_SSID1 "YourSSID" // [Ssid1] Wifi SSID
  45. #undef STA_PASS1
  46. #define STA_PASS1 "YourWifiPassword" // [Password1] Wifi password
  47. // -- Setup your own MQTT settings ---------------
  48. #undef MQTT_HOST
  49. #define MQTT_HOST "your-mqtt-server.com" // [MqttHost]
  50. #undef MQTT_PORT
  51. #define MQTT_PORT 1883 // [MqttPort] MQTT port (10123 on CloudMQTT)
  52. #undef MQTT_USER
  53. #define MQTT_USER "YourMqttUser" // [MqttUser] Optional user
  54. #undef MQTT_PASS
  55. #define MQTT_PASS "YourMqttPass" // [MqttPassword] Optional password
  56. // You might even pass some parameters from the command line ----------------------------
  57. // Ie: export PLATFORMIO_BUILD_FLAGS='-DUSE_CONFIG_OVERRIDE -DMY_IP="192.168.1.99" -DMY_GW="192.168.1.1" -DMY_DNS="192.168.1.1"'
  58. #ifdef MY_IP
  59. #undef WIFI_IP_ADDRESS
  60. #define WIFI_IP_ADDRESS MY_IP // Set to 0.0.0.0 for using DHCP or IP address
  61. #endif
  62. #ifdef MY_GW
  63. #undef WIFI_GATEWAY
  64. #define WIFI_GATEWAY MY_GW // if not using DHCP set Gateway IP address
  65. #endif
  66. #ifdef MY_DNS
  67. #undef WIFI_DNS
  68. #define WIFI_DNS MY_DNS // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
  69. #endif
  70. */
  71. #endif // _USER_CONFIG_OVERRIDE_H_