Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to auto-choose serial port if only one matches a known USB device #367

Closed
jneem opened this issue Mar 19, 2023 · 2 comments · Fixed by #374
Closed

option to auto-choose serial port if only one matches a known USB device #367

jneem opened this issue Mar 19, 2023 · 2 comments · Fixed by #374
Labels
enhancement New feature or request

Comments

@jneem
Copy link
Contributor

jneem commented Mar 19, 2023

Because I often have a few USB-serial devices connected, my esp device gets a path like /dev/ttyACMn but the n is unpredictable. This prevents me from using the serial option in my espflash.toml file, and the presence of multiple serial ports also prevents cargo espflash from auto-connecting to one. But I usually connect only a single esp device, and so cargo espflash always highlights a single "known common dev board", and it's always the one I want.

Would you accept a PR to add an option (either a CLI flag or something in the config file) to say that if there's a single known dev board then auto-connect to it?

@jessebraham jessebraham added the enhancement New feature or request label Mar 24, 2023
@jessebraham
Copy link
Member

Sorry for taking so long to get to this, thanks for opening this issue.

I would be happy to accept a PR for this functionality, I think it makes sense from a UX perspective. I'm not entirely sure how to go about doing this, maybe if there's only a single recommended device we can just select it regardless, no setting/flag required. I'm not really sure if there are any downsides to this, I'll have to think about it a bit I suppose. If you have any further input on this I'd be glad to hear it!

@jneem
Copy link
Contributor Author

jneem commented Mar 25, 2023

Yeah, I don't have a real motivation for making it a flag; I mainly just suggested it to be conservative. I'll put up a PR that enables the auto-selection with no flag, but if you decide you'd rather go with one I'd be happy to change it.

I think the only downside of having a flag is increased complexity. As far as UX goes, I was just planning to add runner = "espflash --monitor --enable-auto-whatever" to my .cargo/config.toml, so I'll never have to type out that flag anyway 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants