In order to test the OTA functionality of my Uno R4 WiFi under the IDE 2.2.1 I have modified the Blink example to incorporate the OTA functionality of the library ArduinoOTA. The sketch looks like this:
/*
BlinkOTA The blink example with added OTA
*/
#include <SPI.h>
#include <WiFiS3.h>
#include <ArduinoOTA.h>
#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
/////// Wifi Settings ///////
char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password
int status = WL_IDLE_STATUS;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
while (true)
;
}
// attempt to connect to Wifi network:
while (status != WL_CONNECTED) {
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid, pass);
}
// start the WiFi OTA library with internal (flash) based storage
ArduinoOTA.begin(WiFi.localIP(), "Arduino", "123", InternalStorage);
}
void loop() {
// check for WiFi OTA updates
ArduinoOTA.poll();
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
After uploading via USB I can select the WiFi port instead of the USB port. The first time I click on upload after selecting the WiFi port a popup requests the password. After entering the password the OTA upload runs successfully. Great!
However it I alter the delays and try and upload again the popup no longer appears and either the panel below show upload as being unsuccessfull or worse, the panel shows no progress and a popup appears saying the upload was successful even though it wasn't and the changes have no effect.
After much trial and error I have discovered that by changing the board under tools and then changing it back again to the R4 WiFi the password popup reappears and I can upload via OTA.
The bug has already been fixed. If you would like to get access to the fix immediately, you can use the latest nightly build of Arduino IDE. The nightly build download links are listed here:
Otherwise, you can continue to use the workaround, as you already discovered, until the next production release of Arduino IDE is made (which will contain the fix).
I don't understand why you have included these sketches in this thread. What does the ESP8266WiFI and ESP8266mDNS libraries have to do with the Uno R4 WiFi ?
Klauzula poufności. Ta wiadomość pocztowa i wszelkie załączone do niej pliki są poufne i podlegają ochronie prawnej. Jeśli nie jesteś jej prawidłowym adresatem, jakiekolwiek wykorzystanie w tym zapoznanie się z treścią przesłanych informacji, jej ujawnienie, reprodukcja, dystrybucja lub inne rozpowszechnienie, są ściśle zabronione. Jeśli otrzymał/a Pan/i niniejszy przekaz wskutek błędu, proszę o niezwłocznie powiadomienie nadawcy i usunięcie otrzymanych informacji. Kontakt: Uniwersytet Medyczny w Łodzi, 90–419 Łódź, Al. Kościuszki 4, Rektorat – Centrala, Tel. 42 272 59 66 umed.lodz.pl Confidentiality Notice - This e-mail is confidential, may be legally privileged. If you are not the intended recipient, you may not use, disclosure, distribute, copy, print or rely on this e-mail. If you received this e-mail in error, please notify the sender and delete the material from any computer.Contact:Medical University of Lodz, 90–419 Lodz, POLAND, 4 Kosciuszki Avenue, Rector’s Office, phone 0048 42 272 59 66 umed.lodz.pl