-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
tools/mpremote: Fix auto-connection bug in macOS and add config option to filter ports eligible for auto-connection. #9140
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mathieu Daëron <mathieu@daeron.fr>
Signed-off-by: Mathieu Daëron <mathieu@daeron.fr>
This PR corrects a bug on macOS, where It also introduces a new configuration option, |
I don't think that PR is a good idea. Since the docs say "This command automatically detects and connects to the first available serial device" and Macs for some reason are not doing that then surely the solution is to fix that automatic connection logic rather than add an obscure "autoconnect_regexp" option which users are required to discover and configure? |
Fair point, thanks. I agree that solving the auto connect bug and adding an option to filter ports are two separate issues. I've edited the PR accordingly.
|
Signed-off-by: Mathieu Daëron <mathieu@daeron.fr>
Signed-off-by: Mathieu Daëron <mathieu@daeron.fr>
0a73138
to
f3cc3b7
Compare
rshell has about 30 lines of heuristics for autoconnection that work pretty well and may be worth borrowing: https://github.com/dhylands/rshell/blob/b87878c01aa02d6cd871ff4666983dee5584af16/rshell/main.py#L227-L254 |
Thanks for the contribution. The ideas in this PR are good, namely:
The solution to 1, restricting to But I think for 2, since it's going to be a rarely used command and therefore advanced, how about making it fully general by allowing an arbitrary filter function to be provided by the user? Eg something like port_filter = lambda p: True # default filter
...
for p in sorted(serial.tools.list_ports.comports()):
if not port_filter(p):
continue
... |
Note that a board with a WCH chip like the CH340/CH9102 (a common replacement for CP210x these days), using the official driver (which is required to work properly, at least for esptool for example) will have its name appear in the form of I would personally just exclude the default bluetooth ports if a more comprehensive filter/search is not in scope.
|
@Neradoc, |
I've tried to look into this again:
I'm guessing the |
@mdaeron , could it be that you have checked out the v1.19.1 tag , rather than the latest (master HEAD ) ? |
Fix `EPaperDisplay.time_to_refresh`
Signed-off-by: Mathieu Daëron mathieu@daeron.fr