Description
Describe the problem
It may sometimes be necessary to integrate user provided information (e.g., a password) into the command used to upload a sketch to an Arduino board.
This capability is provided by the "user provided fields" system.
The Arduino IDE collects the user input for uploads that have "user provided fields" via the "Configure And Upload" dialog (#550):
As a flexible general purpose system, no assumptions may be made about what data is appropriate for the fields. It is the responsibility of each upload tool to validate the data.
🐛 The "Configure And Upload" dialog inappropriately requires that the fields not be empty. There are use cases where an empty field is correct and expected.
To reproduce
Equipment
- Any board that supports unauthenticated upload over a network port.
Examples:- Any ESP8266-based board
- Any ESP32-based board
Steps
-
Follow the tutorial to set up your chosen board for uploading over a network port.
- ESP8266-based board: - https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#application-example)
- ESP32-based board: File > Examples > ArduinoOTA > BasicOTA
❗ Do not set a password in the sketch (this is the default configuration of the "BasicOTA" example sketch of the "ArduinoOTA" library).
-
Wait for the network port to appear in the Arduino IDE ports list.
-
Select the board and port in the Arduino IDE.
-
Select Sketch > Configure and Upload from the Arduino IDE menus.
ⓘ The standard "Upload" will have the same effect on the first upload of the IDE session, sketch, port. Configure and Upload is used in the instructions to ensure the dialog will appear even if the demo is repeated. -
Leave the "Password" field empty, as is the intuitive choice when no password is needed.
🐛 The "UPLOAD" button is disabled. The only way to accomplish an upload is through the unintuitive user action of adding arbitrary text to the "Password" field in order to satisfy the requirement imposed inappropriately by the IDE.
Expected behavior
"UPLOAD" button is enabled in the "Configure and Upload" dialog even if a field is left empty.
Arduino IDE version
2.0.0-snapshot-42f6f43
Operating system
Windows, Linux
Operating system version
Windows 10, Ubuntu 20.04
Additional context
With the inflexible network port-specific system used by Arduino IDE 1.x, the board could specify that authentication was not required via an auth_upload
mDNS record. In this case, the password dialog was never presented in the first place.
Arduino CLI allows the field to be left empty.
Example of poor user experience resulting from current prevention of empty fields: https://forum.arduino.cc/t/ide-v2-0-cant-update-thru-ota-without-password/1034657
Workaround
- Add any arbitrary character(s) to the optional field.
- Click the "UPLOAD" button.
Related
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details