Skip to content

UART Shell

7h30th3r0n3 edited this page Jul 11, 2025 · 3 revisions

UART AutoShell

UART AutoShell is a lightweight serial console that lets you interface with any TTL-level device directly from the Cardputer’s built-in keyboard and IPS display. Ideal for debugging or gaining root shell access on embedded targets like routers or IP cameras, it can auto-detect the baudrate or let you pick one manually from a keyboard-driven menu.

Features

  • Automatic baud-rate scan across 300 – 115 200 bps
  • Manual baud-rate selection menu
  • Non-blocking, per-character echo to both UART and display
  • Smooth line-by-line scrolling on the 240 × 135 px screen
  • One-keystroke exit (`) back to the main menu

Usage

  1. Flash the firmware to your Cardputer.
  2. Boot the device and open the main menu.
  3. Select UART AutoShell. The baud-rate picker appears.
  4. Navigate with ; (up) and . (down). Press Enter to select.
  5. Choose “Auto-detect” or a fixed rate. During auto-detect a spinner shows progress.
  6. The GPS on UART2 is released and UART1 starts at the selected speed.
  7. Type commands – each character is echoed; press ` to quit.

Key bindings

Key Function
Enter Send CRLF and begin a new prompt
Del Send backspace (0x08)
` Quit AutoShell
; Menu up (baud picker)
. Menu down (baud picker)

Auto-detection heuristic

Each candidate baud-rate is tested for 1.2 s. The scan accepts a rate when

  • ≥ 30 bytes are received, and
  • printable bytes ≥ 60 % of the total.
A rotating spinner shows progress during the scan.

Scrolling implementation

Whenever the cursor would move below height – LINE_H, the display is scrolled up by one text line using scroll(0, -LINE_H) and the cursor is repositioned. This avoids frame-buffer copies and keeps scrolling smooth.

Ressources

Cameras & IoT

Videos

Clone this wiki locally