UART Configurator: Runtime parameter management for embedded devices
Overview
uart_configurator is a modular firmware parameter management system designed for embedded projects (ESP32) that need per-device configuration without rebuilding firmware. It exposes a serial CLI over UART, validates input, persists settings to EEPROM (with CRC32), and provides an extensible pattern for adding parameters and validators.
Why this helps
- Configure dozens or hundreds of devices without recompiling firmware
- Recover settings automatically on boot
- Validate inputs before saving to prevent runtime errors
- Extendable parameter table and validators for custom application needs
Key features
- Interactive Serial CLI (115200 baud) with
help,set,get,save,clear,exit - EEPROM persistence with CRC32 integrity checks
- Built-in validators (IP, port range, string length) and easy custom validators
- Type-safe
Parametersstruct and sentinel-based parameter table for easy extension - Timeout support and batch configuration flows
Architecture & project structure
Main components:
SerialCLI— parses user input and handles interactive promptsUartConfigurator— core logic, validation, state trackingParameters— struct holding parameter fields and default valuesEEPROMManager— save/load/clear with CRC32 checks
Typical layout:
1
2
3
4
5
6
7
8
9
uart_configurator/
├── src/
│ ├── SerialCLI.cpp/h
│ ├── UartConfigurator.cpp/h
│ ├── Parameters.cpp/h
│ ├── EEPROMManager.cpp/h
| └── main.cpp
├── platformio.ini
└── README.md
Quick start (PlatformIO)
- Clone the repository and open it with VS Code + PlatformIO:
1
2
git clone https://github.com/Gory-git/uart_configurator.git
cd uart_configurator
Configure
platformio.inifor your board (e.g.esp32devorupesy_wroom).Build and upload:
1
2
pio run -t upload
pio device monitor # open serial monitor at 115200
Usage example
On first boot the configurator prompts:
1
2
3
4
5
6
Configuration loaded from EEPROM:
id: void
ip: 000.000.000.000
port: 0
Modify configuration parameters? [y/n]
Enter y and use commands like:
1
2
3
4
> set id DEVICE_001
> set ip 192.168.1.100
> set port 8080
> save
Extending parameters
To add a new parameter:
- Update
Parameters.hwith the new field and default. - Implement a validator in
Parameters.cpp. - Register the parameter in
UartConfiguratorbefore the sentinel entry. - Rebuild and test.
Data integrity & safety
The EEPROMManager stores a CRC32 alongside the parameters to detect corruption. If CRC verification fails on boot, defaults are loaded. Critical operations (save/clear) ask for confirmation to avoid accidental data loss.
Use cases
- Field-deployed IoT nodes with device-specific network settings
- Sensor networks requiring different calibration per node
- Development workflows where parameters change frequently during testing
Resources & contribution
- Repository
- License: MIT