Serial.list() not showing USB ports (available serial ports)

Windows 11 (auto update)
Processing 4.4.4

I have two USB ports available, and both work with other hardware not related to Processing (mouse, USB printer, USB memory, battery tester, audio player, Arduino, ESP). Using this sketch, I expected to see both ports, but see nothing in the “console” or “errors” windows of the Processing IDE.

import processing.serial.*;
printArray(Serial.list());

The Reference Page for Serial.list() says to use println();, so I tried that, too, but the same results: nothing in the command line. I copied the command line and pasted it into the IDE as well as Notepad (hoping for inverse color text) but that only showed ten, empty, CRLF.

I tried searching the forum, but found nothing pointing me to my error, for example, did I neglect to configure my IDE for using Serial or import a library?

The IDE:


The output window:

Works ok on MacOS. Output is in console.

Hello,

It works on W10 and W11 with Processing 4.4.4

:)

@newuser What operating system (including version) and CPU architecture (x86/ARM) is your system using ?

Have you double checked the serial ports show up correctly using the OS/terminal ?
(This would help isolate the issue (e.g. is with Processing or with the OS (e.g. permissions to access serial devices, etc.))

2 Likes

Have you double checked the serial ports show up correctly using the OS/terminal ?
Good idea; on a mac you would type ls /dev/tty/.* on the command line in Terminal if you don’t already know.

Hello folks,

Some additional ways to check for COM ports on Windows systems.
If the COM port exists then Processing (Java) should be able to see it.

@newuser ,
Looking forward to how you resolved this.

Windows

PowerShell:

Get-WmiObject Win32_SerialPort | Select-Object Name,Description

Command Prompt:

Device Manager:

Windows Settings:

I miss any for Windows?

Processing

List the COM ports using the jSerialComm library :
More details about COM ports - #3 by glv

List the COM ports using the Processing Serial Library:
list() / Libraries / Processing.org

:)

1 Like

Hi George!

I was not connecting the dots right away when you said terminal since I mostly use Windows and not used Linux in a while. Was thinking of old school HyperTerminal as the “terminal software\emulator” for connecting to COM ports.

All is clear now for Windows environment:

I have a brand new W11 PC and slowly migrating over to it.

Windows Terminal does not connect to a COM port but I can use everything from my last post easily enough!

:)

The example code (or if using println) does show the results in the Processing console window, though not in the output window.

Great work providing detailed steps with images: this will be super helpful for other users as well! :raising_hands:

FWIW, when doing basic serial tests (e.g. outside of Processing) I used CoolTerm:

  • it has executables for multiple operating systems
  • you can scan/check ports of course
  • once connected, you can send messages (Ctrl/CMD + T) and see the output, but also switch between ASCII and bytes (HEX view) which super useful when debugging binary serial protocols.

(Alternatively, if Python is an option PySerial’s python -m serial.tools.list_ports is handy (and the grep option can be handy to get consistent ports using Vendor ID (VID) and Product ID (PID) info on OSes where the name of the port may change))

HTH

Hello @PhilHaw,

Terminology can be challenging, especially for users who are new to this environment.

Reference:

The description may not be clear for a new user.

The “text window” should be the *console" which is a panel at the bottom of the PDE (Processing Development Environment) which is also referred to as the Processing IDE (Integrated Development Environment).

Code to display to console and display/sketch/output window:

Output:


:)

1 Like

Lenovo laptop Intel CPU.
Processing works great. I have not yet learned enough to do comms (put on hold) or console stuff.

Permissions for hardware seem “admin” level. I run various hardware on the USB ports. Usually shows COM3.

Thank you for the help. It gives me places to look.

Thank you for all your replies!

The solution is: an “ardiuono” type device must be in the COM port.

I wrongly thought the USB wifi device I use for my mouse would suffice to give me a COM output from Processing.

I still to not get a list of all the possible ports… maybe this is a way for the OS (WIN11) to save memory or cycles… and when I am in the Arduino IDE, this COM3 shows as COM5… so there is could some OS magic involved.

