1
1
/*
2
2
OTA
3
3
4
- This sketch demonstrates how to make an self OTA Update the UNO R4 WiFi Firmware
5
- Upload the Sketch and wait for Serial detach.
6
- After the update the new wifi firmware version will be 98.98.98
4
+ This sketch demonstrates how to make the UNO R4 WiFi self-update its Wi-Fi module
5
+ firmware via OTA. Upload the Sketch and wait for Serial detach. After the update
6
+ the new Wi-Fi firmware version will be 98.98.98
7
+
8
+ WARNING: running this sketch will load a test Wi-Fi firmware version on the UNO R4
9
+ WiFi module. To restore a production firmware use the Arduino Firmware Uploader or
10
+ the update packages available here:
11
+
12
+ https://github.com/arduino/uno-r4-wifi-usb-bridge/releases
7
13
8
14
*/
9
15
@@ -30,9 +36,9 @@ void setup() {
30
36
; // wait for serial port to connect. Needed for native USB port only
31
37
}
32
38
33
- // check for the WiFi module:
39
+ // check for the Wi-Fi module:
34
40
if (WiFi.status () == WL_NO_MODULE) {
35
- Serial.println (" Communication with WiFi module failed!" );
41
+ Serial.println (" Communication with Wi-Fi module failed!" );
36
42
// don't continue
37
43
while (true );
38
44
}
@@ -42,10 +48,10 @@ void setup() {
42
48
Serial.println (" Please upgrade the firmware" );
43
49
}
44
50
45
- Serial.print (" Current WIFi firmware version: " );
51
+ Serial.print (" Current Wi-Fi firmware version: " );
46
52
Serial.println (fv);
47
53
48
- // attempt to connect to WiFi network:
54
+ // attempt to connect to Wi-Fi network:
49
55
while (status != WL_CONNECTED) {
50
56
Serial.print (" Attempting to connect to SSID: " );
51
57
Serial.println (ssid);
@@ -56,7 +62,7 @@ void setup() {
56
62
delay (1000 );
57
63
}
58
64
59
- printWifiStatus ();
65
+ printWiFiStatus ();
60
66
61
67
OTAUpdate::Error ret = OTAUpdate::Error::None;
62
68
ret = ota.begin ();
@@ -102,13 +108,13 @@ void loop() {
102
108
/* -------------------------------------------------------------------------- */
103
109
104
110
String fv = WiFi.firmwareVersion ();
105
- Serial.print (" Updated WiFi firmware version: " );
111
+ Serial.print (" Updated Wi-Fi firmware version: " );
106
112
Serial.println (fv);
107
113
delay (1000 );
108
114
}
109
115
110
116
/* -------------------------------------------------------------------------- */
111
- void printWifiStatus () {
117
+ void printWiFiStatus () {
112
118
/* -------------------------------------------------------------------------- */
113
119
// print the SSID of the network you're attached to:
114
120
Serial.print (" SSID: " );
0 commit comments