-
Notifications
You must be signed in to change notification settings - Fork 3
/
user_config_override.h
138 lines (104 loc) · 4.75 KB
/
user_config_override.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
user_config_override.h - user configuration overrides my_user_config.h for Tasmota
Copyright (C) 2021 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _USER_CONFIG_OVERRIDE_H_
#define _USER_CONFIG_OVERRIDE_H_
/*****************************************************************************************************\
* USAGE:
* To modify the stock configuration without changing the my_user_config.h file:
* (1) copy this file to "user_config_override.h" (It will be ignored by Git)
* (2) define your own settings below
*
******************************************************************************************************
* ATTENTION:
* - Changes to SECTION1 PARAMETER defines will only override flash settings if you change define CFG_HOLDER.
* - Expect compiler warnings when no ifdef/undef/endif sequence is used.
* - You still need to update my_user_config.h for major define USE_MQTT_TLS.
* - All parameters can be persistent changed online using commands via MQTT, WebConsole or Serial.
\*****************************************************************************************************/
/*
Examples :
// -- Master parameter control --------------------
#undef CFG_HOLDER
#define CFG_HOLDER 4617 // [Reset 1] Change this value to load SECTION1 configuration parameters to flash
// -- Setup your own Wifi settings ---------------
#undef STA_SSID1
#define STA_SSID1 "YourSSID" // [Ssid1] Wifi SSID
#undef STA_PASS1
#define STA_PASS1 "YourWifiPassword" // [Password1] Wifi password
// -- Setup your own MQTT settings ---------------
#undef MQTT_HOST
#define MQTT_HOST "your-mqtt-server.com" // [MqttHost]
#undef MQTT_PORT
#define MQTT_PORT 1883 // [MqttPort] MQTT port (10123 on CloudMQTT)
#undef MQTT_USER
#define MQTT_USER "YourMqttUser" // [MqttUser] Optional user
#undef MQTT_PASS
#define MQTT_PASS "YourMqttPass" // [MqttPassword] Optional password
// You might even pass some parameters from the command line ----------------------------
// 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"'
#ifdef MY_IP
#undef WIFI_IP_ADDRESS
#define WIFI_IP_ADDRESS MY_IP // Set to 0.0.0.0 for using DHCP or enter a static IP address
#endif
#ifdef MY_GW
#undef WIFI_GATEWAY
#define WIFI_GATEWAY MY_GW // if not using DHCP set Gateway IP address
#endif
#ifdef MY_DNS
#undef WIFI_DNS
#define WIFI_DNS MY_DNS // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
#endif
#ifdef MY_DNS2
#undef WIFI_DNS2
#define WIFI_DNS2 MY_DNS2 // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
#endif
// !!! Remember that your changes GOES AT THE BOTTOM OF THIS FILE right before the last #endif !!!
*/
#ifdef ESP32
#undef USER_TEMPLATE
#define USER_TEMPLATE "{\"NAME\":\"Tank Sensor VL53L1X\",\"GPIO\":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,608,640,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],\"FLAG\":0,\"BASE\":1,\"CMND\":\"SetOption8 1\",\"CMND\":\"Module 0\"}"
//#define USER_TEMPLATE "{\"NAME\":\"Tank Monitor SR04\",\"GPIO\":[1,1,1,1,1,1,1,1,1856,1888,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],\"FLAG\":0,\"BASE\":1,\"CMND\":\"SetOption8 1\",\"CMND\":\"Module 0\"}"
#undef MODULE
#define MODULE USER_MODULE
#ifndef USE_BERRY_DEBUG
#define USE_BERRY_DEBUG
#endif
#endif // ESP32
#ifndef USE_I2C
#define USE_I2C
#endif
#undef MQTT_NO_RETAIN
#define MQTT_NO_RETAIN true
#undef DEBUG_TASMOTA_SENSOR
#define DEBUG_TASMOTA_SENSOR
#ifndef USE_SR04
//#define USE_SR04
#endif
#ifndef USE_VL53L1X // Time of Flight Sensor
#define USE_VL53L1X
#endif
#ifdef USE_VL53L1X
#undef USE_VL53L0X // same I2C addres as VL53L1
#undef USE_TSL2561
#undef USE_TSL2591
// I2C enable bit array
#undef I2CDRIVERS_0_31
#define I2CDRIVERS_0_31 0x00000000
#undef I2CDRIVERS_32_63
#define I2CDRIVERS_32_63 0x00400000 // enable only device 54, the VL53L1
#undef I2CDRIVERS_64_95
#define I2CDRIVERS_64_95 0x00000000
#endif
#endif // _USER_CONFIG_OVERRIDE_H_