Getting friendly device names in python

后端 未结 6 1126
夕颜
夕颜 2021-01-04 10:29

I have an 2-port signal relay connected to my computer via a USB serial interface. Using the pyserial module I can control these relays with ease. However, this is based on

6条回答
  •  甜味超标
    2021-01-04 11:09

    Windows: you can pull USB information from WMI, but you need to be administrator. The examples are in .NET, but you should be able to use the Python WMI module. This will give you access to USB identification strings, which may contain useful information. For FTDI serial devices there is a short cut using FTDI's DLL, which does not require privileged access.

    Linux: all the available information is under /sys/bus/usb, and also available through udev. This looks like a good answer.

提交回复
热议问题