You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using String[] serialPorts = SerialPortList.getPortNames(); to get a list of the COM ports of the computer.
This method works correctly and always returns the available COM ports of the PC.
Today I tested my software on a Lenovo desktop computer running Windows 10 and the result was missing a Port.
The computer had an ESP32 Node MCU connected to COM11 but the result was missing that port. In fact the result was an array containing COM1. In COM1 there was an other USB device.
The ESP32 is connected correctly to the computer and I can send and receive data from it.
Have you ever noticed this problem again ?
PS. I have tested the software on multiple computers (desktops,laptops) including Windows, MacOS and Linux, even on Raspberry Pi and it works correctly
With the 11.3.0.176 (13-Apr-23) drivers for the CP210x USB to UART the port can be listed.
but with the 11.4.0.317 (19-Jul-24) version for the drivers the port cannot be listed...
After the drivers update we are not able to correctly list the COM ports of the computer using the Java jssc
To be more specific after calling the String[] serialPorts = SerialPortList.getPortNames(); the result is an empty array.
The serial communication with the device works correctly the only problem is that the COM port cannot be listed.
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/scijava/nativelib/JniExtractor
at jssc.SerialPortList.<clinit>(SerialPortList.java:49)
Caused by: java.lang.ClassNotFoundException: org.scijava.nativelib.JniExtractor
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 29 more
SETUP REGISTRY KEY
------------------
Registry keys are used for setting some parameters of the serial port
For setting these parameters, we have 2 ways:
- Modify registry value using registry editor of Windows
- Modify registry value using INF file
The detail of each method as following.
### Modify registry value using registry editor of Windows ###
1. Edit the file UpdateParameters.reg according to your settings, save the file.
Registry keys are allocated at 3 position:
- Parameters keys: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\silabser
- Software keys: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\<ClassID>\
- Hardware keys: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\deviceID\
2. Right-click to UpdateParam.bat -> run as administrator, then your settings have been updated.
3. Restart you computer.
Activity
tresf commentedon Aug 6, 2024
No. I assume rebooting the computer didn't fix it either?
The native code is here:
jssc/src/main/cpp/windows/jssc.cpp
Lines 644 to 688 in 8dd99a4
nsiatras commentedon Aug 6, 2024
nsiatras commentedon Aug 7, 2024
Well... the issue in my case are the drivers.
With the 11.3.0.176 (13-Apr-23) drivers for the CP210x USB to UART the port can be listed.

but with the 11.4.0.317 (19-Jul-24) version for the drivers the port cannot be listed...
nsiatras commentedon Aug 7, 2024
Better Issue Description:
We recently upgraded the Windows version of the CP210x USB to UART Bridge drivers from version 11.3.0.176 to 11.4.0.317
Link to drivers: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads
After the drivers update we are not able to correctly list the COM ports of the computer using the Java jssc
To be more specific after calling the
String[] serialPorts = SerialPortList.getPortNames();the result is an empty array.The serial communication with the device works correctly the only problem is that the COM port cannot be listed.
tresf commentedon Aug 7, 2024
@nsiatras,
@hiddenalpha has kindly provided a potential patch here: #171 can you test it? Here's a compile from my machine:
jssc-2.9.7-SNAPSHOT.jar.zipnsiatras commentedon Aug 8, 2024
Hello,
I get the following exception:
tresf commentedon Aug 8, 2024
Sorry, the build is missing this dependency. I'll try to make a fat jar containing this...
tresf commentedon Aug 8, 2024
@nsiatras OK, this one should have the scijava dependencies included, can you please test?
jssc-2.9.7-SNAPSHOT.jar.zip
nsiatras commentedon Aug 9, 2024
I just tested the snapshot.
No exceptions on this one and data exchange works 100% correct but I still cannot list the COM ports correctly.
pietrygamat commentedon Aug 9, 2024
@nsiatras you may want to check that the driver parameter
SerialSkipExternalNamingis not set in your Windows machineand if it is - remove the key, then reboot the PC (or at least reconnect the device).

source
nsiatras commentedon Aug 9, 2024
Hello,
I reported this issue on the SiliconLabs forum and I just get the following reply:
"*This behavior might be affected by some changes in the new VCP 11.4 driver. The Old VCP 11.3 will be back on the website for downloading.
I will let you know if I have any updates on it. Again, Thanks for your information*"
https://community.silabs.com/s/question/0D7Vm000003SrZ7KAK/detail?language=en_US
PS. I have not edit the registry yet, in order to test again. I will do so later today