-
Notifications
You must be signed in to change notification settings - Fork 281
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
Scan machine port to /dev/serial/by-id/whatever if available (eg on Linux) #789
Comments
I'd be interested to know what ports are listed after updating to pyserial 3.4 and applying the following patch: plover/gui_qt/machine_options.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git i/plover/gui_qt/machine_options.py w/plover/gui_qt/machine_options.py
index 63dbc3b9..ebe87daf 100644
--- i/plover/gui_qt/machine_options.py
+++ w/plover/gui_qt/machine_options.py
@@ -54,7 +54,7 @@ class SerialOption(QWidget, Ui_SerialWidget):
def on_scan(self):
self.port.clear()
- self.port.addItems(sorted(x[0] for x in comports()))
+ self.port.addItems(sorted(x[0] for x in comports(include_links=True)))
def on_port_changed(self, value):
self._update('port', value) |
Thanks for looking into this! Here's my transcript:
Maybe comports/include_links doesn't recurse into the subdirs of /dev I'm seeing three symbolic links to /dev/ttyACM0 in /dev:
I have no idea what that first one is. The second one I like very much, and think should be the default. The third one is interesting... It does seem to map to a particular USB port. I moved my ErgoDox to different USB ports and just the digit before "-usb" changed (and it changed back to "1-usb" when I put it back to where it was originally plugged in.) Somebody might like to configure their Plover to connect to "whatever is plugged into the that front/right USB port". But I'm not concerned with this use case. |
Yeah, the implementation of comports/include_links unfortunately looks only in I think the real issue is Plover not detecting the removal, keeping the device open, hence the new device name on re-plug. Seeing as the information returned by Additionally, when starting the machine, if the port does not match an existing port name, we could try to match on the description/hardware ID (pyserial includes a This way, since manual editing is allowed in the combobox, you could use something like Note: the QMK firmware supports MIDI, and the MIDI plugin actually supports a glob, so you can use something like |
Classification: Feature (New)
This is a feature request for Linux, though there might be other systems that could benefit from this.
The issue: when I unplug my ErgoDox, then plug it in again, it gets a different path in /dev so I have to open Plover settings, go to the machine tab, scan and ok it every time.
Today I realized that there might be a path in /dev that is the same (always points to my ErgoDox) and there is, it's
/dev/serial/by-id/usb-ErgoDox_EZ_ErgoDox_EZ-if03
in my case.Now that I've put that in my settings, I'm hopefully all set.
My feature request is to have Plover use this path automatically when it scans, instead of the far more ephemeral
/dev/ttyACM0
or whatnot.P.S. The former path is a link to the latter, i.e.:
The text was updated successfully, but these errors were encountered: