Skip to content

Instantly share code, notes, and snippets.

@H1D
Created January 25, 2026 00:04
Show Gist options
  • Select an option

  • Save H1D/9cfe28801be92f5dcca405f33d2f87f9 to your computer and use it in GitHub Desktop.

Select an option

Save H1D/9cfe28801be92f5dcca405f33d2f87f9 to your computer and use it in GitHub Desktop.
ESP32 agenting debugging
Generic ESP32 Debugging Prompts
1. Real-Time Log Monitoring
For debugging, use real-time serial log monitoring.
Start serial capture:
```bash
PORT=$(ls /dev/cu.usbmodem* /dev/ttyUSB* 2>/dev/null | head -1)
stty -f "$PORT" 115200 raw -echo 2>/dev/null || stty -F "$PORT" 115200 raw -echo
cat "$PORT" >> /tmp/device.log &
Monitor logs:
tail -f /tmp/device.log
Search for errors:
grep -E "ERROR|crash|overflow|panic|assert" /tmp/device.log
Before reproducing issues, clear the log: > /tmp/device.log
### 2. Button/Action Emulation via Serial
Emulate user actions by sending serial commands.
Find port and send command:
PORT=$(ls /dev/cu.usbmodem* /dev/ttyUSB* 2>/dev/null | head -1)
echo "PRESS" > "$PORT"
Send with parameter:
echo "PRESS:3" > "$PORT"
Stress test:
for i in {1..100}; do
echo "PRESS" > "$PORT"
sleep 2
done
Combine with tail -f /tmp/device.log in another terminal to watch responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment