"Could not open comm port 'COMM3' " fix (or any WIndows port...)

rjsdotorg

Well-known member
I was using Arduino IDE and then switched to VS Code. I "closed" Arduino/Teensduino but several Arduino processes were still left running.
I did a PS script:
Bash:
Get-CimInstance Win32_Process | Where-Object { $_.ProcessId -in 7708,4544,9920,13008 } | Select-Object ProcessId,Name,CommandLine | Format-List
which gives a nice list of IDs and ports
ProcessId : 4544
Name : python.exe
CommandLine : C:\Users\rjs\.platformio\penv\Scripts\python.exe -m platformio -c
vscode home --port 45966 --host 127.0.0.1 --session-id
9b96a3507036d6ba53ba6848a066397c064de2d8 --shutdown-timeout 3600
--no-open
...
 
Doesn't look like anything from Teensy. Nothing we publish uses python. Teensy's utilities like teensy-discovery and teensy-monitor are native programs.

Maybe this leftover Arduino stuff is from other non-Teensy boards?
 
I don't really understand what the output is meant to be showing, that's very obviously a process related to VS code rather than Arduino.
 
COM3 or COMM3 ???
VS Code / PlatformIO said "COMM"
Doesn't look like anything from Teensy. Nothing we publish uses python. Teensy's utilities like teensy-discovery and teensy-monitor are native programs.

Maybe this leftover Arduino stuff is from other non-Teensy boards?
Python process was just an Get-CimInstance output example - I had been running Arduino IDE for a while then switched to VS Code which failed due to zombie processes holding the port.
I don't really understand what the output is meant to be showing, that's very obviously a process related to VS code rather than Arduino.
Sorry, it was unclear. I had learned to use Get-CimInstance to track down the port offender (Windows).
It seems Arduino IDE or Teensyduino left processes running after closing the IDE windows.
I can't edit OP once it has replies...
 
Last edited:
It seems Arduino IDE or Teensyduino left processes running after closing the IDE windows.

Nothing about Teensy uses python.exe.

This leftover thing kept running on your machine isn't anything from the Teensy software, because we never use python.exe.
 
The Python in the capture was simply first in the list of the PS command output, with "Arduino IDE" down the list.
The gist was simply the use of Get-CimInstance to debug when in Windows.

BTW VS Code running PlatformIO does use Python in its toolchain. I just tried to replicate the whole orphan-process thing, ran Teensyduino and VS Code then checked the running processes: Get-CimInstance Win32_Process | Select-Object ProcessId,Name,CommandLine | Format-List and see in the results
ProcessId : 9220
Name : python.exe
CommandLine : "C:\Users\rjs\.platformio\python3\python.exe" -m platformio -c
vscode home --port 45180 --host 127.0.0.1 --session-id
dd78506734cfa7f2e70a95039524f9d844ede247 --shutdown-timeout 3600
--no-open
but no blocking orpans/zombies.

Since I can't edit the post it is misleading at this point; perhaps I should delete the post.
 
Last edited:
Back
Top