More details about COM ports

I have a question concerning com ports. A while ago in this thread

I managed to use arduino-cli.exe in order to get me more details about COM ports. It works really well. I can also find me boards with Ch340 chips. But if I export an application I don’t want to ship a copy of arduino-cli and deal with associated problems.

The output from Serial.list() is not satisfactory. It prints more COM ports than my OS can find and there are no details.

I cannot use this: Serial.list()

[0] "CNCA2"
[1] "CNCB2"
[2] "COM4" 
[3] "COM7" 
[4] "COM8" 
[5] "COM9" 

vs OS:

afbeelding

Are there besides arduino-cli.exe more lightweight tools (which may or may not be natively installed on windows) which I can launch from processing and use to get me a more acurate list of COM ports with some more detailing.

Bas

Have you tried using the cmd-line to list the ports? It’s ls /dev/{tty,cu}.*
on a Mac; have no idea what’s available on Windows.

Hello @bask185,

This will provide more details:

This is the list of COM ports using the jSerialComm library:

Those other COM ports are your virtual COM ports:

image

And your ports:

image

This is the list of COM ports using Processing Serial library:

:)

1 Like

Thank you, that seems really good.

I have one question. Despite being an electronics engineer I cannot find how to bloody install a library. I google searched…
I tried putting the jar file in my sketch folder
I tried putting the jar file in my sketchbook folder under libraries.

I tried like 4 different locations.

Where do libraries go in 2024?

Bas

Did you try creating a folder entitled ‘code’ inside of your sketch folder, then enclosing the .jar file?

1 Like

No, that is the common way nowadays? Is it like the arduino src/ directory? imma gonna try it out!

I’m not familiar with arduino/src, but it is also created with Processing as you probably know. Drag’NDropping .jar file onto editor should also work.

Yeah I know. The content of the src/ directory within an arduino sketch is compiled with your project. Usually you can dump whatever cpp and h files in your main sketch folder and you are good. If you have that much files that you want to use subfolder structure than the subfolder hast to be named “src”. It was not always like this. iirc one could name their subfolders however they liked.

I read on internet that you could drop a .jar file in a sketch folder. I don’t know if that used to be the case in the past??

Anyways. It seems to work now! I can compile and find my arduino. Thanks alot folks! :wink:

Kind regards,

Bas

1 Like

An extra reference for visitors to this topic:

:)

Thnx, I read it. But the ‘code’ subfolder is not mentioned however

On Windows, “mode” lists the com ports. I have in the past used the output of this to detect when a particular port is there for Arduino program load.

1 Like

You are correct! It is not.

I did find a reference here to code folder:

:)

This need to be entered in the Command Prompt:

Additional reference:
MODE - Com1, Com2, Lpt1, con - Windows CMD - SS64.com

:)