I'm on a Windows 7 x64 machine, using Python 2.7.2 and the PySerial 2.6, as downloaded from PyPi.
Using serial.tools.list_ports.comports() enumerates 3 of my COM ports, however, it ignores a USB-to-Serial dongle I have. The dongle is recognized by other programs, by Windows, etc... If I manually enter the 'missing' COM port, PySerial connects. So, it seems to be an issue with enumeration.
I am successfully able to enumerate the missing COM port using this code (stolen from the interwebs):
""" Uses the Win32 registry to return an
iterator of serial (COM) ports
existing on this computer.
path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM'
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, path)
for i in itertools.count():
val = winreg.EnumValue(key, i)
Log in to post a comment.