Simple standalone tool to capture serial data and save to CSV.
pip install -r requirements.txtpython serial_capture.py output.csv -p /dev/ttyACM0 -b 921600 -f 2 -c 50 -t| Argument | Short | Description | Default |
|---|---|---|---|
output_file |
- | Output CSV filename | capture.csv |
--port |
-p |
Serial port | /dev/ttyACM0 |
--baud |
-b |
Baud rate | 921600 |
--fields |
-f |
Expected fields per line | 2 |
--chunk |
-c |
Buffer size before writing | 50 |
--timestamp |
-t |
Include timestamp column | No |
--verbose |
-v |
Show invalid line warnings | No |
Basic capture (2 fields, no timestamp):
python serial_capture.py data.csvWith timestamp:
python serial_capture.py data.csv -tDifferent port/baud:
python serial_capture.py data.csv -p /dev/ttyUSB0 -b 115200Show warnings for invalid lines:
python serial_capture.py data.csv -vCSV file with header row. Invalid lines (wrong field count or non-numeric values) are silently discarded.
Press Ctrl+C to stop - remaining buffer is saved before exit.