Skip to content

feat(board): surface USB vid/pid and add suggest_fqbn - #29

Merged
mixelpixx merged 1 commit into
mainfrom
feat-suggest-fqbn
Jul 27, 2026
Merged

feat(board): surface USB vid/pid and add suggest_fqbn#29
mixelpixx merged 1 commit into
mainfrom
feat-suggest-fqbn

Conversation

@mixelpixx

Copy link
Copy Markdown
Owner

Fifth of the v0.6.0 series (pain point 5: unidentifiable boards are a dead end requiring manual boards.txt archaeology).

What changed

USB identity everywhere. list_connected, arduino_context, and arduino_serial list_ports include each port's vid/pid (+ serial number).

suggest_fqbn {name?, port?} — escapes the dead end:

  • VID lookup: native vendors (Espressif/Arduino/Raspberry Pi) yield family FQBN candidates; bridge chips (CH34x/CP210x/FTDI) are honestly labeled "identifies the adapter, not the MCU".
  • Fuzzy name matching with fused tokens ("esp32 s3" ↔ "ESP32S3") and a filler-token rule so the generic Dev Module outranks specialized boards for a generic query.
  • arduino-cli hides FQBNs for not-installed platforms (returns fqbn: "") — those candidates are kept, carry the platform id from packageId, and produce core_to_install + a hint naming the exact install_core call. Deprecated platforms skipped.

Verified (hardware + index)

  • COM6 reports 0x1A86/0x55D3 (CH343) with serial number
  • Bridge port alone → honest adapter-not-MCU explanation, no fabricated candidates
  • "esp32 s3"esp32:esp32:esp32s3 (Dev Module) ranked above S3-Box/XIAO
  • "raspberry pi pico" (platform not installed → hidden FQBN) → core_to_install: arduino:mbed_rp2040 with re-run hint

Testing found and fixed three real bugs before merge: empty-FQBN rows being dropped, packageId shape ({vendorId, arch}, not {id}), and a hint that printed fqbn "null".

🤖 Generated with Claude Code
EOF

Boards whose USB VID/PID appear in no boards.txt (most ESP32-S3 devkits)
can NEVER be auto-identified by arduino-cli - the port shows
identified:false and the only path forward is an explicit FQBN, which
during the first hardware session meant grepping boards.txt by hand. There
was no tool to escape that dead end.

- list_connected, arduino_context connected_boards and arduino_serial
  list_ports now include each port's USB vid/pid (and serial_number on
  list_connected) from the port properties arduino-cli already reports.
- New arduino_board action suggest_fqbn {name?, port?}:
  - The port's VID is looked up in a small vendor table. Native vendors
    (Espressif 303a, Arduino 2341, Raspberry Pi 2e8a) yield family FQBN
    candidates; bridge chips (WCH CH34x, CP210x, FTDI) are honestly
    labeled "identifies the adapter, not the MCU - identify by name".
  - Names are fuzzy-matched over installed boards and the board index,
    with fused-token handling ("esp32 s3" matches "ESP32S3") and a
    filler-token rule so the generic Dev Module outranks specialized
    boards (Box, XIAO, ...) for a generic query.
  - arduino-cli hides FQBNs for boards on not-installed platforms (they
    come back with fqbn "") - those candidates are kept, carry the
    platform id from packageId {vendorId, arch}, and drive
    core_to_install plus a hint naming the exact install_core call.
    Deprecated platforms are skipped.

Verified on hardware and index: COM6 reports vid 0x1A86/pid 0x55D3
(CH343); suggest_fqbn on that bridge port alone returns the honest
adapter-not-MCU explanation with no fake candidates; port+name "esp32 s3"
resolves to esp32:esp32:esp32s3 (ESP32S3 Dev Module) ranked above
S3-Box/XIAO; "raspberry pi pico" (platform not installed, fqbn hidden)
returns core_to_install arduino:mbed_rp2040 with a re-run hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mixelpixx
mixelpixx merged commit 0710185 into main Jul 27, 2026
@mixelpixx
mixelpixx deleted the feat-suggest-fqbn branch July 27, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant