From a6f3a6b4a5d431a40e3904fc1fde46b2f32f5b2d Mon Sep 17 00:00:00 2001 From: James Rich Date: Sun, 19 Apr 2026 12:23:55 -0500 Subject: [PATCH] fix(serial): assert DTR/RTS on Android USB-CDC open Empirically, RAK4631/nRF52840 firmware does not respond to WAKE_BYTES unless DTR is asserted on open. DTR maps to USB SET_CONTROL_LINE_STATE, which the firmware uses to detect host presence and activate its serial- side Meshtastic protocol. Bridge-chip boards (CH340, CP210x, FTDI) tolerate the assertion. --- .../core/network/repository/SerialConnectionImpl.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/network/src/androidMain/kotlin/org/meshtastic/core/network/repository/SerialConnectionImpl.kt b/core/network/src/androidMain/kotlin/org/meshtastic/core/network/repository/SerialConnectionImpl.kt index b2ccf6545..d8b14be03 100644 --- a/core/network/src/androidMain/kotlin/org/meshtastic/core/network/repository/SerialConnectionImpl.kt +++ b/core/network/src/androidMain/kotlin/org/meshtastic/core/network/repository/SerialConnectionImpl.kt @@ -87,6 +87,11 @@ internal class SerialConnectionImpl( port.open(usbDeviceConnection) port.setParameters(115200, UsbSerialPort.DATABITS_8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE) + + // Assert DTR/RTS so native USB-CDC firmware (RAK4631 / nRF52840) recognizes the host as + // present and starts its serial-side Meshtastic protocol. Empirically, omitting these + // signals causes the firmware to never respond to WAKE_BYTES, stalling the handshake at + // Stage 1. Bridge-chip boards (CH340, CP210x, FTDI) tolerate the assertion. port.dtr = true port.rts = true