mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-14 02:08:21 +08:00
Merge branch 'change/use_esptool_to_list_ports' into 'master'
change(tools): Use esptool to detect available ports See merge request espressif/esp-idf!42380
This commit is contained in:
@@ -133,11 +133,8 @@ def get_default_serial_port() -> Any:
|
||||
# ensured that pyserial has been installed
|
||||
try:
|
||||
import esptool
|
||||
import serial.tools.list_ports
|
||||
|
||||
ports = list(sorted(p.device for p in serial.tools.list_ports.comports()))
|
||||
if sys.platform == 'darwin':
|
||||
ports = [port for port in ports if not port.endswith(('Bluetooth-Incoming-Port', 'wlan-debug'))]
|
||||
ports = esptool.get_port_list()
|
||||
# high baud rate could cause the failure of creation of the connection
|
||||
esp = esptool.get_default_connected_device(
|
||||
serial_list=ports, port=None, connect_attempts=4, initial_baud=115200
|
||||
|
Reference in New Issue
Block a user