Universal Reliable Serial Transport

Reliable serial messages for MicroPython boards.

URST-mpy turns a plain UART link into a dependable message channel. It handles framing, CRC checks, acknowledgements, retries, and message fragmentation for boards such as the Raspberry Pi Pico and ESP32.

  1. Handlersend() and read()
  2. ProtocolCONNECT, ACK, NAK, retry
  3. Transportframe type, sequence, fragments
  4. CodecCOBS, CRC-16, UART I/O

Why use it

Built for links that are useful but not perfect

Reliable delivery

Strict stop-and-wait ARQ waits for ACK and retries when a frame is lost or rejected.

Error checked frames

Every frame carries CRC-16/CCITT-FALSE validation, with COBS encoding for unambiguous zero-delimited framing.

Large message support

Messages larger than the physical MTU are fragmented and reassembled automatically by the transport.

Hardware agnostic

Use the same transport with MicroPython UART objects or desktop Python serial ports for gateways and tests.

Quick start

Install it on a board

Install directly with mpremote mip, or copy theurst/ package onto your MicroPython filesystem. Then pass URST a UART object and work with complete byte messages instead of raw serial chunks.

Follow the getting started guide
Install URST-mpy from GitHub
mpremote mip install github:simonl65/URST-mpy

Example

A small API over a noisy link

URST-mpy keeps application code direct: initialize the transport, send bytes, and poll for complete reassembled messages.

Minimal receive loop
import machine
import time
import urst

uart = machine.UART(
    0,
    baudrate=57600,
    tx=machine.Pin(0),
    rx=machine.Pin(1),
)
transport = urst.Urst(uart)

transport.send(b"Hello from Pico!")

while True:
    message = transport.read()
    if message:
        print("Received:", message.decode())
    time.sleep(0.1)