Install on MicroPython
Use mpremote mip to install directly from GitHub, or copy the repository's urst/ directory to the board filesystem.
mpremote mip install github:simonl65/URST-mpyGetting started
URST-mpy is useful when a serial link can drop, corrupt, or split data. The transport gives your application a message-level API with retries, CRC validation, and automatic fragmentation.
Use mpremote mip to install directly from GitHub, or copy the repository's urst/ directory to the board filesystem.
mpremote mip install github:simonl65/URST-mpyPass an initialized UART object toUrst. Pin numbers vary by board; this example uses UART0 on a Raspberry Pi Pico-style layout.
from machine import UART, Pin
from urst import Urst
uart = UART(
0,
baudrate=57600,
tx=Pin(0),
rx=Pin(1),
)
transport = Urst(uart)Work with byte strings. URST-mpy handles frame boundaries, acknowledgements, retransmission, and reassembly under the API.
transport.send(b"Hello from Pico!")
message = transport.read()
if message:
print(message.decode())For PC-side testing or bridge applications, installpyserial and open the transport with a serial port name.
pip install pyserialfrom urst import Urst
transport = Urst(port="/dev/ttyUSB0", baud=57600)
transport.send(b"Hello from Desktop!")Protocol notes