-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(esptool): allow filtering ports by VID/PID (ESPTOOL-878) #988
Conversation
Thank you for the contribution. I think this is a good idea but we might think about a little what new CLI arguments we add. I'm worried that others might need other type of filtering (e.g. serial_number, location) for which we would have to add also new arguments.
What do you think @radimkarnis, @peterdragun? |
Overall I like the idea, but as mentioned I would go with one argument for both options. |
I think this could be covered by the following if we go with my second proposal:
|
I like this.
Are you thinking a substring search, or should we check against a prefix from the pyserial port name, like |
Substring search is what I had in my mind. On the other hand, what would be great to update in this PR is the documentation and mention this new feature somewhere. Perhaps in a separate section in https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/advanced-options.html. |
Hi @bryghtlabs-richard. Could you please get back to this pull request and finish it as we've discussed? |
326d323
to
5cc4df4
Compare
👋 Hello bryghtlabs-richard, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. Click to see more instructions ...
Review and merge process you can expect ...
|
5cc4df4
to
a22d8b5
Compare
Hi @dobairoland , I'm back from a vacation and I think I've got everything we want, and updated the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This looks pretty good. I've left a couple of last suggestions.
a22d8b5
to
77e986d
Compare
Thanks Roland, I've updated the commit with your suggestions. |
77e986d
to
b207903
Compare
Suggestion: A nice touch would be to add a mention about the Espressif USB customer-allocated PID repository Feel free to ignore, though! |
Enable user to specify USB VID, USB PID, or port name to filter the com port list before checking for ESP chips. Implements espressif#987
b207903
to
5dd3dcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature, thanks for finishing this! LGTM.
Agree, nice feature! |
@bryghtlabs-richard Thank you for the contribution. It was merged. |
Enables user to specify --usbVid and/or --usbPid, which filter the com port list before checking for ESP chips. With many serial ports on the computer, this greatly speeds up the process of esptool identifying the correct com port by allowing esptool to skip all com ports without a matching VID/PID. Implements #987
I have tested this change with the following hardware & software combinations:
NO TESTING ON MAC/LINUX. Tested on Windows64 with ESP32-S3-DevKitC and custom ESP32-S3 board.
I have run the esptool.py automated integration tests with this change and the above hardware:
$ pytest test_esptool.py --port COM49 --chip esp32s3 --baud 230400
============================= test session starts =============================
platform win32 -- Python 3.11.5, pytest-8.2.2, pluggy-1.5.0
rootdir: C:\Projects\esptool
configfile: pyproject.toml
collected 88 items
test_esptool.py sss.......ss.................s.s.........s....sss.s..... [ 63%]
......s...sssssss..ssss..s..ssss [100%]
============================== warnings summary ===============================
test_esptool.py:120
C:\Projects\esptool\test\test_esptool.py:120: PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.flaky(reruns=1, condition=arg_preload_port is not False)
test_esptool.py:1204
C:\Projects\esptool\test\test_esptool.py:1204: PytestUnknownMarkWarning: Unknown pytest.mark.flaky - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.flaky(reruns=5)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========== 59 passed, 29 skipped, 2 warnings in 415.91s (0:06:55) ============