Hi, I’ve been reading pretty much every post on this subject, but couldn’t find an answer.
My goal is to be able to update my sketch to a Arduino Uno R4 WiFi over OTA like I do with my Arduino Nano ESP32.
I’m on Arduino IDE 2.3.8. I use the ArduinoOTA library from Juraj Andrassy. I followed all instructions to place platform.local.txt in the “~\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.5.3” folder. I also replaced arduinoOTA.exe in folder “~\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0\bin” with the downloaded version 1.4.1 and modified platform.local.txt file to add “-t 30”.
The board appears in the Tools/network ports only for a brief moment, specially right after boot/load. During this brief period of time, I managed to successfully upload the sketch via OTA. The problem is that the board network port doesn’t permanently show.
In another post, @ptillisch provides a procedure to diagnose with mdns-discovery. I followed it and during the SYNC section, I see the board being added and removed without powering on or off the board.
It would be nice to find a fix for mdns discovery.
On the other hand, I’m ready to consider the fake programmer option, but the lines to be copied from platform.local.txt to programmers.txt doesn’t match the different readme and posts I’ve seen. So I’d like to ask for help on that matter.
Select File > Examples > ArduinoOTA > WiFi101_OTA from the Arduino IDE menus.
Change this line in the sketch:
#include <WiFiNINA.h>
to this:
#include <WiFiS3.h>
Select the "arduino_secrets.h" tab.
Enter the SSID and password of your Wi-Fi access point into the file.
Connect the UNO R4 WiFi board to your computer with a USB cable.
Select the serial port of the board from Arduino IDE's Tools > Port menu.
Select Sketch > Upload from the Arduino IDE menus.
Does the problem still occur when the board is running that example sketch?
The purpose of this experiment is to determine whether the problem might be caused by code in the project sketch you had running on the board at the time you encountered the fault. If the fault does not occur when running the "known good" sketch, then that would indicate the problem is caused by the code in the previous sketch. Conversely, if the fault still occurs even when running the "known good" sketch, that would indicate that we don't need to consider the sketch code as a possible cause.
It is true that mdns-discovery is not reliable. However, the problem is generally that the board is never discovered at all. The symptom you describe:
sounds like something different. It might be:
The sketch program crashes or otherwise disables the network functionality
The power supply to the board is insufficient to support reliable operation of the fairly power hungry Wi-Fi radio
I loaded WiFi101_OTA on my board and the OTA network port seems more stable. So it’s probably like you said:
When not connected to the USB port on my PC, I use a 30W (5V-3A) power supply during testing or a 70A 12V regulated power supply during operation. So, I don’t think the power supply is the issue.
As soon as I load my sketch, the OTA network port disappears.
After commenting the MQTT connection part of my code, the OTA network port stabilizes.
In my test environment, the MQTT broker is not reachable, so I’ll try tomorrow in the production environment to see if it fixes the issue.
I understand that, but unfortunately the example sketch does not since it is written for use with the boards like the Arduino MKR WiFi 1010, not the UNO R4 WiFi. So it is necessary to make this adjustment so that it can be used with the UNO R4 WiFi.
Great news!
If you like, you can post the code of the sketch that was running on the board at the time you encountered the problem. The forum helpers may be able to identify the specific code that caused the problem.
@ptillisch, I moved my board to the final environment and it doesn’t work. I don’t see any activity via mdns.discovery.
My final environment is a RV where the router is a TP-Link travel router. It’s not clear whether this router is compatible with mDNS.
It would be nice to fix the mDNS issue, but the router works great to provide a main eth connection while docked at home and a USB-phone LTE/5G backup while travelling. So changing it is not an option.
So my fallback would be the “fake” programmer route. Can you help me with this?
From the readme, I have to copy the last part of platform.local.txt to programmers.txt:
## arduinoOTA as programmer. add entries with {ip} into programmers.txt
tools.arduinoOTA.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.arduinoOTA.program.params.verbose=
tools.arduinoOTA.program.params.quiet=
tools.arduinoOTA.program.pattern="{cmd}" -v -address {ip} -port 65280 -username arduino -password password -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b -t 30