
Esp32 Serial Commands
If you're testing ESP32 firmware and tired of physically pressing buttons, this sends commands over USB serial to trigger actions programmatically. You add a simple command parser to your device code (works with ESP-IDF or Arduino), then echo commands from your terminal to simulate button presses, screen changes, or whatever you wire up. The skill includes actual device-side code and bash scripts for stress testing, like sending 100 presses in a loop or running hour-long stability tests. It's straightforward automation that beats reflashing or physical interaction when you're debugging. The approach is basic but that's the point, it just works without extra dependencies.
- skills.sh installs
- 287
- GitHub stars
- 11
- last updated
- Aug 21, 2026
Install
$ npx -y skills add h1d/agent-skills-esp32 --skill esp32-serial-commands --agent claude-codeInstalls into .claude/skills of the current project.
Files
ESP32 Serial Command Emulation
Overview
Send commands directly to the serial port to emulate button presses and user actions. Works over USB serial.
ESP32 Setup (Device Side)
ESP-IDF Framework
#include "esp_log.h"
#include <string.h>
static const char* TAG = "SerialCmd";
void serial_command_task(void* arg) {
char buf[64];
int idx = 0;
while (1) {
int c = getchar();
if (c == EOF) {
vTaskDelay(pdMS_TO_TICKS(10));
continue;
}
if (c == '\n' || c == '\r') {
buf[idx] = '\0';
if (idx > 0) {
ESP_LOGI(TAG, "Command: %s", buf);
if (strcmp(buf, "PRESS") == 0) {
button_callback();
} else if (strncmp(buf, "SCREEN:", 7) == 0) {
int screen = atoi(buf + 7);
go_to_screen(screen);
}
}
idx = 0;
} else if (idx < sizeof(buf) - 1) {
buf[idx++] = c;
}
}
}
// In app_main():
// xTaskCreate(serial_command_task, "serial_cmd", 2048, NULL, 5, NULL);
Arduino Framework
Sponsors
Details
- Repository
- github.com/h1d/agent-skills-esp32
- Categories
- Testing & QA, AI & Agent Building, Debugging, Automation & Workflows, Design & UI/UX
- First seen
- Jun 3, 2026