Unable to find the right port to connect PySerial to USB device on Windows 11
Question:
I’m trying to use the PySerial library on Windows 11 to connect to a USB device so I can communicate with it. However, I’m having trouble finding the right "address" to connect it too. I’m trying to run the following command to connect but I don’t know what to pass into it as I’m not on Linux and can’t use ‘/dev/ttyusb0’:
device="" # Don't know what to put here
serial.Serial(device)
I tried first looking at my COM ports, but all I found was this (looks like random Bluetooth stuff):
Device Manager Output
I did manage to find the right device on device manager, but I have no idea how to interface with it since it’s not a COM port:
Device Description
I also ran USB Device Tree Viewer to get a better picture and it only made me more confused. It looks like the device I want to interact with is controlled by a eXtensible Host Controller which can be seen here:
USB Device Tree Viewer
FYI, the device I want to interact with is connected to the HUB on port 5 of the eXtensible Host Controller as seen on USB Device Tree Viewer.
Any help or guidance would be greatly appreciated. If it’d be impossible to do what I want in pySerial, please direct me as to where I could research further.
Let me know if I can provide any more information that could help!
Answers:
I was able to solve my issue by instead using pyUSB and looking up the device by vendorID and productID. As a side-effect, it made the interaction with the device a lot easier.
I’m trying to use the PySerial library on Windows 11 to connect to a USB device so I can communicate with it. However, I’m having trouble finding the right "address" to connect it too. I’m trying to run the following command to connect but I don’t know what to pass into it as I’m not on Linux and can’t use ‘/dev/ttyusb0’:
device="" # Don't know what to put here
serial.Serial(device)
I tried first looking at my COM ports, but all I found was this (looks like random Bluetooth stuff):
Device Manager Output
I did manage to find the right device on device manager, but I have no idea how to interface with it since it’s not a COM port:
Device Description
I also ran USB Device Tree Viewer to get a better picture and it only made me more confused. It looks like the device I want to interact with is controlled by a eXtensible Host Controller which can be seen here:
USB Device Tree Viewer
FYI, the device I want to interact with is connected to the HUB on port 5 of the eXtensible Host Controller as seen on USB Device Tree Viewer.
Any help or guidance would be greatly appreciated. If it’d be impossible to do what I want in pySerial, please direct me as to where I could research further.
Let me know if I can provide any more information that could help!
I was able to solve my issue by instead using pyUSB and looking up the device by vendorID and productID. As a side-effect, it made the interaction with the device a lot easier.