Vscode-arduino: Clicking Select Serial port does nothing

Created on 12 May 2019  ·  45Comments  ·  Source: microsoft/vscode-arduino

Seems to be slightly related to #664
Clicking the button does nothing, no menu pops up.

I had to manually add a line

"port": "/dev/ttyUSB0"

to ./vscode/arduino.json, after which at least upload works, but opening serial monitor fails with:

Failed to open serial port /dev/ttyUSB0 due to error: + TypeError: Cannot read property 'close' of null

OS: Arch Linux
code 1.33.1
arduino 1.8.9

There are no issues with serial when using the Arduino IDE.

bug

Most helpful comment

  • Arduino 0.2.29
  • VSCode 1.43.0

The bug still exists here in my Windows: Clicking "Select a Serial Port" does noting.

All 45 comments

First of all, disclaimer: I am using the stupidest, most cutting edge setup which may or may not totally break this (Using vscode-remote with WSL on Windows, and passing through COM1 to /dev/ttyS1).

I have a similar issue: Before adding "port": "/dev/ttyS1", neither port selection nor the serial monitor worked and I couldn't upload anything to the MKR1000 on COM1.
Triggering either Select Serial Port or Open Serial Monitor terminated the extension host and even made me restart VSCode with WSL totally to regain any functionality.
They still do, but since adding the port I still can't open the serial monitor.
Workaround for this is to cat /dev/ttyS1 either in the built in or the external terminal, but having this functionality from the extension would be way better.

I know this is a quite loaded issue, and it reeks of preview software. Still I'd be grateful for any help!

@C0rn3j I don't know if this helps you, but instead of relying on the Arduino Extension you can try to set up some tasks in .vscode/tasks.json

I cobbeled this together yesterday to help alleviate most of my issues with the Arduino Extension like crashes when selecting a port.

It relies on the arduino ide's basic command line options that have been made available since version 1.5

@C0rn3j I've tried to launch VScode and directly press F1 to select "Arduino: Select Serial Port", it will show error like your description.
But seems it is usage steps different.
May I know your previous steps? Have you created project or open any example? Because when I open an example and click