Upload Using Programmer does OTA upload instead when a network port is selected
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
Using Arduino IDE 1.8.14 Hourly Build 2021/03/09 09:33, Windows 10 Pro x64
### Steps to reproduce
1. Connect a board to your network that will produce a port under the Arduino IDE's **Tools > Port > Network ports** section. This could be an Arduino Yun, ESP8266 (info [here](https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html)), etc..
2. Select the network port from the **Tools > Port** menu.
3. **Tools > Board > Arduino AVR Boards > Arduino Uno** (or any arbitrary board)
4. **Tools > Programmer > USBasp** (or any arbitrary programmer that doesn't use a serial port). For the purpose of this demonstration it doesn't matter whether you actually have the programmer attached to the computer.
5. **Sketch > Upload Using Programmer**
The expected behavior is for the upload process to use [the platform's `program.pattern` recipe](https://github.com/arduino/ArduinoCore-avr/blob/1.8.3/platform.txt#L113). Instead, it uses [the `upload.network_pattern` recipe](https://github.com/arduino/ArduinoCore-avr/blob/1.8.3/platform.txt#L125). Resulting in an error like:
```
C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0/bin/arduinoOTA -address 192.168.254.14 -port {upload.network.port} -sketch C:\Users\per\AppData\Local\Temp\arduino_build_374412/sketch_apr04a.ino.hex -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return}
Resetting the board
Failed to reset the board, upload failed
An error occurred while uploading the sketch
```
The only way to get the expected behavior is by selecting an arbitrary serial port from the **Tools > Port** menu, which might not be possible if your computer doesn't happen to have a serial port.
Contributor guide
Research direction
Reproduce the five steps with a network port selected and compare the platform's program.pattern recipe with upload.network_pattern in platform.txt. Trace the IDE entry point that chooses the upload recipe for Upload Using Programmer; done means the selected programmer uses program.pattern and no longer invokes arduinoOTA for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, java
- Domain
- embedded-iot, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100