-
Notifications
You must be signed in to change notification settings - Fork 3
/
platformio.ini
329 lines (295 loc) · 9.68 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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs =
#soilsensor_v0
#soilsensor_v1_L0
#soilsensor_v1_L4
#soilsensor_v2_L4
#distance_v1
#door_v1
#generic_basic_v1_debug
#tracker_v1
[base]
monitor_speed = 115200
framework = arduino
lib_ldf_mode = chain+
lib_deps =
MCCI LoRaWAN LMIC library @ ^4.1.1
CayenneLPP @ ^1.1.0
build_flags =
-D DEVICE_VERSION=8
-D DISABLE_PING
-D DISABLE_BEACONS
-D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS
-D CFG_eu868=1
-D CFG_sx1276_radio=1
;-D LMIC_USE_INTERRUPTS
!python3 tools/git_rev_macro.py
[base_debug]
build_type = debug
build_flags =
-D DEBUG
-D TX_INTERVAL=20
#-D LMIC_DEBUG_LEVEL=5
#-D NO_DEEP_SLEEP
-D DEBUG_DURING_SLEEP
-D RESET_SETTINGS
[stm32]
extends = base
platform = ststm32 # Latest production
#platform = https://github.com/platformio/platform-ststm32.git # dev version
upload_protocol = serial
UPLOAD_PORT=swd freq=480
upload_command =
STM32_Programmer_CLI -c port=$UPLOAD_PORT -w $SOURCE 0x8000000 -s
lib_deps =
${base.lib_deps}
STM32duino Low Power
build_flags =
${base.build_flags}
-D ADC_RESOLUTION=12
#-D LSE_CLOCK_ENABLED
-D IWDG_TIME_S=300 #Wathdog - it needs that IWDG_STOP fuse is unset
-D NO_DEBUG_DURING_SLEEP
############################################################################
# #
# Soil v0 #
# #
############################################################################
[env:soilsensor_v0]
extends = base
platform = atmelavr
board = pro8MHzatmega328
lib_deps =
${base.lib_deps}
Low-Power
Vector
build_flags =
${base.build_flags}
-D SENSOR_SOIL_AVR
-D SLEEP_ATMEGA
-D PIN_LORAWAN_NSS=6
-D PIN_LORAWAN_RST=5
-D PIN_LORAWAN_DIO0=2
-D PIN_LORAWAN_DIO1=3
-D PIN_LORAWAN_DIO2=4
-D RESET_SETTINGS
############################################################################
# #
# Soil v1 #
# #
############################################################################
[base_soilsensor_1]
extends = stm32
lib_deps =
${stm32.lib_deps}
https://github.com/angelnu/CapacitiveSensor.git
build_flags =
${stm32.build_flags}
-D SENSOR_SOIL_SMT32
-D PIN_LORAWAN_NSS=PA9
-D PIN_LORAWAN_RST=PA8
-D PIN_LORAWAN_DIO0=PA10
-D PIN_LORAWAN_DIO1=PA11
-D PIN_LORAWAN_DIO2=PA12
;[env:soilsensor_v1_L0] <- Too large for target
; extends = base_soilsensor_1
; board = nucleo_l053r8
; upload_command =
; python3 tools/init_lorawan_keys.py --name=$PIOENV --uid_address=0x1FF80050 --eeprom_address=0x08080000
; ${base_soilsensor_1.upload_command}
; build_flags =
; ${base_soilsensor_1.build_flags}
; -D PIN_CAPACITY_SEND=D47
; -D PIN_CAPACITY_READ=D46
; -UIWDG_TIME_S #L0 cannot dissable IWDG in stop mode - missing IWDG_STOP fuse
; [env:soilsensor_v1_L0_debug] <- Too large for target
; extends = env:soilsensor_v1_L0, base_debug,
; build_flags =
; ${env:soilsensor_v1_L0.build_flags}
; ${base_debug.build_flags}
[env:soilsensor_v1_L4]
extends = base_soilsensor_1
board = nucleo_l412kb
upload_command =
python3 tools/init_lorawan_keys.py --name=$PIOENV --uid_address=0x1FFF7590 --optionbytes IWDG_STOP=0x0
${base_soilsensor_1.upload_command}
build_flags =
${base_soilsensor_1.build_flags}
-D PIN_CAPACITY_SEND=PA1
-D PIN_CAPACITY_READ=PA0
-D PIN_CAPACITY_GROUND_0=PB0
-D PIN_CAPACITY_GROUND_1=PB1
-D PIN_SPI_MISO=PA6
-D PIN_SPI_MOSI=PA7
-D PIN_SPI_SCK=PA5
[env:soilsensor_v1_L4_debug]
extends = env:soilsensor_v1_L4, base_debug,
build_flags =
${env:soilsensor_v1_L4.build_flags}
${base_debug.build_flags}
############################################################################
# #
# Soil v2 #
# #
############################################################################
[base_soilsensor_2]
extends = stm32
lib_deps =
${stm32.lib_deps}
https://github.com/angelnu/CapacitiveSensor.git
build_flags =
${stm32.build_flags}
-D SENSOR_SOIL_SMT32
-D PIN_LORAWAN_NSS=PA4
-D PIN_LORAWAN_RST=PB0
-D PIN_LORAWAN_DIO0=PA10
-D PIN_LORAWAN_DIO1=PA11
-D PIN_LORAWAN_DIO2=PA12
-D PIN_CAPACITY_SEND=PB3
-D PIN_CAPACITY_READ=PA15
-D PIN_STATUS_LED=PB7
[env:soilsensor_v2_L4]
extends = base_soilsensor_2
board = nucleo_l412kb
upload_command =
python3 tools/init_lorawan_keys.py --name=$PIOENV --uid_address=0x1FFF7590 --optionbytes IWDG_STOP=0x0
${base_soilsensor_2.upload_command}
build_flags =
${base_soilsensor_2.build_flags}
-D PIN_SPI_MISO=PA6
-D PIN_SPI_MOSI=PA7
-D PIN_SPI_SCK=PA5
[env:soilsensor_v2_L4_debug]
extends = env:soilsensor_v2_L4, base_debug,
build_flags =
${env:soilsensor_v2_L4.build_flags}
${base_debug.build_flags}
############################################################################
# #
# Generic v1 #
# #
############################################################################
[generic_v1]
extends = stm32
board = nucleo_l412kb
upload_command =
python3 tools/init_lorawan_keys.py --name=$PIOENV --uid_address=0x1FFF7590 --optionbytes IWDG_STOP=0x0
${stm32.upload_command}
lib_deps =
${stm32.lib_deps}
build_flags =
${stm32.build_flags}
-D PIN_LORAWAN_NSS=PA4
-D PIN_LORAWAN_RST=PB0
-D PIN_LORAWAN_DIO0=PA10
-D PIN_LORAWAN_DIO1=PA11
-D PIN_LORAWAN_DIO2=PA12
-D PIN_STATUS_LED=PB1
-D PIN_SPI_MISO=PA6
-D PIN_SPI_MOSI=PA7
-D PIN_SPI_SCK=PA5
############################################################################
# Basic v1 #
############################################################################
[env:generic_basic_v1]
extends = generic_v1
build_flags =
${generic_v1.build_flags}
-D SENSOR_GENERIC_BASIC_SMT32
[env:generic_basic_v1_debug]
extends = env:generic_basic_v1, base_debug,
build_flags =
${env:generic_basic_v1.build_flags}
${base_debug.build_flags}
############################################################################
# Distance v1 #
############################################################################
[env:distance_v1]
extends = generic_v1
lib_deps =
${generic_v1.lib_deps}
#pololu/vl53l1x-arduino
sparkfun/SparkFun VL53L1X 4m Laser Distance Sensor
build_flags =
${generic_v1.build_flags}
-D SENSOR_GENERIC_DISTANCE_SMT32
-D PIN_LIDAR_POWER=PB5
[env:distance_v1_debug]
extends = env:distance_v1, base_debug,
build_flags =
${env:distance_v1.build_flags}
${base_debug.build_flags}
############################################################################
# Door v1 #
############################################################################
[env:door_v1]
extends = generic_v1
build_flags =
${generic_v1.build_flags}
-D SENSOR_GENERIC_DOOR_SMT32
-D PIN_DOOR_1=PB5
-D PIN_DOOR_1_RESET=PB4
-D PIN_DOOR_2=PB3
-D PIN_DOOR_2_RESET=PA15
#-D PIN_DOOR_3=PA0
#-D PIN_DOOR_3_RESET=PA1
#-D PIN_DOOR_4=PA8
#-D PIN_DOOR_4_RESET=PA9
[env:door_v1_debug]
extends = env:door_v1, base_debug,
build_flags =
${base_debug.build_flags}
${env:door_v1.build_flags}
############################################################################
# Basic v1 #
############################################################################
[env:generic_OTA_v1]
extends = generic_v1
build_flags =
${generic_v1.build_flags}
-D SENSOR_GENERIC_BASIC_SMT32
[env:generic_OTA_v1_debug]
extends = env:generic_OTA_v1, base_debug,
build_flags =
${env:generic_OTA_v1.build_flags}
${base_debug.build_flags}
############################################################################
# #
# Tracker v1 #
# #
############################################################################
[env:tracker_v1]
extends = generic_v1
lib_deps =
${generic_v1.lib_deps}
#pololu/vl53l1x-arduino
sparkfun/SparkFun VL53L1X 4m Laser Distance Sensor
sparkfun/SparkFun u-blox Arduino Library
#Adafruit LIS3DH
Wire
SPI
lib_extra_dirs = extra_libs/STMems_Standard_C_drivers/lis3dh_STdC
build_flags =
${generic_v1.build_flags}
-D SENSOR_GENERIC_TRACKER_SMT32
-D PIN_LIDAR_POWER=PB3
-D PIN_GPS_POWER=PB4
-D PIN_GPS_BAT_POWER=PB5
-D PIN_ACCEL_INT1=PA0
-D PIN_ACCEL_INT2=PA1
-D PIN_ACCEL_SDO=PA8
[env:tracker_v1_debug]
extends = env:tracker_v1, base_debug,
build_flags =
${env:tracker_v1.build_flags}
${base_debug.build_flags}
-D GPS_MIN_SATELITES=0