-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·39 lines (33 loc) · 1.03 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·39 lines (33 loc) · 1.03 KB
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
#!/bin/bash
# deploy.sh — compile and OTA-flash both Pencreus boards over WiFi
# Usage: ./deploy.sh (flash both)
# ./deploy.sh 1 (flash pencreus-1 only)
# ./deploy.sh 2 (flash pencreus-2 only)
set -e
FQBN="esp32:esp32:esp32s3:FlashSize=16M,PartitionScheme=app3M_fat9M_16MB,PSRAM=opi,UploadSpeed=921600"
SKETCH="ESP32_RLCD_Display/ESP32_RLCD_Display.ino"
BUILD_DIR="/tmp/pencreus-build"
OTA_PASS="pencreus"
TARGET="${1:-both}"
echo "==> Compiling..."
arduino-cli compile --fqbn "$FQBN" --output-dir "$BUILD_DIR" "$SKETCH"
flash_board() {
local host="$1"
echo "==> Flashing $host..."
arduino-cli upload \
--fqbn "$FQBN" \
--port "$host" \
--protocol network \
--upload-field password="$OTA_PASS" \
--input-dir "$BUILD_DIR"
echo " $host done."
}
if [[ "$TARGET" == "1" ]]; then
flash_board "pencreus-1.local"
elif [[ "$TARGET" == "2" ]]; then
flash_board "pencreus-2.local"
else
flash_board "pencreus-1.local"
flash_board "pencreus-2.local"
fi
echo "==> All done."