Cannot communicate with FTDI device via pylibftdi with specified device_id

☆樱花仙子☆ 提交于 2019-12-07 18:04:25

Are you interested in uart (like) modes only? If so you might take a look at pyserial. Especially the serial.tools.list_ports.comports() function:

import serial
import serial.tools.list_ports

print([(x.device,x.hwid,x.description,x.location,x.serial_number) for x in serial.tools.list_ports.comports()])

This way you might be able to get the right description and open then the port via

ports = [x.device for x in serial.tools.list_ports.comports() if search_string in x.hwid]
serial.Serial(ports[0], 115200)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!