-
Notifications
You must be signed in to change notification settings - Fork 0
/
wvr.sh
77 lines (76 loc) · 3.63 KB
/
wvr.sh
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
#!/bin/bash
if [ "$1" == "site" ]; then
cd react && \
npm run build && \
cd ../.. && \
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
curl --data-binary "@/Users/temporary/Documents/Arduino/wvr_0.3/build/esp32.esp32.esp32wrover/wvr_0.3.ino.bin" http://192.168.4.1/update --header "content-type:text/plain" ; \
echo "done"
elif [ "$1" == "code" ]; then
echo "compiling"
cd .. && \
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
curl --data-binary "@/Users/temporary/Documents/Arduino/wvr_0.3/build/esp32.esp32.esp32wrover/wvr_0.3.ino.bin" http://192.168.4.1/update --header "content-type:text/plain" ; \
echo "done"
elif [ "$1" == "codenodev" ]; then
echo "compiling"
cd .. && \
arduino-cli compile -e --build-property build.code_debug=1 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
curl --data-binary "@/Users/temporary/Documents/Arduino/wvr_0.3/build/esp32.esp32.esp32wrover/wvr_0.3.ino.bin" http://192.168.4.1/update --header "content-type:text/plain" ; \
echo "done"
elif [ "$1" == "compile" ]; then
echo "compiling"
cd .. && \
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation"
elif [ "$1" == "compilenodev" ]; then
echo "compiling"
cd .. && \
arduino-cli compile -e --build-property build.code_debug=0 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation"
elif [ "$1" == "compilewithsite" ]; then
echo "compiling website"
cd react && \
npm run build && \
cd ../.. && \
echo "compiling binary"
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation"
elif [ "$1" == "compilewithsitenodev" ]; then
echo "compiling website"
cd react && \
npm run build && \
cd ../.. && \
echo "compiling binary"
arduino-cli compile -e --build-property build.code_debug=0 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation"
elif [ "$1" == "flash" ]; then
cd .. && \
echo "uploading" && \
curl --data-binary "@/Users/temporary/Documents/Arduino/wvr_0.3/build/esp32.esp32.esp32wrover/wvr_0.3.ino.bin" http://192.168.4.1/update --header "content-type:text/plain" ; \
echo "done"
elif [ "$1" == "ftdi" ]; then
cd .. && \
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
arduino-cli upload -p /dev/cu.usbserial-A50285BI --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done"
elif [ "$1" == "ftdinodev" ]; then
cd .. && \
arduino-cli compile -e --build-property build.code_debug=1 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
arduino-cli upload -p /dev/cu.usbserial-A50285BI --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done"
elif [ "$1" == "test" ]; then
echo "compiling"
cd .. && \
arduino-cli compile -e --build-property build.code_debug=5 --fqbn esp32:esp32:esp32wrover wvr_0.3 && \
echo "done compilation, uploading" && \
curl --data-binary "@/Users/temporary/Documents/Arduino/wvr_0.3/build/esp32.esp32.esp32wrover/wvr_0.3.ino.bin" http://192.168.4.1/addfirmware --header "content-type:text/plain" --header "name:test_update" --header "size:100000" ; \
echo "done"
else
echo "please use one of flags : site, code, or flash"
fi