Skip to main content
Connect to UART serial ports on Lagerboxes for serial communication with devices.

Syntax

lager uart [NETNAME] [OPTIONS]

Arguments

ArgumentDescription
NETNAMEUART net name (optional if default is set)

Options

OptionDescription
--box BOXLagerbox name or IP address
--baudrate RATEBaudrate (e.g., 9600, 115200)
--bytesize SIZEData bits (5, 6, 7, 8)
--parity MODEParity: none, even, odd, mark, space
--stopbits BITSStop bits (1, 1.5, 2)
--xonxoff / --no-xonxoffSoftware flow control
--rtscts / --no-rtsctsHardware flow control (RTS/CTS)
--dsrdtr / --no-dsrdtrHardware flow control (DSR/DTR)
-i / --interactiveEnable input mode for typing
--opost / --no-opostConvert \n to \r\n on output
--line-ending MODELine ending: lf, crlf, cr (default: lf)

Usage

Read-Only Mode (Default)

# Monitor serial output
lager uart SERIAL1 --box my-lager-box

# With specific baudrate
lager uart SERIAL1 --baudrate 115200

Interactive Mode

# Type commands and see responses
lager uart SERIAL1 --interactive

# With specific settings
lager uart SERIAL1 -i --baudrate 9600 --parity none

Get Serial Port Info

# Show device path for a UART net
lager uart SERIAL1 serial-port

Serial Configuration

Baudrate

Common baudrates:
  • 9600 (default for many devices)
  • 19200
  • 38400
  • 57600
  • 115200 (common for embedded development)
  • 230400
  • 460800
  • 921600

Data Format

SettingOptionsDefault
Bytesize5, 6, 7, 88
Paritynone, even, odd, mark, spacenone
Stopbits1, 1.5, 21

Flow Control

TypeOptionsDescription
Software--xonxoffXON/XOFF characters
Hardware--rtsctsRTS/CTS pins
Hardware--dsrdtrDSR/DTR pins
Flow control types cannot be combined.

Line Endings

ModeSequenceUse Case
lf\nUnix/Linux
crlf\r\nWindows
cr\rLegacy systems
Use --opost to automatically convert line endings on output.

Supported USB Serial Adapters

The following USB-to-serial adapters are automatically detected and supported:
AdapterVID:PIDDescription
Prolific USB-Serial067b:23a3Common USB-Serial adapter
Silicon Labs CP210x10c4:ea60Popular embedded dev boards
FTDI FT232R0403:6001Single-channel USB-Serial
FTDI FT4232H0403:6011Quad-channel USB-Serial
ESP32 USB JTAG/Serial303a:1001Built-in ESP32-S3/C3 USB
These adapters are automatically recognized by lager instruments and can be configured as UART nets.

Device Path Support

UART nets can reference devices two ways: USB Serial Number (preferred):
Net configured with USB serial number
Automatically resolves to correct /dev/ttyUSBx
Direct Device Path (fallback):
# When adapter has no serial number
lager uart /dev/ttyUSB0 --baudrate 115200

Examples

# Basic serial monitor
lager uart DEBUG_UART --box lab-gw

# Interactive shell with common embedded settings
lager uart CONSOLE -i --baudrate 115200

# Legacy device with specific format
lager uart LEGACY --baudrate 9600 --bytesize 7 --parity even --stopbits 2

# With software flow control
lager uart MODEM --xonxoff

# Windows-style line endings
lager uart TERMINAL --line-ending crlf --opost

WebSocket Connection

The UART command uses WebSocket for communication:
  • Provides real-time bidirectional data
  • Supports both read-only and interactive modes
  • Automatically reconnects on connection loss

Troubleshooting

Device Not Found

# List available instruments to find UART devices
lager instruments --box my-lager-box

# Check if USB serial adapter is connected
ssh lagerdata@my-lager-box 'ls -la /dev/ttyUSB*'

Permission Denied

# Ensure udev rules are installed
lager update --box my-lager-box --yes

No Output

  • Check baudrate matches device
  • Verify TX/RX connections
  • Try interactive mode to test input
  • Check flow control settings

Notes

  • Interactive mode requires a TTY terminal
  • USB serial numbers are truncated for display
  • Default net can be set with lager defaults add --uart-net
  • Connection retry logic handles temporary disconnections