diff --git a/docs/reference/mpremote.rst b/docs/reference/mpremote.rst index b826725360..08ef5d31ff 100644 --- a/docs/reference/mpremote.rst +++ b/docs/reference/mpremote.rst @@ -100,6 +100,8 @@ The full list of supported commands are: command output) - ``port:``: connect to the device with the given path (the first column from the ``connect list`` command output + - ``rfc2217://:``: connect to the device using serial over TCP + (e.g. a networked serial port based on RFC2217) - any valid device name/path, to connect to that device **Note:** Instead of using the ``connect`` command, there are several @@ -109,7 +111,7 @@ The full list of supported commands are: **Note:** The ``auto`` option will only detect USB serial ports, i.e. a serial port that has an associated USB VID/PID (i.e. CDC/ACM or FTDI-style - devices). Other types of serial ports + devices). Other types of serial ports will not be auto-detected. .. _mpremote_command_disconnect: diff --git a/tools/mpremote/mpremote/transport_serial.py b/tools/mpremote/mpremote/transport_serial.py index 09025c3098..e04f5b4ac9 100644 --- a/tools/mpremote/mpremote/transport_serial.py +++ b/tools/mpremote/mpremote/transport_serial.py @@ -76,7 +76,9 @@ class SerialTransport(Transport): delayed = False for attempt in range(wait + 1): try: - if os.name == "nt": + if device.startswith("rfc2217://"): + self.serial = serial.serial_for_url(device, **serial_kwargs) + elif os.name == "nt": self.serial = serial.Serial(**serial_kwargs) self.serial.port = device portinfo = list(serial.tools.list_ports.grep(device)) # type: ignore