In my earlier post I was using libhid however due to it’s alleged problems with multi-threading I decided to use PyUSB instead. The code is a bit different, however a little shorter and simpler.
One notable thing to be aware of is that device I’m using is HID device and Linux is automatically loading HID drivers for it so it needs to be unloaded for PyUSB to continue working. That’s done by calling dev.detachkernel_driver(0)_ I suppose the device is used as vendor-specific device then, but who cares.
Anyway, here’s the code, should be a bit simpler than before:
Comments