1 (edited by timothyp 2019-07-11 03:15:04)

Topic: DeviceList.Local.GetHidDevices does not list all devices on Ubuntu 19

I have a number of different systems running Linux:

14.04
18.04
19.04
19.10

On 14.04 and 18.04 when I call `DeviceList.Local.GetHidDevices ` I get all HID devices  including our custom devices.
However, on Ubuntu 19.04 and 19.10 I do not get all HID devices. 

Microsoft Tranceiver, VID: 0x045E, PID: 0x07A5 is returned on all versions of Ubuntu
Custom HID Device 1, VID: 0x1A86, PID: 0xE0E0 is returned on all versions of Ubuntu
Custom HID Device 2, VID: 0x483, PID: 0x5750 does not show up on Ubuntu 19.04 and 19.10

On all systems `lsusb` finds all the devices.

While this is probably more related to Ubuntu than the library, I am wondering if anyone has any idea what might be causing this.

Update:

On Ubuntu < 19  `lsusb -t` specifies a driver for the devices that are not found on Ubuntu >= 19
while on Ubuntu >= 19 `lsusb -t ` does not.

For example on Ubuntu 18.04:
Port 6: Dev 13, If 0, Class=Human Interface Device, Driver=usbhid, 12M

On Ubuntu 19.04
Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=, 12M

2 (edited by timothyp 2019-07-11 03:25:06)

Re: DeviceList.Local.GetHidDevices does not list all devices on Ubuntu 19

As I was typing the message I realized that I might have to add a rules files

/etc/udev/rules.d/50-SomeDeviceName

With the following content:

SUBSYSTEM=="usb",ATTRS{idVendor}=="0483",ATTRS{idProduct}=="5750",MODE="0660",GROUP="mygroup",SYMLINK+="mydev%n"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="mygroup"

And reboot.

3

Re: DeviceList.Local.GetHidDevices does not list all devices on Ubuntu 19

It seems this does not work on every computer.
Just installed Ubuntu 19.10 on a  laptop and the only device `.GetHidDevices` and `GetAllDevices` returns is a single wireless controller. 
`lsusb` on the other hand does list all my devices.

So for some reason, I cannot see any other devices on this system, even though the udev rules are in place and the device,
when connected, is given a proper name as defined by my rules. 

What can I do to help debug this issue?

4

Re: DeviceList.Local.GetHidDevices does not list all devices on Ubuntu 19

After doing some research I found that on one system the hidusb driver is automatically assigned to my device
and on that system everything works fine.

But on two other systems with the exact same udev rules and also Ubuntu 19.10 the usbhid driver is not automatically assigned.

So on the working system lsbusb -t looks like this:

Port 4: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M

But on the other systems it looks like:

Port 4: Dev 3, If 1, Class=Human Interface Device, Driver=  12M

And then I can manually assign the driver like this:

echo -n "4-3:1.0" > /sys/bus/usb/drivers/usbhid/bind 

At this point HidSharp can detect the device but I cannot actually use it.
Do you have any idea what the difference between those systems might be?

5

Re: DeviceList.Local.GetHidDevices does not list all devices on Ubuntu 19

Turns out this really not an HidSharp issue but rather an issue specifically with Ubuntu 19.x
I have created a question on AskUbuntu but not much feedback up until now:

https://askubuntu.com/questions/1202799 … on-every-s