Skip to content

Behaviour

pschatzmann edited this page Oct 30, 2026 · 1 revision

How it behaves

Applies to all platforms unless a platform is named.

  • Addresses: the USB adapter takes the WiFi station's MAC address, because the access point only accepts frames from it. On Linux the adapter shows up as enx<station mac>. The host gets its IP, gateway and DNS from your router; the MCU has none.
  • Log output: nothing is printed until the sketch calls TWD_LOGGER.begin(...). The library prints a few events (WiFi up/down, bridge MAC) and, if statsIntervalMs > 0, a status line. Outputs, levels and their limits: see Logging.
  • Status line (ESP32): w1 toL=.. toH=.. rf=.. dr=.. | u rx=.. tx=.. td=.. bz=.. q=.. rs=.. - w WiFi associated, toL/toH frames forwarded to the WiFi network / to the host, rf echoes dropped, dr frames the other side could not take, u rx/tx frames over USB, td dropped on the way out, bz busy polls, q frames queued for the host, rs stall recoveries. When the send queue is stuck, the status line is replaced by two dw.. lines with the USB controller's registers (ESP32-S2/S3 only, see Architecture).
  • Status line (Raspberry Pi Pico): w1 toL=.. toH=.. rf=.. dr=.. | u rx=.. tx=.. td=.. rd=.. q=.. - the same fields, plus rd frames from the host dropped for lack of buffers. td and rd count frames dropped because a buffer pool was full (see framesToHost and framesFromHost in Configuration); a few drops are normal under load, because they make TCP slow down.
  • Stall watchdog (ESP32 only): if the USB send path makes no progress for stallTimeoutMs, the firmware drops the queued frames and disconnects/reconnects USB. The host sees this as the network card being unplugged and replugged: NetworkManager reports carrier-changed, restarts DHCP, and open connections break. With the USB task pinned (default) stalls are rare, so this is seldom needed; with stallTimeoutMs = 0 a stall simply stays until you replug the board. The Pico port has no watchdog; no stall has been seen there (see Status).

Clone this wiki locally