11/*
22 OTA
33
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
713
814*/
915
@@ -30,9 +36,9 @@ void setup() {
3036 ; // wait for serial port to connect. Needed for native USB port only
3137 }
3238
33- // check for the WiFi module:
39+ // check for the Wi-Fi module:
3440 if (WiFi.status () == WL_NO_MODULE) {
35- Serial.println (" Communication with WiFi module failed!" );
41+ Serial.println (" Communication with Wi-Fi module failed!" );
3642 // don't continue
3743 while (true );
3844 }
@@ -42,10 +48,10 @@ void setup() {
4248 Serial.println (" Please upgrade the firmware" );
4349 }
4450
45- Serial.print (" Current WIFi firmware version: " );
51+ Serial.print (" Current Wi-Fi firmware version: " );
4652 Serial.println (fv);
4753
48- // attempt to connect to WiFi network:
54+ // attempt to connect to Wi-Fi network:
4955 while (status != WL_CONNECTED) {
5056 Serial.print (" Attempting to connect to SSID: " );
5157 Serial.println (ssid);
@@ -56,7 +62,7 @@ void setup() {
5662 delay (1000 );
5763 }
5864
59- printWifiStatus ();
65+ printWiFiStatus ();
6066
6167 OTAUpdate::Error ret = OTAUpdate::Error::None;
6268 ret = ota.begin ();
@@ -102,13 +108,13 @@ void loop() {
102108/* -------------------------------------------------------------------------- */
103109
104110 String fv = WiFi.firmwareVersion ();
105- Serial.print (" Updated WiFi firmware version: " );
111+ Serial.print (" Updated Wi-Fi firmware version: " );
106112 Serial.println (fv);
107113 delay (1000 );
108114}
109115
110116/* -------------------------------------------------------------------------- */
111- void printWifiStatus () {
117+ void printWiFiStatus () {
112118/* -------------------------------------------------------------------------- */
113119 // print the SSID of the network you're attached to:
114120 Serial.print (" SSID: " );
0 commit comments