-
Notifications
You must be signed in to change notification settings - Fork 36
Would it be possible to add support for M913 (wireless model) ? #15
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
Comments
Hard to tell without any information, the description on the website claims that you can connect the mouse via a wireless dongle or a USB cable. Could you please post the output of Edit: i have found the USB ids by taking a look at the official software, however i obviously don't know if they are correct but have added them in 4e3195c. This means you could try to run |
Many thanks for response. So output of lsusb is: lsusb...
And I tried to execute commands you provided but no luck: [mouse_m908]$ mouse_m908 -R -
Couldn't detect mouse.
- Check hardware and perm
8000
issions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
[mouse_m908]$ mouse_m908 -D -
Couldn't detect mouse.
- Check hardware and permissions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
mouse_m908]$ mouse_m908 -p 1
Couldn't detect mouse.
- Check hardware and permissions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
|
The USB ids are indeed correct, just to rule out any weird bugs, have you tried to run mouse_m908 with root permissions (i.e. Edit: if that fails as well, you can try specifying the bus and device numbers from |
I tried options below...
[manjaro ~]$ lsusb
Bus 002 Device 010: ID 05e3:0620 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 009: ID 2109:0813 VIA Labs, Inc. VL813 Hub
Bus 002 Device 008: ID 2109:0813 VIA Labs, Inc. VL813 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 045: ID 0b05:1914 ASUSTek Computer, Inc. ROG Gaming Display Aura Device
Bus 001 Device 044: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 034: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 036: ID 1532:0235 Razer USA, Ltd BlackWidow Lite (2018)
Bus 001 Device 041: ID 25a7:fa07 Areson Technology Corp 2.4G Wireless Receiver
Bus 001 Device 031: ID 2109:2813 VIA Labs, Inc. VL813 Hub
Bus 001 Device 030: ID 2109:2813 VIA Labs, Inc. VL813 Hub
Bus 001 Device 009: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[manjaro ~]$ sudo mouse_m908 -R -
[sudo] password for tol:
Couldn't detect mouse.
- Check hardware and permissions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
[manjaro ~]$ sudo mouse_m908 -R --bus 001 --device 041
Couldn't detect mouse.
- Check hardware and permissions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
[manjaro ~]$ sudo mouse_m908 -p 1 --bus 001 --device 25a7:fa07
Couldn't detect mouse.
- Check hardware and permissions (maybe you need to be root?)
- Try with the --model option
If nothing works please report this as a bug.
|
That means the M913 uses a different protocol with at least different USB endpoints. To implement support it would be neccessary to capture the USB communication from the official software when changing the settings with wireshark, here are a few links that should explain the process, or ask here if you have any questions. https://bytepunk.wordpress.com/2017/03/25/reverse-engineering-a-usb-mouse/ If you are not interested or not able to capture USB data, that is no problem for me but please tell me clearly so this issue can be resolved. Edit: I hit the return key in the middle of typing, therefore please ignore the closing/reopening. |
Many thanks for response, unfortunately I'm not expert in this area so would not be able to implement it by myself but if you could guide me I could provide information which might be used to fix issue with M913. |
The first step would be to install the official software on Windows either in a virtual machine with USB passthrough or on bare metal. Then install wireshark (on the host if you use a VM) and capture the communication with the mouse when changing specific settings on the mouse, i.e. start a capture, change some setting, save the capture, repeat. Basically just follow the directions in the first link i posted above. I hope this helps enough to get you started. |
So I have win10 installed on VM should I install Wireshark on manjaro host or on windows (which is on KVM) ? |
Both ways should work, i personally have only used it on the Linux host and would recommend that. |
I am assuming you are on Linux, have you loaded the usbmon kernel module with |
OK so seems like I got it how to start and apply filter :). If I followed next steps like let's say go to settings assign new key for each button and for each change would save captured report, would it be enough ? |
The idea is to do these steps for any setting that you might want to implement, i.e.
It is hard to tell what might be enough without any understanding of the protocol. The more the better, the same applies for documenting what you changed. |
I've put all files into repo anvena/redragon-M913. Could you please check if it's enough ? |
I'm sorry but i can't find your repo, have you maybe set it to private or am i missing something else? |
Yes it was private and you had an access but nevertheless I made it public to simplify access |
Thanks, that was really helpful. The data you captured confirms that the mouse is indeed using a completely different protocol but support should be possible. I have created a new branch with a backend for the M913. Currently the goal is only to be able to talk to the mouse, if that works i will be implementing the actual features. For now could you please try building from that branch and running I noticed that there was no data for changing the active profile, does the mouse not have profiles or is |
Hi, I've just tried your branch please check result: sudo mouse_m908 -R -
Sorry I closed this issue by mistake so reopened it again :) |
I'll try to check profiles for mouse, I saw options "Import Profile" and "Export Profile". Will try to play with profiles. |
Thanks, the lsusb output looks good. As for the failure to detect the mouse, i honestly have no idea what is going on exactly, as it works for me when i change the IDs on the M913 backend to the IDs of my mouse. I have added some debug output for the detection on the m913 branch, could you please try it with the following commands:
Edit: Maybe try the above with the wired connection if it doesn't work with the wireless one. Note about profiles: The other mice i know about have 5 profiles stored on the mouse, i would assume that importing/exporting is independent of that. Unless you find some other options i would assume that the M913 does not have this feature as that would also fit the sent data. |
I've just captured data for profiles and updated my repository so new files have been uploaded.
|
Regarding your comment. I will pull your changes again and rebuild and then will try your commands. Update:
|
Update: Mouse does not work without wifi receiver that is when I used just wired connection. It seems that usb cable is used just for charging. |
If i understand you correctly it doesn't work with either the wired or wireless connection. Could you make certain that you are using a build that includes a04dbcf, maybe call the binary from directly from the repo with Edit: considering the version you tried with doesn't know -M913 makes it certain that it is not the most recent one |
My log:
then build package:
And finally commands:
|
Great, thank you for your time. Going to disconnect so if you need anything else will check tomorrow. |
I'm beginning to get an understanding of the protocol, here is a list of things that require capture:
This is beacuse the workflow is to extract the relevant bytes from the capture and then compare different captures to narrow down the position and meaning for each setting. Edit: i have implemented basic DPI changing in 9e4fdcd, you can try it out if you use examples/example_m913.ini and try to change the values. The interesting part is if it works for all 5 levels, implementing actual DPI values requires more data as described above. |
That strange but seems like no effect when I change values in examples/example_m913.ini I'd say the same when I applied empty file. Also I noticed that button 1 stopped working. Will try to capture some data. Update: Start PC under MS win10 and checked that DPIs were set like this Checked and I can confirm that mouse has the same setting as I provided you when capture data but old values not updated. I've captured more data from mouse please check package2 in my repo. I've done with next tasks:
Will proceed tomorrow with other steps you described. |
Changing DPII rewrote the DPI handling in b921bd3, can you change the DPI on the mouse with that commit with DPI valuesOnly a few DPI values are currently available, as the capture you provided last showed, the DPI bytecode is not linear, i.e. captured data for all values is required. If changing the DPI as above works, please capture data for all values, however it is enough to combine multiple values in one capture, e.g. 1000 on level 1, 1100 on level 2, … Enabling and Disabling off DPI levels
I was thinking that the checkbox that is visible next to the DPI sliders in your screenshot would do that, now i am curious what it does instead? Button mappingI implemented a first attempt at remapping the side buttons in 8143868, you can try it out like the changing the DPI by editing examples/example_m913.ini and running |
Changing DPI Switched to commit b921bd3 mouse_m908 -c examples/example_m913.ini.ini file was changed to other descending ordering:
Unfortunately no effect after applying updated settings. DPI values I think I'll proceed with capturing of dpi data once we done with already captured values. Does it make sense for you ? Enabling and Disabling off DPI levels I had the same expectation about checkbox but it did not work may be this is a room for software improvement in future releases :) or UI design. Button mapping Switched to commit 8143868 mouse_m908 -c examples/example_m913.ini
.ini file:
Result: |
What you did looks good so far, however the binary you actually called is definitely not coming from these commits, i removed the debug output during mouse detection as that was solved. I don't know the details of how you upgraded but the general process that should work is as below, i suspect you are missing the
If you try to build as described above and run the tests again the output should be a hexdump of the sent data. |
Great it works as expected: [tol@tol-manjaro mouse_m908]$ mouse_m908 -c examples/example_m913.ini Issues : |
Glad that it worked now, buttons 13-16 not working is expected because i didn't implement them yet, as for button 3 could you try mapping it to something else, e.g. forward to see if the problem is a wrong keycode for led_toggle or a wrong button position? Edit: At least some positions are mixed up, i would expect that to have changed a different button in that case. I am currently working on implementing the remaining buttons and leave it up to you whether you want to capture data for the remaining DPI levels or the LED settings. |
The button positions were indeed mixed up, that should be fixed in 3829421. If it is now possible to remap all buttons i can focus on the button functions. |
I set button_3=forward and it works. And led_toggle also works it enables and disables mouse light . |
Perfect, does remapping the other buttons work? |
Remapping is working for all 1-12 buttons. What polling_rate is? I assigned to button but it did not override previous value. |
I will look into that and consider the other functions. What dou you plan do capture next, led settings or the remaining DPI values? Edit: have you tried buttons 13-16 (button_left, button_right, button_middle, button_fire)? |
Yes 13-16 also works fine. Next I'll capture dpi levels. |
Hi, I've captured all possible dpi value from 1000 to 16000 (from 100 to 100 it was already captured before). Also package 3 contains data fro mouse sensitivity and scroll speed. Have a good day. |
Thanks, i have now implemented all DPI values, however changing the sensitivity and scrollspeed doesn't appear as a change in the sent data. This probably means that these settings are implemented by the software running on windows and are not stored on the mouse, to confirm this you could try changing these settings and then see if there is a change when using the mouse on Linux. |
Yes you are right these settings somehow synced with windows settings. |
If i didn't miss anything that leaves the LED related settings and reading the settings from the mouse unimplemented and requiring captured data. |
Would you mind describing what is a preferable steps to capture data ? |
I hope that answers your question |
Would it help accellerate working out how to write macros (and things like simply having the "fire" button trigger F13, etc) if I sent one of these mice to you? I would have sent an email, but I can't find an email address for @dokutan |
@matthewbaggett Thank you for the offer, but there is no need as i already gained access to a M913. Currently my limitations are a lack of free time and an annoying protocol (e.g. checksums are used when mapping a button to keyboard keys). The best thing is therefore to help with reverse engineering/documenting the protocol. The issue for the M686 (which shares the protocol) has more information: #29 (comment) |
@matthewbaggett Mapping buttons to keyboard keys (including F13-F24) is implemented with aa26e97. Key combinations and macros are still missing. |
I just got one of these mice and was curious if there is anything that'd help get RGB settings functional? I noticed in the example config it says it's not supported, and sure enough I didn't notice it take effect. Dying to change the color on the fly (it helps me figure out my profile). |
@CodexHere iirc, the message to change the RGB settings includes a checksum that is required to be correct for the settings to be applied. I started reverse engineering the rest of the protocol, see https://github.com/dokutan/mouse_m908/blob/master/include/m913/writers.cpp. You could try to figure out how this checksum works and implement it. |
@dokutan it's freaking me out. I had the wired version of this mouse, and I became very dependent on binding DPI to VOL-/VOL+. Controlling media volume on my PC with just my fingers, like a TV remote, was absolutely divine. Since the white version of the wired M908 wasn't available, I ordered the wireless M918 instead. Discovering its more limited functionality — having fewer profiles and, specifically, the inability to rebind the arrow keys and — has left me very upset and disappointed. I believe the DPI button functionality is somehow hardcoded but could be changed by sending specific commands. I tried replacing the button IDs with 0x11/0x12 in the Cfg.ini file, but it didn't work. Since you have this mouse, do you know if it's possible to change the DPI button function? By sending specific commands or even perhaps by downloading the EEPROM via USB and modifying the firmware? |
Unfortunately i don't know for sure because i don't have the M913 anymore, but iirc it is possible to change the behaviour of the DPI buttons with the official software. Therefore i would recommend setting up a Windows VM with USB passthrough/a Windows machine and the official software, since the settings are stored on the mouse this should only be required once. |
No description provided.
The text was updated successfully, but these errors were encountered: