Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🔧 Using a Configuration File

Starting from ComChan v0.1.9, you can use a configuration file to streamline your workflow by saving frequently used options. This avoids the need to repeatedly pass flags through the command line every time you run comchan.

📁 Generate the Default Config File

You can generate a default configuration file by running:

comchan --generate-config

This will create a file at:

~/.config/comchan/comchan.toml

📝 Example comchan.toml

# ComChan Configuration File
#
# This file contains default settings for ComChan serial monitor.
# Command-line arguments will override these settings.
#
# To use auto-detection, set port = "auto"
# Available parity options: "none", "odd", "even"
# Available flow control options: "none", "software", "hardware"

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

⚙️ Configuration Fields Explained

KeyTypeDescription
portstringThe serial port to connect to. Set to "auto" to let ComChan pick the first available serial port automatically. You can also manually specify a port like "/dev/ttyUSB0" or "COM3" depending on your OS.
baudintegerThe baud rate used for communication. Common values include 9600, 115200, etc. Default is 9600.
data_bitsintegerNumber of data bits per frame. Valid values are usually 5, 6, 7, or 8. Default is 8.
stop_bitsintegerNumber of stop bits. Set to 1 or 2. Default is 1.
paritystringParity checking mode. Options are "none", "odd", or "even". Default is "none".
flow_controlstringFlow control method. Valid options: "none", "software" (XON/XOFF), or "hardware" (RTS/CTS). Default is "none".
timeout_msintegerTimeout in milliseconds for reading from the serial port. Prevents indefinite blocking. Default is 500.
reset_delay_msintegerOptional delay (in ms) after opening the port. Useful for microcontrollers that reset on port open (e.g., Arduino). Default is 1000.
verbosebooleanEnables detailed logging if set to true. Helpful for debugging configuration or runtime behavior. Default is false.
plotbooleanEnables the real-time serial plotter if set to true. Default is false.
plot_pointsintegerMaximum number of data points shown on the plot at once. Only applicable if plot = true. Default is 100.

NOTE

The default baud rate is 9600, but you can customize it in the config file as needed

All values in the config file can still be overridden at runtime via command-line arguments like --port, --baud, --plot, etc.

Outputs

Serial monitor (plot = false)

plotfalse

Serial Plotter (plot = true)

plottrue