Hi, I have new R4, can load simple sketches via USB fine. Now trying OTA. Examples, Examples from Custom Libraries, ArduinoOTA, WiFi101_OTA. Changed WiFiNINA to WiFiS3, added WiFi credentials. Loaded sketch via USB. On Serial monitor can see it connected to WiFi, and IP address 192.168.1.27.
On Arduino IDE change port to "Arduino at 192.168.1.27", ^u, compiles alright, "Failed uploading, no upload port provided". PC is Windows 10 Home 22H2, firewall off. IDE is 2.2.1.
Another PC, W7, IDE 1.8.18. After ^u the password dialogue appears. Whatever I enter in that 'password' or abc etc. there's a message in the console and nothing more. "No device found on 192.168.1.27"
Thanks, I have not done that. Regret that does not tell me specifically what to do. For platform.local.txt I see 10 of them e.g. ...Arduino\libraries\ArduinoOTA\extras\esp32\platform.local.txt. There is no "R4" directory, so it might be ESP32 or renesas, but which?
Where to copy it? Under ...AppData\Local\Arduino15\packages there is arduino, builtin, esp32, esp8266. Other topics indicate the file should go in arduino15/packages/esp32/hardware/esp32/1.0.4, but my esp32 has no hardware directory.
It’s working! I can reliably load the sketch OTA to my Arduino R4 Wifi. Thank you @Juraj.
Windows 7. Arduino IDE 1.8.18 or Windows 10, Arduino IDE 2.2.1
Install Arduino UNO R4 Boards (1.0.5)
Select Ardunio UNO R4 WiFi
Install library ArduinoOTA (1.0.12)
Example WiFi101_OTA
Change WiFiNINA.h to WiFiS3.h
Copy \libraries\ArduinoOTA\extras\renesas\platform.local.txt
o To %userprofile%\AppData\Local\Arduino15\packages\arduino\hardware\renesas_uno\1.0.5\
Restart IDE
Select port (e.g.) “Arduino at 192.168.1.27”
^u
Password: password
There are a few ways it can fail to work or be confused.
At one point the R4 was not connecting to WiFi every time. (Caused by a new WiFi repeater that I was testing then removed). The Arduino IDE is not very live with its port information, and continues to attempt OTA update when the R4 is not pingable. Use ping to check R4 is connected.
The IDE using OTA puts up the password dialogue. It doesn’t do it every time, perhaps it caches the information. It sometimes asks when the R4 is not on the network, so don’t take it as proof of connection.
At one point the IDE was showing “Arduino at 0.0.0.0”. Fixed either by rebooting the computer, or another instance of the IDE had the IP address, so close one sketch and re-open it from the other IDE.
After my last post everything was working well. I was making small changes to the program, playing with the features of the R4 and reloading frequently. Sadly the end of the day arrived and I hibernated the PCs. The next day tried to continue, but nothing worked. After much rebooting and retrying the OTA load worked again on the W7 PC while still refusing on the W10 (so the problem is in the PC or IDE not the R4).
Today using the W7 PC the OTA load said it had failed, but I realised the new sketch was loaded and running. Now I’ve noticed this, I can see it happens quite often. To show whether the load is successful I’ve resolved always to put a visible change in the program, e.g. different led pattern. If there is a web page, then the macro __TIME__ in the web-page text makes this easy. This successful load can happen before or after the first password dialogue.
There is another way the OTA load can fail. This one is fixed by switching the PC WiFi on and off. Then it loads, but said it had failed.
...
Global variables use 10624 bytes (32%) of dynamic memory, leaving 22144 bytes for local variables. Maximum is 32768 bytes.
processing.app.debug.RunnerException: Unable to connect to 192.168.1.27
at cc.arduino.packages.uploaders.SSHUploader.uploadUsingPreferences(SSHUploader.java:148)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2061)
at java.lang.Thread.run(Thread.java:748)
Unable to connect to 192.168.1.27
- Switched the laptop WiFi off and on.
...
C:\Programs\Arduino\hardware\tools\avr/bin/arduinoOTA -address 192.168.1.27 -port 65280 -username arduino -password password -sketch C:\Users\RDL_AD~1\AppData\Local\Temp\arduino_build_562013/UNO_R4_Dev.ino.bin -upload /sketch -b
Connecting to board ... done
Uploading sketch ... done
Flashing sketch ... done ! R4 is running the new sketch.
Error flashing the sketch
- Showing password dialogue