Skip to content

Improves Setup / Flashing When Multiple USB Devices - #4

Merged
anildash merged 5 commits into
anildash:mainfrom
vanev:setup-port-picker
Oct 3, 2026
Merged

anildash merged 5 commits into
anildash:mainfrom
vanev:setup-port-picker

Conversation

@vanev

@vanev vanev commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With more than one USB serial device plugged in, flashing doesn't work. setup prints "Heads up: several boards found", then "no board found", which isn't true, and there's no way to go on from there. The README's hand-flash command has the opposite problem: arduino-cli board list | grep … | head -1 flashes whichever port comes first, which can overwrite another board's firmware.

I ran into this with a second ESP32-S3 board plugged in alongside my dashtouch.

Solution

Before it's flashed, a dashtouch is just another board, so we cannot tell it apart from the others, the user has to choose. With several devices plugged in, setup and pairing now show:

4. More than one USB device is plugged in:
      1) /dev/cu.usbmodem1402    Adafruit QT Py ESP32-S3 No PSRAM <- the helper is connected to this one
      2) /dev/cu.usbmodem123456    Other USB Device
    Which one should get the Dashboard Touch firmware? [1]

If the helper is already connected to one of the devices, that one is suggested ([1]) and marked in the list. If there is only one device, it has the same yes/no prompt as today (now showing the device's name).

If the user knows the USB port, they can skip the question by providing the --port flag.

vanev and others added 5 commits September 25, 2026 14:14
find_port() returns a bare /dev path and gives up when there's more than
one. To let someone choose between boards, each port needs a name a person
recognizes and an identity that survives a reset renaming its /dev node.

usb_ports() returns both, for the same /dev/cu.usbmodem* ports find_port()
considers. Nothing uses it yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With more than one USB serial device attached, flashing gave up: setup
printed "Heads up: several boards found" and then "no board found", which
isn't true and leaves no way forward.

Before it's flashed, a dashtouch is just some board, so nothing can tell it
apart from the others. The person has to choose. find_and_flash now lists
the ports by name and asks which one to flash:

- The board the helper already has open is the default, so a reflash is
  one keypress. Otherwise Enter skips flashing.
- A bad answer asks again; running out of input skips.
- A single device keeps today's yes/no prompt, now showing its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Releasing the port drops DTR, which can reset the board onto a new /dev
node, so find_and_flash looks the port up again before uploading. It did
that with find_port(), which gives up when more than one usbmodem port is
present, and the flash then went to the stale name.

Match the chosen board's USB identity instead, which works however many
other boards are plugged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For scripts, or anyone who'd rather name the board than be asked:
`--port <device>` skips the question and flashes that port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`arduino-cli board list | grep … | head -1` flashes whichever usbmodem
port happens to be listed first. With another board plugged in, that can
overwrite its firmware. Have the reader find their board's port and say
why it matters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anildash

anildash commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Looks clean, and good catch on this — thanks for it!

@anildash
anildash merged commit 2e46c6b into anildash:main Oct 3, 2026
2 checks passed
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.

2 participants