-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Rival 500 issues #32
Comments
Hello, It looks similar to the Rival 700 commands I found here: So I think your color command can be interpreted like this: So I will have to add this concept of prefix and suffix to rivalcfg command :) |
Can you try this command?
|
Thank you for your answer. I tried |
can you try (i added initial 0 to the command):
And if it does not work, can you capture what is sent to the mouse when you are doing that ? :) |
hum ok... again the wValue field that is set to 0x0200 instead of 0x0300... I will have to find how to set that field... |
Hello, Can you install pyusb ( #!/usr/bin/env python
from __future__ import print_function
import sys
import usb.core
import usb.util
VENDOR_ID = 0x1038
PRODUCT_ID = 0x170E
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=PRODUCT_ID)
if not dev:
print("Device not found")
sys.exit(1)
config = dev.get_active_configuration()
iface = config.interfaces()[0]
if dev.is_kernel_driver_active(iface.bInterfaceNumber):
dev.detach_kernel_driver(iface.bInterfaceNumber)
bm_request_type = usb.util.build_request_type(
usb.util.CTRL_OUT,
usb.util.CTRL_TYPE_CLASS,
usb.util.CTRL_RECIPIENT_INTERFACE)
dev.ctrl_transfer(bm_request_type, 0x09, 0x0300, 0x0000,
"\x05\x00\x00\xFF\x00\x00\xFF\x32\xC8\xC8\x00\x00\x01")
# +-------+---+-----------+---------------------------
# prefix led color suffix (I hope I made no mistake in this piece of code) |
Good thing, running the script and there is no more light/colour, on the logo :). |
It was supposed to turn the logo light to red... maybe I missed something ^^' |
Hello, I read the USB Device Class Definition for Human Interface Device (HID) spec and the hidapi source code. The solution to support Rival 500 / 700 seems to be simple (it is always simpler when you read the doc...). Anyway I made a small PoC that requires #!/usr/bin/env python
VENDOR_ID = 0x1038
PRODUCT_ID = 0x170e
COMMAND = [ 0x00 , 0x05, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x32, 0xC8, 0xC8, 0x00, 0x00, 0x01 ]
# +----------+-----------+-----+-----------------+------------------------------------------+
# | ReportID | prefix | LED | color | suffix |
# +----------+-----------+-----+-----------------+------------------------------------------+
import hid
def open_device(vendor_id, product_id, interface_number=0):
for interface in hid.enumerate(vendor_id, product_id):
if interface["interface_number"] != interface_number:
continue
device = hid.device()
device.open_path(interface["path"])
return device
raise IOError("Unable to find the requested device: %04X:%04X:%02X" % (
vendor_id, product_id, interface_number))
device = open_device(VENDOR_ID, PRODUCT_ID)
device.send_feature_report(COMMAND)
# import ipdb ; ipdb.set_trace() # FIXME
device.close() |
Your earlier Your new The suffix after the color seems to have something to do with colour fading/transitions. While I was poking the bytes in the string (before I found the byte literal vs string literal thing) I found a combination that made the led start white and slowly fade to purple ( |
Here's how python seemed to be (mis)interpreting the string literals:
|
@flozz, the script changed the colour instantly back to orange, so it works fine ;). |
Your are right, we already came to this conclusion with @thiblizz (on IRC)... But
Yeah :D
Oh, cool if the hardware supports that feature! I will finish to implement the new version with |
Hello, everything required to support Rival 500 is available in the last commit of the https://github.com/flozz/rivalcfg/blob/road-to-3-0-0-hidapi/rivalcfg/profiles/rival500.py Currently, you should be able to change the color of the logo and the wheel:
My test in dry mode:
|
The current code seems to assume one value per command. How would you want to handle something with more than one parameter? For example, setting the mouse to change colour on click would take two colour values and a fade time:
|
Hello, @dbaggerman: I made an
Example:
|
Hey, Is the road-to-3-0-0-hidapi branch working with Python 3?
|
Hello, It is compatible with Python 3, but I forgot to update the entry point in the setup.py file after refactoring the software. It is now fixed :) |
@flozz: Now this is working as intended, thanks for the quick fix :). Another bug found, and also seems to be the entry point not yet updated.
PS: I am trying to get all the reverse engineering needed for the Rival 500, as I just moved to the Rival 700 :). PS2: My Orphan Request for rivalcfg-git got accepted, so when the master branch will get the version 3.0.0 with hidapi (maybe full support for the Rival 500/Rival700), I will be an active maintainer for this package in the AUR. Finally, I think you can delete the road-to-3-0-0 branch and just keep the road-to-3-0-0-hidapi instead? |
The second problem (more problematic), when using
I hope my reports are useful for you :). |
I changed the format of the arguments so much time... I forget to update some
The rival 700 seems to be very close to the 500, so there should be not so much
Nice :)
I will remove it later, i still need some info about pyusb for an other project
I add it to my todo list, i will work on it as soon as possible :)
of course they are, the refactoring caused many small issue I must fix before |
Hey 😅, Any news about my latest issue? |
Hello, The issue while unplugging/replugging the mouse? (I do not worked on this software last weeks because I had to much work and I tried to work a bit on an other software, I will came back on rivalcfg soon) |
Thank you for the answer, yep the issue while unplugging/replugging the mouse. There is no problem at all, keep focusing on your priorities ;). The thing is, this issue actually prevent me from doing any reverse engineering, as the mouse do not communicate anymore with rivalcfg. |
Oh really :( I will take a look after work then |
For what it's worth, I can't reproduce the error when plugging/unplugging my rival 500. Otherwise I'd take a look at it. |
I tried to reproduce the issue:
http://tmp.fgsp.org/github/rivalcfg_screencast_2017-07-04_22-22-34.webm When you have the issue,
Anyway, I will try to display a better error message when this occur, the Python stack trace is not very helpful here :) |
Damn, I am so sorry, I haven't checked this... Of course, my VM was still running, thank you for your time tho. (running 7 VM's in the background did not help for sure 💯) |
No problem ;) |
@thiblizz rivalcfg will now display this message when the mouse cannot be opened:
|
@flozz, thanks it works as intended, and thanks for the cleanup in your last commits :). |
I just want to say, the |
The colorshift works but it's slow, it jumps from one colour to another eventually, I'm not sure what units the "speed" option is. Once thing that would be really cool is button assignment - the mouse has like 8 buttons that are useless on Linux. |
You can handle that with other programs, the buttons are recognized as a separate keyboard device. Just do something when they're pressed. |
By default some are disabled, though. |
I will look at this keyboard emulation functionality on the Rival 300 mouse, I hope the Rival 500 will not be too different :) |
I close this issue. The work on the Rival 500 continues in #138 :) |
Hey,
So I spent few hours on the mouse, and it's still not working so far.
I did reverse engirered the mouse and it appears to be the same commands as the Rival 300.
The problem is either due to:
Maybe this is the problem, I have noticed another
0x00
data when a command is done to the mouse:E.g. for the colour #FF4212:
Logo colour:
Wheel colour:
And on your blog about the reverse engineering Data Fragment on the Rival 100, we can see that you only get the data as: 0x05 + 0x00 + red green blue.
Note that I am getting this 0x00 supplement for every commands, and they are all the same as on other Rival.
I cannot get
echo -en "\x05\x00\xFF\x00\x00" > /dev/hidraw0
or evenecho -n "\x05\x00\x00\xFF\x00\x00" > /dev/hidraw0
to work, and of course I tried on all of them /dev/hidraw0 to /dev/hidraw6.No effects at all using the debug command:
And yeah I have everything ready to be pushed for the Rival 500, but rivalcfg is not working as intended.
Optional output:
Best of luck and I hope you did enjoy my mouse ;).
The text was updated successfully, but these errors were encountered: