Terminal emulator for ESP32-S3 Cardputer Adv. It shows serial data on the built-in screen and sends keyboard input to USB CDC and/or UART.
- USB CDC and UART serial input/output
- Line mode (send on Enter)
- Local echo toggle
- ANSI filter toggle
- CRLF toggle (default ON)
- Status bar with live settings and connection state
- Font size toggle
- Screen frame/margins for comfortable reading
Requirements:
- Arduino CLI installed
- ESP32 core installed with FQBN: esp32:esp32:m5stack_cardputer
- M5Cardputer library installed
Build:
make build
Upload:
make upload PORT=/dev/tty.usbmodemXXXX
Monitor (optional):
make monitor PORT=/dev/tty.usbmodemXXXX BAUD=115200
- FN+1: Change PORT (USB -> UART -> BOTH)
- FN+2: Change BAUD
- FN+3: Toggle ECHO
- FN+4: Toggle ANSI filter
- FN+5: Clear screen
- FN+6: Toggle CRLF
- FN+7: Toggle font size
Notes:
- Line mode is default: typed text is sent only after Enter.
- Status bar highlights values when they differ from defaults.
The Pi must act as USB host. Use the OTG port with an OTG adapter.
Enable USB host mode for the OTG port:
- Edit
/boot/config.txtand add:
dtoverlay=dwc2,dr_mode=host
- Reboot:
sudo reboot
- Verify host mode is working (after reboot, with Cardputer plugged in):
lsusb
dmesg | tail -n 50
- Connect Cardputer -> Pi Zero 2 W OTG port.
- Verify device appears on the Pi:
dmesg | tail -n 50
ls /dev/ttyACM* /dev/ttyUSB*
You should see /dev/ttyACM0.
- Start a getty on
/dev/ttyACM0so the login banner appears on the Cardputer:
sudo systemctl enable --now serial-getty@ttyACM0.service
- Make it auto-start on every plug (udev rule):
Create /etc/udev/rules.d/99-ttyACM0-getty.rules with:
ACTION=="add", KERNEL=="ttyACM0", TAG+="systemd", ENV{SYSTEMD_WANTS}="serial-getty@ttyACM0.service"
Reload udev and reconnect:
sudo udevadm control --reload
sudo udevadm trigger
Now the Cardputer should show the Debian login banner whenever it is plugged into the Pi.
If you prefer GPIO UART, wire:
- Pi TX -> Cardputer RX
- Pi RX -> Cardputer TX
- GND -> GND
Set UART_RX_PIN and UART_TX_PIN in termputer/termputer.ino, then set
PORT:UART or PORT:BOTH on the Cardputer.
termputer/termputer.ino- main sketchMakefile- Arduino CLI build/uploadIMG_6746.jpeg- project photo
