DEV Community

Cover image for I built a portable serial terminal for ESP32/Arduino in Rust — because my board kept resetting
코딩나우(하늘아래)
코딩나우(하늘아래)

Posted on

I built a portable serial terminal for ESP32/Arduino in Rust — because my board kept resetting

If you debug ESP32 boards over serial, you probably know this one: you flash the firmware, rush to open a serial monitor to catch the boot logs… and the act of opening the monitor resets the board. The DTR/RTS lines toggle on connect, the ESP32 auto-resets, and the first lines you actually wanted are gone.

I hit this enough times that I built my own terminal.

CNTerminal
Live + download: https://www.coding-now.com/en/cnterminal Source (MIT): https://github.com/cflab2017/tool_serial_terminal_Rust

It's a free, portable serial terminal for Windows — a single ~8 MB .exe. No installer, no runtime, no admin rights: drop it on a USB stick, run it on a locked-down lab PC, done.

What it does:

DTR / RTS control — the reason it exists. Keep DTR from toggling on connect and the ESP32 doesn't auto-reset, so you actually see the boot output.
HEX send & receive — for binary protocols, plus an ASCII ↔ HEX converter built in (no more alt-tabbing to a converter site mid-debug).
5,000-line auto-trim — long logging sessions don't slowly eat your RAM or lag the UI.
The usual: port/baud selection, timestamps, a dark amber CRT theme that's easy on the eyes during long sessions.
Why Rust + egui
I wanted a single file people could run anywhere, which ruled out anything with a runtime. Rust + egui turned out to be a great fit: the whole GUI app compiles to one small native binary, immediate-mode UI keeps the serial read loop and the rendering loop simple to reason about, and serialport-rs handles the device side.

The trickiest part wasn't the UI — it was making the serial reader thread, the auto-trimmed scrollback buffer, and the GUI repaint cooperate without dropping bytes at high baud rates. If you're curious, the source is MIT and pretty small.

Honest scope
Windows only for now (single-exe portability was the goal).
It's a terminal, not an IDE plugin — it does serial I/O well and nothing else.
If you live in a serial monitor — Arduino, ESP32, STM32, industrial gear over RS-232 — give it a try and tell me what's missing compared to your current setup. Feature requests and bug reports are very welcome, here or on GitHub.

Top comments (0)