-
Notifications
You must be signed in to change notification settings - Fork 78
/
platformio.ini
264 lines (242 loc) · 9.13 KB
/
platformio.ini
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/en/stable/projectconf.html
[platformio]
default_envs = emonesp
data_dir = src/data
[esp82xx_defaults]
build_flags = -D NDEBUG
-mtarget-align
-Wl,-Map,firmware.map
[core_2_3_0]
; *** Esp8266 core for Arduino version 2.3.0
platform = [email protected]
build_flags = ${esp82xx_defaults.build_flags}
[core_2_4_2]
; *** Esp8266 core for Arduino version 2.4.2
platform = [email protected]
build_flags = ${esp82xx_defaults.build_flags}
-lstdc++ -lsupc++
; lwIP 1.4 (Default)
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; -DVTABLES_IN_FLASH
board_build.ldscript = eagle.flash.1m512.ld
[core_2_5_0]
; *** Esp8266 core for Arduino version 2.5.0
platform = [email protected]
build_flags = ${esp82xx_defaults.build_flags}
; lwIP 1.4
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwidth Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwidth no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; -DVTABLES_IN_FLASH
; -fno-exceptions
; -lstdc++
[core_2_7_4]
; *** Esp8266 core for Arduino version 2.7.4
platform = [email protected]
build_flags = ${esp82xx_defaults.build_flags}
; lwIP 1.4
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwidth Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwidth no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; -DVTABLES_IN_FLASH
; -fno-exceptions
; -lstdc++
[core_stage]
; *** Esp8266 core for Arduino version latest beta
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
build_flags = ${esp82xx_defaults.build_flags}
; lwIP 1.4 (Default)
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
-DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwidth
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; lwIP 2 - Higher Bandwitdh Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; lwIP 2 - Higher Bandwitdh no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; VTABLES in Flash (default)
-DVTABLES_IN_FLASH
; VTABLES in Heap
; -DVTABLES_IN_DRAM
; VTABLES in IRAM
; -DVTABLES_IN_IRAM
; enable one option set -> No exception recommended
; No exception code in firmware
-fno-exceptions
-lstdc++
; Exception code in firmware
; -fexceptions
; -lstdc++-exc
[core_active]
; Select one core set for platform and build_flags
;platform = ${core_2_3_0.platform}
;build_flags = ${core_2_3_0.build_flags}
;platform = ${core_2_4_2.platform}
;build_flags = ${core_2_4_2.build_flags}
;platform = ${core_2_5_0.platform}
;build_flags = ${core_2_5_0.build_flags}
platform = ${core_2_7_4.platform}
build_flags = ${core_2_7_4.build_flags}
;platform = ${core_stage.platform}
;build_flags = ${core_stage.build_flags}
[common]
version = -DBUILD_TAG=3.1.4
framework = arduino
board_build.flash_mode = dout
lib_deps =
ESP Async [email protected]
arduino-libraries/[email protected]
Micro [email protected]
platform = ${core_active.platform}
build_flags = ${core_active.build_flags}
; *** Fix [email protected] induced undesired all warnings
build_unflags = -Wall
; set CPU frequency to 80MHz (default) or 160MHz
board_build.f_cpu = 80000000L
;board_build.f_cpu = 160000000L
monitor_speed = 115200
monitor_flags = --filter=esp8266_exception_decoder
#upload_speed = 230400
upload_speed = 921600
upload_resetmethod = nodemcu
extra_scripts = scripts/extra_script.py
; *********************************************************************
[env:emonesp]
platform = ${common.platform}
framework = ${common.framework}
board = huzzah
lib_deps = ${common.lib_deps}
src_build_flags =
${common.version}
-DENABLE_DEBUG
-DCONTROL_PIN=5
-DCONTROL_PIN_ON_STATE=LOW
-DENABLE_DEBUG_EMONCMS
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
build_flags = ${common.build_flags}
build_unflags = ${common.build_unflags}
build_type = debug
monitor_speed = ${common.monitor_speed}
monitor_flags = ${common.monitor_flags}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = ${common.upload_speed}
extra_scripts = ${common.extra_scripts}
[env:emonesp_debug]
extends = env:emonesp
build_flags = ${common.build_flags} -DDEBUG_PORT=Serial
# Sonoff S20 Smartplug, see 'sonoffS20.md'
[env:smartplug]
platform = ${common.platform}
framework = ${common.framework}
board = sonoff_s20
lib_deps = ${common.lib_deps}
src_build_flags =
${common.version}
-DESP01
-DENABLE_DEBUG
-DSMARTPLUG
-DNODE_TYPE='"smartplug"'
-DNODE_DESCRIPTION='"Sonoff Smartplug"'
-DWIFI_LED=13
-DCONTROL_PIN=12
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
board_build.ldscript = eagle.flash.1m.ld
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags}
monitor_speed = ${common.monitor_speed}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = ${common.upload_speed}
extra_scripts = ${common.extra_scripts}
# MQTT WiFi relay https://guide.openenergymonitor.org/integrations/mqtt-relay/
[env:wifirelay]
platform = ${common.platform}
framework = ${common.framework}
board = esp12e
lib_deps = ${common.lib_deps}
src_build_flags =
${common.version}
-DENABLE_DEBUG
-DWIFIRELAY
-DNODE_TYPE='"wifirelay"'
-DNODE_DESCRIPTION='"WiFi Relay"'
-DWIFI_LED=16
-DWIFI_LED_ON_STATE=HIGH
-DCONTROL_PIN=5
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
board_build.ldscript = eagle.flash.2m.ld
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags}
monitor_speed = ${common.monitor_speed}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = ${common.upload_speed}
extra_scripts = ${common.extra_scripts}
# Heat Pump Monitor https://github.com/openenergymonitor/HeatpumpMonitor
[env:hpmon]
platform = ${common.platform}
framework = ${common.framework}
board = esp12e
lib_deps = ${common.lib_deps}
src_build_flags =
${common.version}
-DENABLE_DEBUG
-DHPMON
-DNODE_TYPE='"hpmon"'
-DNODE_DESCRIPTION='"Heatpump Monitor"'
-DWIFI_LED=2
-DCONTROL_PIN=5
-DVOLTAGE_OUT_PIN=4
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags}
monitor_speed = ${common.monitor_speed}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = ${common.upload_speed}
extra_scripts = ${common.extra_scripts}
[env:esp12e]
platform = ${common.platform}
framework = ${common.framework}
board = esp12e
lib_deps = ${common.lib_deps}
src_build_flags = ${common.version} -DENABLE_DEBUG
board_build.flash_mode = ${common.board_build.flash_mode}
board_build.f_cpu = ${common.board_build.f_cpu}
build_flags = ${common.build_flags}
build_unflags = ${common.build_unflags}
monitor_speed = ${common.monitor_speed}
upload_resetmethod = ${common.upload_resetmethod}
upload_speed = ${common.upload_speed}
extra_scripts = ${common.extra_scripts}