From ed9b2d1fd6c20c8cb8aa01b62aad1ddb0e1d5346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Karni=C5=A1?= Date: Mon, 24 Jun 2024 16:12:35 +0200 Subject: [PATCH] change(port_detection): Filter out BT and WLAN debug serial ports on MacOS Closes https://github.com/espressif/esp-idf/issues/14058 --- tools/idf_py_actions/tools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/idf_py_actions/tools.py b/tools/idf_py_actions/tools.py index 76322ae7c6..0f4cb73a1d 100644 --- a/tools/idf_py_actions/tools.py +++ b/tools/idf_py_actions/tools.py @@ -129,6 +129,12 @@ def get_default_serial_port() -> Any: 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')) + ] # 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)