arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.21k stars 379 forks source link

Display output from Arduino Firmware Uploader #2220

Open per1234 opened 1 year ago

per1234 commented 1 year ago

Describe the request

Print the output from the arduino-fwuploader invocations to the IDE's "Output" panel.

🙂 It will be easier for the user to troubleshoot problems that might occur during the process. 🙂 Target-specific usage advice will be visible to the user.

Describe the current behavior

Arduino IDE's "Firmware Updater" and "Upload SSL Root Certificates" features allow the user to update the supplemental modules found on some Arduino boards. These features use the Arduino Firmware Uploader command line tool.

As with any other complex technical operation, the process might fail for a variety of reasons. For example:

Currently, the only feedback provided to the user when this happens is a generic message with advice that is not always helpful:

⚠ Installation failed. Please try again.

Even when the process is successful, it might be that the target-specific plugins print helpful usage advice. For example, this important message printed by Arduino Firmware Updater when targeting the UNO R4 WiFi board:

Upload completed! To complete the update process please disconnect and then reconnect the board.

🙁 The user doesn't receive any information about the cause of a failed operation in the Arduino IDE GUI. They must sift through the logs generated by the IDE to find any such information. 🙁 There is no way for important target-specific advice to be displayed to the user in the Arduino IDE GUI.

Arduino IDE version

73ddbefc3e22c65d00ff59cade57fda14af01818

Operating system

All

Operating system version

Any

Additional context

For the sake of transparency, I suggest also printing the arduino-fwuploader command to the output, as is done by Arduino IDE during the compilation and upload processes when verbose output is enabled. This information can be useful for troubleshooting and also helps advanced users to develop workflows using Arduino Firmware Uploader directly.

Additional Requests

Related

Issue checklist

dankeboy36 commented 1 year ago

Great idea!

Print the output

Do you prefer IDE to print the output at the end of the command, or does it want to provide the terminal feeling? For example, when there is some data on the process's stdout/stderr, should IDE update the Output?

If the latter, there is an overlay when the operation is running, and the dialog is visible. Is IDE happy updating the Output with the overlay, or is there a requirement to change the UX?

per1234 commented 1 year ago

Do you prefer IDE to print the output at the end of the command, or does it want to provide the terminal feeling? For example, when there is some data on the process's stdout/stderr, should IDE update the Output?

Streaming the Arduino Firmware Uploader output (as is done with the verbose compilation and upload output) would be ideal because it would provide the user with some indication of progress of the operation. But if that makes the feature significantly more difficult to implement then I think it would be fine to print all the collected output after the arduino-fwuploader command exits.

there is an overlay when the operation is running, and the dialog is visible. Is IDE happy updating the Output with the overlay, or is there a requirement to change the UX?

The idea behind this proposal was to leverage the existing user interface of Arduino IDE rather than having to find a way to communicate the information within the "Firmware Update" and "Upload SSL Root Certificates" dialogs.

I understand that it is maybe slightly unintuitive for the output to be printed to the underlying IDE window even though the operation is being performed by the user in a modal dialog. However, I don't think it will be too bad because the user is already accustomed to looking at the Output view for logs from various processes, including Library Manager and Boards Manager.

kittaakos commented 1 year ago

Here is the feature in action. I see tons of stdout (% when flashing), it could be nicer. The stderr variant is more helpful. If IDE2 needs it, I can finalize the feature.

stdout:

https://github.com/arduino/arduino-ide/assets/1405703/91a4f29e-93c4-4f7a-8b46-6dfa8104ab79

stderr:

https://github.com/arduino/arduino-ide/assets/1405703/6417b4e5-98e1-4597-a669-5926057fffcf

per1234 commented 1 year ago

I see tons of stdout (% when flashing)

This is due to https://github.com/arduino/arduino-ide/issues/1473

it could be nicer

Definitely, but I think sub-ideal output is still better than none at all.

The stderr variant is more helpful.

Just to make sure the requirements are clear, we need both stdout (most importantly because this is where any user instructions such as the need to power cycle the UNO R4 WiFi will be printed) and stderr (because this will be needed for troubleshooting failed attempts).

kittaakos commented 1 year ago

This is due to

sub-ideal output is still better than none at all.

we need both

OK, thanks! I wanted to make sure we are all aware of the new UX