Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close serial port connection before flashing firmware #688

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

AlbyIanna
Copy link
Contributor

Fixes #684

@AlbyIanna
Copy link
Contributor Author

This PR fixes the issue (you can flash the firmware when the serial monitor/plotter is open), but a little problem remains: when you flash the firmware to a board, the sketch on the board is replaced with the code necessary to do the update, so re-opening the serial port is pretty much pointless. I wonder if this impacts the experience
cc: @per1234 @ubidefeo

@per1234
Copy link
Contributor

per1234 commented Dec 15, 2021

re-opening the serial port is pretty much pointless. I wonder if this impacts the experience

I don't think so. The reason is that if I am working with the Serial Monitor before doing a firmware update, I am likely to want to go back to working with Serial Monitor again after. So it is convenient for Serial Monitor to remain open, even though there will be no output until I have uploaded my sketch again.

The firmware updater already displays a warning about the sketch being overwritten, so the user shouldn't be surprised to find that no output is arriving in the Serial Monitor. However, they would find it confusing to see the "Not connected" banner persist in Serial Monitor after finishing a firmware update, since that could give the impression that something is wrong.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #684 for me. Thanks @AlbyIanna!

`${firmware.module}@${firmware.firmware_version}`,
]);
this.serialService.uploadInProgress = true;
await this.serialService.disconnect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, you can move this into the try block. If disconnect fails, the IDE won't stuck in the uploadInProgress state. What do you think? Just a proposal, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks, @kittaakos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firmware update fails if Serial Monitor is open
4 participants