File tree 2 files changed +13
-18
lines changed
2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
22
22
"fmt"
23
23
"os"
24
24
"sort"
25
- "strings"
26
25
27
26
"github.com/arduino/arduino-cli/cli/errorcodes"
28
27
"github.com/arduino/arduino-cli/cli/feedback"
@@ -96,22 +95,6 @@ func runMassUploadCommand(flags *massUploadFlags) error {
96
95
})
97
96
98
97
feedback .PrintResult (massUploadResult {resp })
99
-
100
- var failed []string
101
- for _ , r := range resp {
102
- if r .Err != nil {
103
- failed = append (failed , r .ID )
104
- }
105
- }
106
- if len (failed ) == 0 {
107
- return nil
108
- }
109
- failDevs := strings .Join (failed , "," )
110
- feedback .Printf (
111
- "You can try to perform the OTA again on the failed devices using the following command:\n " +
112
- "$ arduino-cloud-cli ota mass-upload --file %s --fqbn %s -d %s" ,
113
- params .File , params .FQBN , failDevs ,
114
- )
115
98
return nil
116
99
}
117
100
Original file line number Diff line number Diff line change 32
32
esac
33
33
done
34
34
35
+ if [[ " $firmwarefile " == " " || " $tag " == " " || " $waittime " == " " ]]; then
36
+ echo " Usage: $0 -t <tag> -f <firmwarefile> [-o <waittime>] [-v <new firmware version>]"
37
+ exit 1
38
+ fi
39
+
35
40
echo " Starting OTA process for devices with tag \" $tag \" using firmware \" $firmwarefile \" "
36
41
echo " "
37
42
@@ -52,12 +57,14 @@ fqbncount=$(echo $devicelistjson | jq '.[] | .fqbn' | sort | uniq | wc -l)
52
57
if [ " $fqbncount " -gt 1 ]; then
53
58
echo " Mixed FQBNs detected. Please ensure all devices have the same FQBN."
54
59
fqbns=$( echo $devicelistjson | jq ' .[] | .fqbn' | sort | uniq)
55
- echo " Detected FQBNs: $fqbns "
60
+ echo " Detected FQBNs:"
61
+ echo " $fqbns "
56
62
exit 1
57
63
fi
58
64
59
65
fqbn=$( echo $devicelistjson | jq -r ' .[] | .fqbn' | sort | uniq | head -n 1)
60
66
67
+ echo " Sending OTA request to detected boards of type $fqbn ..."
61
68
otastartedout=$( arduino-cloud-cli ota mass-upload --device-tags $tag --file $firmwarefile -b $fqbn --format json)
62
69
if [ $? -ne 0 ]; then
63
70
echo " Detected error during OTA process. Exiting..."
66
73
67
74
otaids=$( echo $otastartedout | jq -r ' .[] | .OtaStatus | .id' | uniq | paste -sd " ," -)
68
75
76
+ if [ $otaids == " null" ]; then
77
+ echo " No OTA processes to monitor. This could be due to an upgrade from previous ArduinoIotLibrary versions. Exiting..."
78
+ exit 0
79
+ fi
80
+
69
81
while [ $waittime -gt 0 ]; do
70
82
echo " Waiting for $waittime seconds for OTA process to complete..."
71
83
sleep 15
You can’t perform that action at this time.
0 commit comments