Closed Aggeloz closed 1 year ago
so far the only way i can read data from the device is on linux when i give sudo permissions to the device path
Not sure about the Windows question, but on Linux this is usually handled with an udev rule, e.g.:
ACTION=="add|change", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", MODE:="0666"
or
SUBSYSTEM=="usb", ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c9f", GROUP="uucp"
Here is what I did with my custom USB peripheral on linux:
/etc/udev/rules.d/90-rlogic.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="dead", ATTRS{idProduct}=="beef", TAG+="uaccess", MODE="0666"
Regarding windows: I really do not know, but I think it at least has been necessary to have a custom dummy driver for USB devices of any kind. At least I ran into this problem often in the win7/8 era with different electronic tools / jtags / serial to usb converters / adb.
It often came down to just installing a driver from a vendor.
However if your device is really a HID device, I think windows should have default settings to allow access from any user currently logged into a session. This is apparently why HID is a popular protocol, because it simplifies software on windows.
If I think about it, that CO2 meter sample used to work fine for me on Windows, so it might be something specific to your device.
If I think about it, that CO2 meter sample used to work fine for me on Windows, so it might be something specific to your device.
Where could i find that code sample?
Im using an ESP32S2 which has native usb support and i want to be able to send reports between a rust program and my custom usb device but so far the only way i can read data from the device is on linux when i give sudo permissions to the device path. In windows i can open the device but when i send a report the rust program cant read it at all.