Skip to content

Configuration

Vaishnav Sabari Girish edited this page Jun 13, 2026 · 1 revision

Configuration File (comchan.toml)

Typing out long strings of command-line flags every time you want to connect to a device can get tedious. To streamline your workflow, comchan supports a persistent configuration file.

When you launch comchan, it will automatically look for this file and apply your saved settings. Any command-line flags you pass during runtime will override the settings in this file.

Generating the Config File

You don't need to create this file manually. You can generate a default template by running:

comchan --generate-config

Where does it live?

  • Linux/macOS: ~/.config/comchan/comchan.toml
  • Windows: %APPDATA%\comchan\comchan.toml

Example Configuration

Here is what the generated comchan.toml looks like:

# ComChan Configuration File

port = "auto"
baud = 9600
data_bits = 8
stop_bits = 1
parity = "none"
flow_control = "none"
timeout_ms = 500
reset_delay_ms = 1000
verbose = false
plot = false
plot_points = 100
zephyr = false
export_limit = 1000000
plot_title = "Sensor Data"
simulate = false
csv_file = "latest_run.csv"
replay_file = "test.log"
hex_mode = false
hex_pretty = false
obj_file = "custom_model.obj"
braille = "cube" # Can also be "tetrahedron", "octahedron", or "path/to/model.wrfm"
rtt = false
elf = ""
chip = ""

Configuration Fields Explained

Below is a breakdown of what each field in the configuration file controls. They directly map to the CLI flags.

Core Connection Settings

port (String)

The serial port to connect to. Set to "auto" to have comchan find the active USB device, or specify a direct path like "/dev/ttyUSB0" or "COM3".

baud (Integer)

The communication speed. Usually 9600 or 115200.

data_bits (Integer)

Number of data bits per frame. Typically 8.

stop_bits (Integer)

Number of stop bits per frame. Typically 1 or 2.

parity (String)

Error-checking parity. Options: "none", "even", "odd".

flow_control (String)

Method of flow control. Options: "none", "software", "hardware".

timeout_ms (Integer)

How long to wait for incoming data before timing out, in milliseconds.

reset_delay_ms (Integer)

An artificial delay (in ms) applied during connection/reconnection to allow slow-booting hardware to initialize.

Visuals & Plotter

plot (Boolean)

If true, comchan will automatically launch into the 2D Serial Plotter UI on startup.

plot_points (Integer)

The maximum number of historical data points rendered on the plotter's X-axis at one time.

export_limit (Integer)

The memory cap for data points kept for SVG exports, preventing RAM exhaustion during long sessions.

plot_title (String)

The default title stamped at the top of exported SVG plots.

obj_file (String)

Path to a custom .obj 3D model. Only applicable if running with GPU-accelerated Ratty features.

braille (String)

The 3D model used for CPU wireframe rendering. Can be a built-in shape ("cube", "tetrahedron", "octahedron") or a path to a custom .wrfm file.

Advanced Modes & Debugging

verbose (Boolean)

If true, prints detailed connection logs and enables accurate local timestamps for incoming text.

simulate (Boolean)

If true, generates internal mock sensor data instead of looking for physical hardware. Great for testing layouts.

zephyr (Boolean)

If true, enables formatting optimized for Zephyr RTOS interactive shells.

hex_mode (Boolean)

If true, starts the monitor in raw hex dump mode to analyze unformatted binary data.

hex_pretty (Boolean)

If true, starts the monitor in the buffered, perfectly aligned 16-byte hex frame mode.

Logging & File Outputs

csv_file (String)

If populated (e.g., "data.csv"), comchan will automatically stream parsed numeric sensor data into this file on startup.

replay_file (String)

Path to a previously recorded .log or .csv file to play back natively.

RTT & Defmt (Hardware Probes)

rtt (Boolean)

If true, attempts to bypass standard UART and attach to the target via a debug probe (SWD) using probe-rs.

elf (String)

The path to the compiled .elf firmware file. Mandatory if rtt is true for decoding logs.

chip (String)

The specific microcontroller name (e.g., "nRF52840_xxAA"). Mandatory if rtt is true.