Open essele opened 7 months ago
@essele. Thanks for all of that information. Just to clarify, the issue is that the serial monitor is staying open on the remote machine, because you didn't stop monitoring on it. But if you disconnect from the remote VS Code, and then re-connect to the remote session, the extension initializes again (I think this is expected), it can't connect to the port because it's still open?
Yes, that's a good summary (at least I believe that's what's happening.) I guess there are a couple of options (1) disconnect any open serial sessions anytime the extension re-initialises, or (2) re-establish any open session.
The second would be my preference, but I don't know anything about how this works behind the scenes.
Hi @essele @gcampbell-msft , Disconnecting and opening active serial connection session will cause (Any?) Arduino connected device to be restart again. (As it intentional in Arduino hardware). I think there should be gracefully way to handle this situation which will prevent any DTR and RTS pin toggle.
@essele Can you confirm whether this issue is happening when the "auto-reconnect" button is disabled?
Type: Bug Report
When connecting to a remote VSCode session the first time everything works fine, and serial monitor is able to open the relevant serial port.
However if you disconnect, the VSCode server continues to run in the background, and the serial port remains open. (This is validated with lsof showing a process (node) having the port open.)
If you then reconnect, the "new instance" can't open the serial port because it's already open...
**** Failed to open the serial port /dev/ttyACM0 ****
If you completely remove the serial port (I can do that because it's USB) then you do get an error:
Serial port /dev/ttyACM0 disconnected. Waiting for reconnection...
.. so there is some linkage. But it feels like the handle to the port is somehow lost in the internals of vscode??
Or is it as simple as the monitoring started/not-started state is being lost?
To Reproduce Steps to reproduce the behavior: