Issue Type: Bug
Plug in an Arduino - open serial monitor - press reset button on Arduino - not beeing able to upload a sketch to Arduino anymore
Extension version: 0.2.23
VS Code version: Code 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e, 2018-11-15T19:13:36.375Z)
OS version: Windows_NT x64 10.0.17134
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2592)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled|
|Memory (System)|15.92GB (11.94GB free)|
|Process Argv||
|Screen Reader|no|
|VM|50%|
@Staud14 Thank you for your feedback , we will investigate it.
@Staud14 I try to use DevKit AZ3166 and Huzzah Esp8266 device to do bellow steps , but this issue is not repro on . Can you see what am I missing?
Step:


To me it seems like you didn't miss anything. Maybe something went wrong when I installed some extensions.
When the error occured I wanted to programm an Arduino Nano but there shouldn't be anything different from your test setup.
Anyway thanks for looking into the issue.
Having this issue too. Interestingly, I was also using a Arduino Nano. When I switched to a Arduino Uno, it didn't happen. Neither are original boards, but the Uno appears as an Uno, whereas the Nano is detected as a "WeMos D1", though I use it as a Nano. Hope this helps.
I am having this problem in my old laptop (Core 2 Duo) with Linux on an Arduino Micro clone.
When you upload from vscode with the serial monitor open, first the extension closes the monitor, then uploads and finally tries to open the serial monitor again. The problem in my case at that last step is that the serial device /dev/ttyACM0 is not yet ready: the Arduino is either still booting after the upload or the system has not yet updated the filesystem permissions in the /dev/ttyACM0 device (it first appears as crw------ root root and then changes to crw-rw---- root dialout).
Therefore, in the Serial Monitor window I get a "[Starting] Opening the serial port - /dev/ttyACM0" followed by "[Error] Error: Error: permission denied: cannot open /dev/ttyACM0".
Even though the upload was actually successful, in the Arduino upload window, I never get a "[Done] Uploaded the sketch", the message "Arduino uploading..." stays in the status bar and the extension gets "stuck" and cannot be used to upload again until vscode is restarted.
In conclusion, there is a bug in case of error re-opening the Serial Monitor after a successful upload that leaves the upload command unfinished forever.
I would also suggest doing a few tries on the reopen with a little wait between them. When I replace the avrdude executable with my own script adding a sleep 2 (delay 2 seconds) after running avrdude, it just works fine.
I am attaching an animated gif with a successful upload followed by an upload showing the problem with the open serial monitor (I hope it works).

This issue has been automatically marked as stale and closed because it has not had recent activity. Please feel free to open a new issue if you would like further discussion. Thank you for your contributions.
Having this issue when I physically unplug the Arduino without closing the serial port. The extension crashes immediately in this scenario. Using an Arduino Nano.
Most helpful comment
Having this issue when I physically unplug the Arduino without closing the serial port. The extension crashes immediately in this scenario. Using an Arduino Nano.