Skip to content
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

Support for Model O2 Wireless #1

Open
dxbednarczyk opened this issue May 16, 2023 · 2 comments
Open

Support for Model O2 Wireless #1

dxbednarczyk opened this issue May 16, 2023 · 2 comments

Comments

@dxbednarczyk
Copy link
Owner

cc @Karagra

I'd be willing to help with this in my fork at dxbednarczyk/mxw. Just to make sure - most of the previous mice models used a vendor ID of 0x258A, while in the logs you've provided it shows (what I'm assuming is hex, I'm not a Linux/dmesg pro) 0x093a. Support should be as easy as just adding the product ID to the list in main.rs.

Amazing.. That would be great. Is there any extra info you need from me to add this in?

@Bobonium
Copy link

Bobonium commented May 28, 2024

Hey,

I did some tests, and unfortunately I don't think it's as straight forward in the implementation as initially thought.

You've correctly mapped the vendor ID based on the logs, it is "0x93A" as you've mentioned in your post

The wireless dongle has the ID "0x822D"
The mouse directly connected through USB has the ID "0x822A"

For testing purposes I added the devices to the enum and changed the vendor ID.
Nonetheless I got the no matching device found error, so I did some further digging and in line 25 of the main.rs (
https://github.com/dxbednarczyk/mxw/blob/master/src/main.rs#L25 ) you also check that the interface_number is equal to glorious::INTERFACE which is configured to 0x02

So I printed the d.interface_number() for all occurences of the wireless and wired version of the mouse and the result is always either 0x00 or 0x01. I then tried changing that hardcoded value to 0x00 and to 0x01 but neither was successful, either value resulted in Error: hidapi error: ioctl (SFEATURE): Broken pipe

I then went a step further and instead of dynamically searching for the correct entry in the iterator, I converted it to a map and manually tested every occurence that matched against the o2 wireless mouse, and they all resulted in the Error: hidapi error: ioctl (SFEATURE): Broken pipe error I received before.

Just to be sure I also retried this with a different USB port and different cables for the wired connection, but all tries resulted in the same error, I also tried running with root and my own user, but the results were always equal.

Finally I tried pinpointing the exact line of error and for report battery it occurs in line 12 in the util/status.rs https://github.com/dxbednarczyk/mxw/blob/master/src/util/status.rs#L12

I've never worked with HID before, but to me this looks like the O2 Wireless mouse does not communicate like the other devices offered by glorious. Since I've got no idea how to find out how to properly communicate here, I can't do much more.

@dxbednarczyk
Copy link
Owner Author

It is true that the communication method is different. Now that Glorious have released CORE 2.0, the site states

CORE 2.0 is compatible with all Glorious products except the
GMMK 1, Model O/O- Wired (V1), Model D/D- Wired (V1)*

To add support for these newer models, the same "brute force" way of reverse engineering it is required, unpacking the .asar in the source (if the new app is still an Electron-like) and recording the USB activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants