Skip to content

RaftSerialConsoleSysMod

Rob Dobson edited this page May 3, 2026 · 1 revision

SerialConsole SysMod

Built-in SysMod that exposes the REST API over a UART. Lets a developer type API requests directly into the serial console and receive JSON responses, while simultaneously carrying a binary protocol channel (RICSerial / RICJSON) for tool-driven access.

Source: RaftSysMods/components/SerialConsole/

What it provides

  • ASCII command entry: type subscription?topic=devjson&rateHz=10 + Enter.
  • Binary channel multiplexed on the same UART using ProtocolOverAscii (MSB-set bytes carry framed binary; MSB-clear bytes are user input).
  • Registers a Comms Channel so the binary side participates fully in the channel system.
  • XON/XOFF flow control hint via getXonXoff().

SysType configuration

{
    "name": "SerialConsole",
    "enable": 1,
    "uartNum": 0,
    "baudRate": 115200,
    "rxBuf": 1024,
    "txBuf": 4096,
    "crlfOnTx": 1,
    "protocol": "RICSerial"
}
Key Default Meaning
enable false Master switch
uartNum 0 ESP32 UART number
baudRate 115200 Baud rate
rxBuf / txBuf 1024 / 4096 UART driver buffer sizes
crlfOnTx true Send CRLF on tx line endings
protocol "RICSerial" Protocol codec attached to the binary side

REST endpoints exposed

Endpoint Method Purpose
console GET Console control (e.g. show registered endpoints)

Notes

  • This is the recommended way to test Raft REST endpoints during bring-up — no network required.
  • Logging output (LOG_I etc.) shares the same UART; the binary protocol uses MSB-set bytes so it does not collide with log text.

Related

Clone this wiki locally