-
Notifications
You must be signed in to change notification settings - Fork 901
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
Stable path for multiple USB devices (on LInux)? #405
Comments
Hi, You may find that if you recompile Also, you say you don't have a serial number, but is there something in your device's protocol where you can write a non-volatile bit of data you could use as an ID? |
HI,
This is on Fedora. I am not (yet) building from source. It does depend on libusb, but I haven't checked to see how it's built, nor have I tried to rebuild it, yet.
Not that I'm aware of. It's a Sainsmart-16 relay board. The protocol appears to be pretty simple, to get and set 16 bits of data (to turn on and off each of the 16 relays). I know of no NV data, but the docs are pretty thin as-is. |
Here's a quick |
Apologies, I am wrong. Disregard the above comment. I really thought the |
I know that the kernel has the information about what port the device is plugged into. It's printed clearly in the dmesg log, so the information is available -- it's just a question of reading it (or using it). |
@todbot -- it looks like |
For the record, if I use the linux/hidraw version I could easily combine it with a udev rule to stabilize the path. I think the problem here is hidapi using |
C.f. #406 |
- explicitly add Iconv as a dependent library; - check if iconv requires pointer-to-const as input (introduce ICONV_CONST check); - NetBSD CI (has external Iconv library implementation that uses all of the above);
I've got multiple devices that I'm trying to access in a stable manner. They do not provide a serial number or other uniquifying data that I can see. I tried to use the HID path but it looks like that's not a stable number -- each time I remove and re-insert the device (into the same USB port) the HID path changes. Is there some way to access the underlying USB path (which DOES appear to be stable)? E.g.:
I had the first device on usb-0000:00:14.0-4 which I removed and reinserted, and then I removed/reinserted the second device on usb-0000:00:14.0-1. Unfortunately I don't see any way to access this information from hidapi. Worse, the hid path changes on every insert (see the 0005, 0006, 0007, 0008? That gets reflected in an increasing hid path).
So without a serial number, what's the path (pun intended) to a stable reference to a HID device? The full dmesg for an insertion looks like:
Thanks.
The text was updated successfully, but these errors were encountered: