---
id: TASK-129
title: Pico firmware — command parser + USB serial
status: Done
assignee: []
created_date: '2026-03-29 20:51'
labels:
  - firmware
milestone: m-2
dependencies: []
priority: high
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Write command_parser.py (JSON line parser, validates & dispatches to servo/LED) and transport_usb.py (non-blocking USB serial listener at 115200 baud).
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Parses all command types: pan/tilt, led, led_pwm, home, ping
- [ ] #2 Returns JSON ack with current position
- [ ] #3 Graceful error handling for malformed JSON
- [ ] #4 Non-blocking stdin poll with buffer overflow guard
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
command_parser.py: stateless dispatcher with strict validation, defined processing order. transport_usb.py: select.poll non-blocking with 512-char overflow guard.
<!-- SECTION:FINAL_SUMMARY:END -->
