Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Pause serial monitor during (serial) upload #45

Closed
jthomaschewski opened this issue Feb 18, 2016 · 7 comments
Closed

Pause serial monitor during (serial) upload #45

jthomaschewski opened this issue Feb 18, 2016 · 7 comments
Milestone

Comments

@jthomaschewski
Copy link

When uploading through serial connection and having serial monitor open at the same time, the upload fails. At least that's my experience with various esp8266 boards and Arduinos.
Arduino IDE disconnects serial monitor during upload and reconnects afterwards without loosing history.
It would be great to have the same behavior in PlatformIO IDE.

The current behavior should not change for OTA updates though.

@ivankravets
Copy link
Member

Proposed implementation

  • Create utils.getBoards() helper function. This function should cache result from CLI pio boards in the RAM (until IDE works). Use this help for "Init new/update project and import Arduino Project"
  • Add to PlatformIO IDE settings new setting named Automatically close Serial Port Monitor before uploading (checkbox, enabled by default).
  • Implement preAtomCommandName and postAtomCommandName field for each target in https://github.com/noseglid/atom-build. @orgkhnargh please discuss it with @noseglid .
  • Attach to "Upload-based" targets (see below) preAtomCommandName hook. It should check if PlatformIO IDE Terminal is opened and the last command to it was issued from Serial Monitor. If yes, close it.
  • Attach to "Upload-based" targets (see below) postAtomCommandName hook. It should re-open Terminal with the latest Serial Terminal command and selected options.

If Automatically close Serial Port Monitor before uploading is disabled, then don't attach pre/post hooks.

Upload based targets

  1. Read platformio.ini and detect board = * fields. If user runs only THE SPECIFIC environment, then you will have in the final result the only 1 board, otherwise read all envs and their boards. Result == list of boards
  2. Load all boards via utils.getBoards() and find the boards from step 1. If board contains upload.require_upload_port property and it is set to true, then need to disconnect/connect serial monitor if it is opened.

@vance
Copy link

vance commented Nov 13, 2017

what is the conclusion here? In latest I still have to manually close, upload, then re-open the serial monitor. is there a way to combine this into one step? If so, that should be the default behavior.

@dmytrokyrychuk
Copy link
Contributor

@vance there should be a checkbox called "Automatically close Serial Port Monitor before uploading" in platformio-ide package settings. Make sure that it is enabled.

@mikolajzieba
Copy link

@KyrychukD Where does this setting exists in the VSC ?

@ivankravets
Copy link
Member

@mikolajzieba Atom > Settings > Packages > PlatformIO IDE

@mikolajzieba
Copy link

mikolajzieba commented Jan 18, 2018

@ivankravets Does it exist in the Visual Studio Code ?

@ivankravets
Copy link
Member

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

No branches or pull requests

5 participants