This command (with Nano inserted) yielded no response (not like post # May26):

PS C:\Users\newuser> Get-WmiObject Win32_SerialPort | Select-Object Name,Description
PS C:\Users\newuser>

… and using ‘mode’…

PS C:\Users\newuser> mode

Status for device COM3:
-----------------------
    Baud:            19200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         OFF
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     ON
    RTS circuit:     ON


Status for device CON:
----------------------
    Lines:          30
    Columns:        120
    Keyboard rate:  31
    Keyboard delay: 1
    Code page:      437

Python is beyond the scope of my brain… sorry.

Thank you for all the help. Here is my second sketch (first = helloworld.pde, of course) which I was tinkering with in my long absence, learning primative shapes by displaying the shape inside a given boundary (stroke width, shape, diameter do not cause boundary overlap)

// draw "primatives" in specific quadrants

int cols = 3; // grid columns
int rows = 2; // grid rows
float colWidth, rowHeight, halfWidth, halfHeight;

void setup() {
  //size(280, 320); // tft
  size(800, 800);
  fill(255, 256 * .3); // shape transparency

  colWidth  = width  / cols;
  rowHeight = height / rows;
  halfWidth  = colWidth / 2; // to calculate offset from center
  halfHeight = rowHeight / 2;

  drawGrid(cols, rows);
}

void drawGrid(int c, int r) {
  stroke(256 * .7); // border darkness
  for (int i = 0; i < c; i++)
    line(colWidth * i, 0, colWidth * i, height); // vertical lines
  for (int i = 0; i < r; i++)
    line(0, rowHeight * i, width, rowHeight * i); // horizontal lines
}

void draw() {
  stroke(random(256), random(256), random(256));
  qPoint(0, 11); // (quadrant, pointWidth)
  qLine(1); // (quadrant)
  qRect(2); // (quadrant)
  qTri(3); // (quadrant)
  qEllipse(4); // ellipse
  // q6(); // arc
  // q7(); // quad
}

void qEllipse(int quadrant) { // ellipse
  float colNum = quadrant % cols; // remainder = column
  float rowNum = quadrant / cols; // quotient  = row
  float startX = colNum * colWidth;
  float startY = rowNum * rowHeight;

  float ex = random ((startX ) + 1, (colNum + 1) * colWidth); // (+1 pixel, +1 column)
  float dx = random (halfWidth  - abs(halfWidth  - (ex - (colNum * colWidth))));

  float ey = random ((startY) + 1, (rowNum + 1) * rowHeight); // (+1 pixel, +1 row)
  float dy = random (halfHeight - abs(halfHeight - (ey - (rowNum * rowHeight))));

  ellipse(ex, ey, dx, dy);
}

void qTri(int quadrant) { // triangle
  float colNum = quadrant % cols; // remainder = column
  float rowNum = quadrant / cols; // quotient = row
  float startX = colNum * colWidth;
  float startY = rowNum * rowHeight;

  float tx0 = random (startX + 1, colWidth  * (colNum + 1)); // (+1 pixel, +1 column)
  float ty0 = random (startY + 1, rowHeight * (rowNum + 1)); // (+1 pixel, +1 row)
  float tx1 = random (startX + 1, colWidth  * (colNum + 1)); // (+1 pixel, +1 column)
  float ty1 = random (startY + 1, rowHeight * (rowNum + 1)); // (+1 pixel, +1 row)
  float tx2 = random (startX + 1, colWidth  * (colNum + 1)); // (+1 pixel, +1 column)
  float ty2 = random (startY + 1, rowHeight * (rowNum + 1)); // (+1 pixel, +1 row)
  triangle(tx0, ty0, tx1, ty1, tx2, ty2);
}

void qRect(int quadrant) { // rect
  float colNum = quadrant % cols; // remainder = column
  float rowNum = quadrant / cols; // quotient = row
  float startX = colNum * colWidth;
  float startY = rowNum * rowHeight;

  float rx = random (startX + 1, colWidth  * (colNum + 1)); // (+1 pixel, +1 column)
  float ry = random (startY + 1, rowHeight * (rowNum + 1)); // (+1 pixel, +1 row)
  float rw = random (colWidth  - (rx - (startX)));
  float rh = random (rowHeight - (ry - (startY)));
  rect(rx, ry, rw, rh);
}

void qLine(int quadrant) { // line
  float colNum = quadrant % 2;
  float rowNum = quadrant / 2;
  float startX = colNum * colWidth;
  float startY = rowNum * rowHeight;

  float lx0 = random(startX + 1, (colNum + 1) * colWidth);
  float ly0 = random(startY + 1, (rowNum + 1) * rowHeight);
  float lx1 = random(startX + 1, (colNum + 1) * colWidth);
  float ly1 = random(startY + 1, (rowNum + 1) * rowHeight);
  line(lx0, ly0, lx1, ly1);
}

void qPoint(int quadrant, int pointWidth) { // point
  strokeWeight(pointWidth);
  float halfStroke = pointWidth / 2;
  float colNum = quadrant % 2;
  float rowNum = quadrant / 2;
  float startX = colNum * colWidth;
  float startY = rowNum * rowHeight;

  float px = random(startX + halfStroke + 1, (colNum + 1) * colWidth - halfStroke);
  float py = random(startY + halfStroke + 1, (rowNum + 1) * rowHeight - halfStroke);
  point(px, py);
  strokeWeight(1);
}

void pad (int val) { // print values in column alignment
  //if (val < 1000 && val > -100) print(" ");
  if (val <  100 && val >  -10) print(" ");
  if (val >   -1 && val <   10) print(" ");
  print(int(val));
}

This “random shapes inside the adjustable grid” exercise was to learn how to place an object anywhere on a given-size screen (or portion of the screen), so when I get the comms between Arduino and Processing working, I can present the data in graphical form.

Thank you, again!

1 Like