OpenAcousticDevices / USB-HID-Tool

A command line tool for accessing USB HID devices.
MIT License
38 stars 11 forks source link

Tool seems to not work #1

Closed dnlw07 closed 1 year ago

dnlw07 commented 3 years ago

Hello, I have an issue

I am using Logitech MS 2s mouse I am trying to catch and send request to change channel of the mouse from channel 1 to 2.

I found the proper hex code which is doing that:

10 02 41 04 71 61 40

unfortunately while I am trying to send the command using USB-HID-Tool:

usbhidtool 0x046D 0xC52B 0x10 0x02 0x41 0x04 0x71 0x61 0x40

I receive following errors:

ERROR: device not connected

and on my second laptop:

ERROR: incorrect response from the device

I am not sure if I am doing something wrong or it is a tool error.

Should I use compile USB-HID-Tool using Microsoft Visual C++ Build Tools or just used pre-compiled usbhidtool.exe files downloaded from Github repository?

mmarquezs commented 2 years ago

* I comment this for reference in case somebody ends up here.

I can confirm that the built binary for windows works at least for sending, for my use I didn't need a response. The hidtool always returns a "ERROR: Incorrect response from device" in my use case but it doesn't matter for my use tough My use case was to turn on/off the Farming Simulator 22 Collectors Edition beacon light outside the game. And in that case sending the packets with this worked. I include here the packets/example commands as reference:

To turn on: (it doesn't stay on, the game seems to keeps sending this packet every 3 seconds, although it lasts on more than that):

.\usbhidtool.exe 0x340D 0x1710 0x0 0xFF 0x01 0x66 0xC8 0xFF 0xAD 0x52 0x81 0xD6

To turn off before it auto turns off:

.\usbhidtool.exe 0x340D 0x1710 0x0 0xFF 0x00 0x00 0x64 0x00 0x32 0x9E 0xD7 0x0D

There might be a way to set up the time it stays on in that packet or something no idea but it was enough for me.