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

Rival 3 Support #111

Closed
BenJuan26 opened this issue May 9, 2020 · 21 comments
Closed

Rival 3 Support #111

BenJuan26 opened this issue May 9, 2020 · 21 comments

Comments

@BenJuan26
Copy link

BenJuan26 commented May 9, 2020

EDIT: Added the device ID

EDIT2: Added sensitivity increments and range

I've tried to do as much debugging as I can and was able the determine the commands for sensitivity and polling rate. I did not have such luck with the lighting.

Device ID

The Rival 3's ID is 1038:1824.

Sensitivity

Sensitivity is in increments of 100 and goes from 200 to 8500. The command is 0b 00 followed by up to 7 arguments:

  • Total configured sensitivity levels
  • Currently selected sensitivity level
  • Sensitivities 1 through 5 (if applicable) according to the following formula:
int(dpi / 50 + int((dpi - 200)/300))

It's possible I overlooked a simpler way to calculate that, but here are the first few values (in decimal):

200 = 4
300 = 6
400 = 8
500 = 11
600 = 13
700 = 15
800 = 18
900 = 20
1000 = 22
1100 = 25
1200 = 27
1300 = 29
1400 = 32
1500 = 34

You can see it's a simple pattern, and the formula provided works.

For example, selecting level 2 out of 4, where the levels are 200, 400, 800, and 1600 DPI, respectively:

0b 00 04 02 04 08 12 24

Polling

Polling is identical to the base Rival config: 04 00 where the choices are 1000, 500, 250, and 125, corresponding to 01, 02, 03, and 04, respectively.

Lighting

I was able to save the packets for steady-state LED colour, but I had no luck trying to write the commands to hidraw myself. There are 3 lighting zones: top, middle, and bottom/logo; they are always written at the same time like so:

0a 00 0f <top> <middle> <bottom> <bottom>

Example, setting top to #123456, middle to #654321, and bottom/logo to #0088ff:

0a 00 0f 12 34 56 65 43 21 00 88 ff 00 88 ff

However, like I said, although I was always able to see these packets coming through, I couldn't write them myself like I could with sensitivities and polling rate.

Saving to device memory

Like other mice, 09 will save the configuration to the mouse's memory.

Please let me know if there is any more reverse engineering I should do. I didn't even attempt to do the more complex lighting configurations since I couldn't get the base configuration to work.

@flozz
Copy link
Owner

flozz commented May 9, 2020

Hello,

Thank you for your work! I finish some things on the rivalcfg4.0 branch and I will have a look to this mouse. I will at least try to implement polling and sensitivity and we will then look at the colors.

Here is the default config of the mouse (extracted from SSE). It seems there is 4 color zone (logo, z1, z2, and z3), but I do not know how they implemented that...

{
  "button_mappings": {
    "buttons": [{
      "function": 1,
      "key_codes": [0]
    }, {
      "function": 2,
      "key_codes": [0]
    }, {
      "function": 3,
      "key_codes": [0]
    }, {
      "function": 4,
      "key_codes": [0]
    }, {
      "function": 5,
      "key_codes": [0]
    }, {
      "function": 48,
      "key_codes": [0]
    }, {
      "function": 49,
      "key_codes": [0]
    }, {
      "function": 50,
      "key_codes": [0]
    }],
    "no_live_deploy": 1
  },
  "exact_accel": {
    "level": 0
  },
  "exact_aim": {
    "level": 0
  },
  "free_move": {
    "level": 0
  },
  "polling_rate": {
    "level": 1,
    "hz": 1000
  },
  "raw_cpi": {
    "level1": 800,
    "level2": 1600
  },
  "rival_logo_color_sequence": {
    "data": [
      [255, 0, 0], [255, 5, 0], [255, 10, 0], [255, 15, 0], [255, 20, 0], [255, 25, 0], [255, 30, 0], [255, 35, 0], [255, 40, 0], [255, 45, 0], [255, 50, 0], [255, 54, 0], [255, 59, 0], [255, 64, 0], [255, 69, 0], [255, 74, 0], [255, 79, 0], [255, 84, 0], [255, 89, 0], [255, 94, 0], [255, 99, 0], [255, 104, 0], [255, 109, 0], [255, 114, 0], [255, 119, 0], [255, 124, 0], [255, 129, 0], [255, 134, 0], [255, 139, 0], [255, 144, 0], [255, 149, 0], [255, 153, 0], [255, 158, 0], [255, 163, 0], [255, 168, 0], [255, 173, 0], [255, 178, 0], [255, 183, 0], [255, 188, 0], [255, 193, 0], [255, 198, 0], [255, 203, 0], [255, 208, 0], [255, 213, 0], [255, 218, 0], [255, 223, 0], [255, 228, 0], [255, 233, 0], [255, 238, 0], [255, 243, 0], [255, 248, 0], [255, 252, 0], [253, 255, 0], [248, 255, 0], [243, 255, 0], [238, 255, 0], [233, 255, 0], [228, 255, 0], [223, 255, 0], [218, 255, 0], [213, 255, 0], [208, 255, 0], [203, 255, 0], [198, 255, 0], [193, 255, 0], [188, 255, 0], [183, 255, 0], [178, 255, 0], [173, 255, 0], [168, 255, 0], [163, 255, 0], [159, 255, 0], [154, 255, 0], [149, 255, 0], [144, 255, 0], [139, 255, 0], [134, 255, 0], [129, 255, 0], [124, 255, 0], [119, 255, 0], [114, 255, 0], [109, 255, 0], [104, 255, 0], [99, 255, 0], [94, 255, 0], [89, 255, 0], [84, 255, 0], [79, 255, 0], [74, 255, 0], [69, 255, 0], [64, 255, 0], [60, 255, 0], [55, 255, 0], [50, 255, 0], [45, 255, 0], [40, 255, 0], [35, 255, 0], [30, 255, 0], [25, 255, 0], [20, 255, 0], [15, 255, 0], [10, 255, 0], [5, 255, 0], [0, 255, 0], [0, 255, 5], [0, 255, 10], [0, 255, 15], [0, 255, 20], [0, 255, 25], [0, 255, 30], [0, 255, 35], [0, 255, 40], [0, 255, 44], [0, 255, 49], [0, 255, 54], [0, 255, 59], [0, 255, 64], [0, 255, 69], [0, 255, 74], [0, 255, 79], [0, 255, 84], [0, 255, 89], [0, 255, 94], [0, 255, 99], [0, 255, 104], [0, 255, 109], [0, 255, 114], [0, 255, 119], [0, 255, 124], [0, 255, 129], [0, 255, 134], [0, 255, 139], [0, 255, 143], [0, 255, 148], [0, 255, 153], [0, 255, 158], [0, 255, 163], [0, 255, 168], [0, 255, 173], [0, 255, 178], [0, 255, 183], [0, 255, 188], [0, 255, 193], [0, 255, 198], [0, 255, 203], [0, 255, 208], [0, 255, 213], [0, 255, 218], [0, 255, 223], [0, 255, 228], [0, 255, 233], [0, 255, 238], [0, 255, 242], [0, 255, 247], [0, 255, 252], [0, 253, 255], [0, 248, 255], [0, 243, 255], [0, 238, 255], [0, 233, 255], [0, 228, 255], [0, 223, 255], [0, 218, 255], [0, 213, 255], [0, 208, 255], [0, 203, 255], [0, 198, 255], [0, 193, 255], [0, 188, 255], [0, 183, 255], [0, 178, 255], [0, 173, 255], [0, 169, 255], [0, 164, 255], [0, 159, 255], [0, 154, 255], [0, 149, 255], [0, 144, 255], [0, 139, 255], [0, 134, 255], [0, 129, 255], [0, 124, 255], [0, 119, 255], [0, 114, 255], [0, 109, 255], [0, 104, 255], [0, 99, 255], [0, 94, 255], [0, 89, 255], [0, 84, 255], [0, 79, 255], [0, 74, 255], [0, 70, 255], [0, 65, 255], [0, 60, 255], [0, 55, 255], [0, 50, 255], [0, 45, 255], [0, 40, 255], [0, 35, 255], [0, 30, 255], [0, 25, 255], [0, 20, 255], [0, 15, 255], [0, 10, 255], [0, 5, 255], [0, 0, 255], [5, 0, 255], [10, 0, 255], [15, 0, 255], [20, 0, 255], [25, 0, 255], [30, 0, 255], [34, 0, 255], [39, 0, 255], [44, 0, 255], [49, 0, 255], [54, 0, 255], [59, 0, 255], [64, 0, 255], [69, 0, 255], [74, 0, 255], [79, 0, 255], [84, 0, 255], [89, 0, 255], [94, 0, 255], [99, 0, 255], [104, 0, 255], [109, 0, 255], [114, 0, 255], [119, 0, 255], [124, 0, 255], [129, 0, 255], [133, 0, 255], [138, 0, 255], [143, 0, 255], [148, 0, 255], [153, 0, 255], [158, 0, 255], [163, 0, 255], [168, 0, 255], [173, 0, 255], [178, 0, 255], [183, 0, 255], [188, 0, 255], [193, 0, 255], [198, 0, 255], [203, 0, 255], [208, 0, 255], [213, 0, 255], [218, 0, 255], [223, 0, 255], [228, 0, 255], [232, 0, 255], [237, 0, 255], [242, 0, 255], [247, 0, 255], [252, 0, 255], [255, 0, 252], [255, 0, 247], [255, 0, 241], [255, 0, 236], [255, 0, 230], [255, 0, 224], [255, 0, 219], [255, 0, 213], [255, 0, 208], [255, 0, 202], [255, 0, 196], [255, 0, 191], [255, 0, 185], [255, 0, 180], [255, 0, 174], [255, 0, 168], [255, 0, 163], [255, 0, 157], [255, 0, 151], [255, 0, 146], [255, 0, 140], [255, 0, 135], [255, 0, 129], [255, 0, 123], [255, 0, 118], [255, 0, 112], [255, 0, 107], [255, 0, 101], [255, 0, 95], [255, 0, 90], [255, 0, 84], [255, 0, 79], [255, 0, 73], [255, 0, 67], [255, 0, 62], [255, 0, 56], [255, 0, 50], [255, 0, 45], [255, 0, 39], [255, 0, 34], [255, 0, 28], [255, 0, 22], [255, 0, 17], [255, 0, 11], [255, 0, 6]
    ],
    "repeat": 255
  },
  "rival_z1_color_sequence": {
    "data": [
      [255, 0, 0], [255, 5, 0], [255, 10, 0], [255, 15, 0], [255, 20, 0], [255, 25, 0], [255, 30, 0], [255, 35, 0], [255, 40, 0], [255, 45, 0], [255, 50, 0], [255, 54, 0], [255, 59, 0], [255, 64, 0], [255, 69, 0], [255, 74, 0], [255, 79, 0], [255, 84, 0], [255, 89, 0], [255, 94, 0], [255, 99, 0], [255, 104, 0], [255, 109, 0], [255, 114, 0], [255, 119, 0], [255, 124, 0], [255, 129, 0], [255, 134, 0], [255, 139, 0], [255, 144, 0], [255, 149, 0], [255, 153, 0], [255, 158, 0], [255, 163, 0], [255, 168, 0], [255, 173, 0], [255, 178, 0], [255, 183, 0], [255, 188, 0], [255, 193, 0], [255, 198, 0], [255, 203, 0], [255, 208, 0], [255, 213, 0], [255, 218, 0], [255, 223, 0], [255, 228, 0], [255, 233, 0], [255, 238, 0], [255, 243, 0], [255, 248, 0], [255, 252, 0], [253, 255, 0], [248, 255, 0], [243, 255, 0], [238, 255, 0], [233, 255, 0], [228, 255, 0], [223, 255, 0], [218, 255, 0], [213, 255, 0], [208, 255, 0], [203, 255, 0], [198, 255, 0], [193, 255, 0], [188, 255, 0], [183, 255, 0], [178, 255, 0], [173, 255, 0], [168, 255, 0], [163, 255, 0], [159, 255, 0], [154, 255, 0], [149, 255, 0], [144, 255, 0], [139, 255, 0], [134, 255, 0], [129, 255, 0], [124, 255, 0], [119, 255, 0], [114, 255, 0], [109, 255, 0], [104, 255, 0], [99, 255, 0], [94, 255, 0], [89, 255, 0], [84, 255, 0], [79, 255, 0], [74, 255, 0], [69, 255, 0], [64, 255, 0], [60, 255, 0], [55, 255, 0], [50, 255, 0], [45, 255, 0], [40, 255, 0], [35, 255, 0], [30, 255, 0], [25, 255, 0], [20, 255, 0], [15, 255, 0], [10, 255, 0], [5, 255, 0], [0, 255, 0], [0, 255, 5], [0, 255, 10], [0, 255, 15], [0, 255, 20], [0, 255, 25], [0, 255, 30], [0, 255, 35], [0, 255, 40], [0, 255, 44], [0, 255, 49], [0, 255, 54], [0, 255, 59], [0, 255, 64], [0, 255, 69], [0, 255, 74], [0, 255, 79], [0, 255, 84], [0, 255, 89], [0, 255, 94], [0, 255, 99], [0, 255, 104], [0, 255, 109], [0, 255, 114], [0, 255, 119], [0, 255, 124], [0, 255, 129], [0, 255, 134], [0, 255, 139], [0, 255, 143], [0, 255, 148], [0, 255, 153], [0, 255, 158], [0, 255, 163], [0, 255, 168], [0, 255, 173], [0, 255, 178], [0, 255, 183], [0, 255, 188], [0, 255, 193], [0, 255, 198], [0, 255, 203], [0, 255, 208], [0, 255, 213], [0, 255, 218], [0, 255, 223], [0, 255, 228], [0, 255, 233], [0, 255, 238], [0, 255, 242], [0, 255, 247], [0, 255, 252], [0, 253, 255], [0, 248, 255], [0, 243, 255], [0, 238, 255], [0, 233, 255], [0, 228, 255], [0, 223, 255], [0, 218, 255], [0, 213, 255], [0, 208, 255], [0, 203, 255], [0, 198, 255], [0, 193, 255], [0, 188, 255], [0, 183, 255], [0, 178, 255], [0, 173, 255], [0, 169, 255], [0, 164, 255], [0, 159, 255], [0, 154, 255], [0, 149, 255], [0, 144, 255], [0, 139, 255], [0, 134, 255], [0, 129, 255], [0, 124, 255], [0, 119, 255], [0, 114, 255], [0, 109, 255], [0, 104, 255], [0, 99, 255], [0, 94, 255], [0, 89, 255], [0, 84, 255], [0, 79, 255], [0, 74, 255], [0, 70, 255], [0, 65, 255], [0, 60, 255], [0, 55, 255], [0, 50, 255], [0, 45, 255], [0, 40, 255], [0, 35, 255], [0, 30, 255], [0, 25, 255], [0, 20, 255], [0, 15, 255], [0, 10, 255], [0, 5, 255], [0, 0, 255], [5, 0, 255], [10, 0, 255], [15, 0, 255], [20, 0, 255], [25, 0, 255], [30, 0, 255], [34, 0, 255], [39, 0, 255], [44, 0, 255], [49, 0, 255], [54, 0, 255], [59, 0, 255], [64, 0, 255], [69, 0, 255], [74, 0, 255], [79, 0, 255], [84, 0, 255], [89, 0, 255], [94, 0, 255], [99, 0, 255], [104, 0, 255], [109, 0, 255], [114, 0, 255], [119, 0, 255], [124, 0, 255], [129, 0, 255], [133, 0, 255], [138, 0, 255], [143, 0, 255], [148, 0, 255], [153, 0, 255], [158, 0, 255], [163, 0, 255], [168, 0, 255], [173, 0, 255], [178, 0, 255], [183, 0, 255], [188, 0, 255], [193, 0, 255], [198, 0, 255], [203, 0, 255], [208, 0, 255], [213, 0, 255], [218, 0, 255], [223, 0, 255], [228, 0, 255], [232, 0, 255], [237, 0, 255], [242, 0, 255], [247, 0, 255], [252, 0, 255], [255, 0, 252], [255, 0, 247], [255, 0, 241], [255, 0, 236], [255, 0, 230], [255, 0, 224], [255, 0, 219], [255, 0, 213], [255, 0, 208], [255, 0, 202], [255, 0, 196], [255, 0, 191], [255, 0, 185], [255, 0, 180], [255, 0, 174], [255, 0, 168], [255, 0, 163], [255, 0, 157], [255, 0, 151], [255, 0, 146], [255, 0, 140], [255, 0, 135], [255, 0, 129], [255, 0, 123], [255, 0, 118], [255, 0, 112], [255, 0, 107], [255, 0, 101], [255, 0, 95], [255, 0, 90], [255, 0, 84], [255, 0, 79], [255, 0, 73], [255, 0, 67], [255, 0, 62], [255, 0, 56], [255, 0, 50], [255, 0, 45], [255, 0, 39], [255, 0, 34], [255, 0, 28], [255, 0, 22], [255, 0, 17], [255, 0, 11], [255, 0, 6]
    ],
    "repeat": 255
  },
  "rival_z2_color_sequence": {
    "data": [
      [255, 0, 0], [255, 5, 0], [255, 10, 0], [255, 15, 0], [255, 20, 0], [255, 25, 0], [255, 30, 0], [255, 35, 0], [255, 40, 0], [255, 45, 0], [255, 50, 0], [255, 54, 0], [255, 59, 0], [255, 64, 0], [255, 69, 0], [255, 74, 0], [255, 79, 0], [255, 84, 0], [255, 89, 0], [255, 94, 0], [255, 99, 0], [255, 104, 0], [255, 109, 0], [255, 114, 0], [255, 119, 0], [255, 124, 0], [255, 129, 0], [255, 134, 0], [255, 139, 0], [255, 144, 0], [255, 149, 0], [255, 153, 0], [255, 158, 0], [255, 163, 0], [255, 168, 0], [255, 173, 0], [255, 178, 0], [255, 183, 0], [255, 188, 0], [255, 193, 0], [255, 198, 0], [255, 203, 0], [255, 208, 0], [255, 213, 0], [255, 218, 0], [255, 223, 0], [255, 228, 0], [255, 233, 0], [255, 238, 0], [255, 243, 0], [255, 248, 0], [255, 252, 0], [253, 255, 0], [248, 255, 0], [243, 255, 0], [238, 255, 0], [233, 255, 0], [228, 255, 0], [223, 255, 0], [218, 255, 0], [213, 255, 0], [208, 255, 0], [203, 255, 0], [198, 255, 0], [193, 255, 0], [188, 255, 0], [183, 255, 0], [178, 255, 0], [173, 255, 0], [168, 255, 0], [163, 255, 0], [159, 255, 0], [154, 255, 0], [149, 255, 0], [144, 255, 0], [139, 255, 0], [134, 255, 0], [129, 255, 0], [124, 255, 0], [119, 255, 0], [114, 255, 0], [109, 255, 0], [104, 255, 0], [99, 255, 0], [94, 255, 0], [89, 255, 0], [84, 255, 0], [79, 255, 0], [74, 255, 0], [69, 255, 0], [64, 255, 0], [60, 255, 0], [55, 255, 0], [50, 255, 0], [45, 255, 0], [40, 255, 0], [35, 255, 0], [30, 255, 0], [25, 255, 0], [20, 255, 0], [15, 255, 0], [10, 255, 0], [5, 255, 0], [0, 255, 0], [0, 255, 5], [0, 255, 10], [0, 255, 15], [0, 255, 20], [0, 255, 25], [0, 255, 30], [0, 255, 35], [0, 255, 40], [0, 255, 44], [0, 255, 49], [0, 255, 54], [0, 255, 59], [0, 255, 64], [0, 255, 69], [0, 255, 74], [0, 255, 79], [0, 255, 84], [0, 255, 89], [0, 255, 94], [0, 255, 99], [0, 255, 104], [0, 255, 109], [0, 255, 114], [0, 255, 119], [0, 255, 124], [0, 255, 129], [0, 255, 134], [0, 255, 139], [0, 255, 143], [0, 255, 148], [0, 255, 153], [0, 255, 158], [0, 255, 163], [0, 255, 168], [0, 255, 173], [0, 255, 178], [0, 255, 183], [0, 255, 188], [0, 255, 193], [0, 255, 198], [0, 255, 203], [0, 255, 208], [0, 255, 213], [0, 255, 218], [0, 255, 223], [0, 255, 228], [0, 255, 233], [0, 255, 238], [0, 255, 242], [0, 255, 247], [0, 255, 252], [0, 253, 255], [0, 248, 255], [0, 243, 255], [0, 238, 255], [0, 233, 255], [0, 228, 255], [0, 223, 255], [0, 218, 255], [0, 213, 255], [0, 208, 255], [0, 203, 255], [0, 198, 255], [0, 193, 255], [0, 188, 255], [0, 183, 255], [0, 178, 255], [0, 173, 255], [0, 169, 255], [0, 164, 255], [0, 159, 255], [0, 154, 255], [0, 149, 255], [0, 144, 255], [0, 139, 255], [0, 134, 255], [0, 129, 255], [0, 124, 255], [0, 119, 255], [0, 114, 255], [0, 109, 255], [0, 104, 255], [0, 99, 255], [0, 94, 255], [0, 89, 255], [0, 84, 255], [0, 79, 255], [0, 74, 255], [0, 70, 255], [0, 65, 255], [0, 60, 255], [0, 55, 255], [0, 50, 255], [0, 45, 255], [0, 40, 255], [0, 35, 255], [0, 30, 255], [0, 25, 255], [0, 20, 255], [0, 15, 255], [0, 10, 255], [0, 5, 255], [0, 0, 255], [5, 0, 255], [10, 0, 255], [15, 0, 255], [20, 0, 255], [25, 0, 255], [30, 0, 255], [34, 0, 255], [39, 0, 255], [44, 0, 255], [49, 0, 255], [54, 0, 255], [59, 0, 255], [64, 0, 255], [69, 0, 255], [74, 0, 255], [79, 0, 255], [84, 0, 255], [89, 0, 255], [94, 0, 255], [99, 0, 255], [104, 0, 255], [109, 0, 255], [114, 0, 255], [119, 0, 255], [124, 0, 255], [129, 0, 255], [133, 0, 255], [138, 0, 255], [143, 0, 255], [148, 0, 255], [153, 0, 255], [158, 0, 255], [163, 0, 255], [168, 0, 255], [173, 0, 255], [178, 0, 255], [183, 0, 255], [188, 0, 255], [193, 0, 255], [198, 0, 255], [203, 0, 255], [208, 0, 255], [213, 0, 255], [218, 0, 255], [223, 0, 255], [228, 0, 255], [232, 0, 255], [237, 0, 255], [242, 0, 255], [247, 0, 255], [252, 0, 255], [255, 0, 252], [255, 0, 247], [255, 0, 241], [255, 0, 236], [255, 0, 230], [255, 0, 224], [255, 0, 219], [255, 0, 213], [255, 0, 208], [255, 0, 202], [255, 0, 196], [255, 0, 191], [255, 0, 185], [255, 0, 180], [255, 0, 174], [255, 0, 168], [255, 0, 163], [255, 0, 157], [255, 0, 151], [255, 0, 146], [255, 0, 140], [255, 0, 135], [255, 0, 129], [255, 0, 123], [255, 0, 118], [255, 0, 112], [255, 0, 107], [255, 0, 101], [255, 0, 95], [255, 0, 90], [255, 0, 84], [255, 0, 79], [255, 0, 73], [255, 0, 67], [255, 0, 62], [255, 0, 56], [255, 0, 50], [255, 0, 45], [255, 0, 39], [255, 0, 34], [255, 0, 28], [255, 0, 22], [255, 0, 17], [255, 0, 11], [255, 0, 6]
    ],
    "repeat": 255
  },
  "rival_z3_color_sequence": {
    "data": [
      [255, 0, 0], [255, 5, 0], [255, 10, 0], [255, 15, 0], [255, 20, 0], [255, 25, 0], [255, 30, 0], [255, 35, 0], [255, 40, 0], [255, 45, 0], [255, 50, 0], [255, 54, 0], [255, 59, 0], [255, 64, 0], [255, 69, 0], [255, 74, 0], [255, 79, 0], [255, 84, 0], [255, 89, 0], [255, 94, 0], [255, 99, 0], [255, 104, 0], [255, 109, 0], [255, 114, 0], [255, 119, 0], [255, 124, 0], [255, 129, 0], [255, 134, 0], [255, 139, 0], [255, 144, 0], [255, 149, 0], [255, 153, 0], [255, 158, 0], [255, 163, 0], [255, 168, 0], [255, 173, 0], [255, 178, 0], [255, 183, 0], [255, 188, 0], [255, 193, 0], [255, 198, 0], [255, 203, 0], [255, 208, 0], [255, 213, 0], [255, 218, 0], [255, 223, 0], [255, 228, 0], [255, 233, 0], [255, 238, 0], [255, 243, 0], [255, 248, 0], [255, 252, 0], [253, 255, 0], [248, 255, 0], [243, 255, 0], [238, 255, 0], [233, 255, 0], [228, 255, 0], [223, 255, 0], [218, 255, 0], [213, 255, 0], [208, 255, 0], [203, 255, 0], [198, 255, 0], [193, 255, 0], [188, 255, 0], [183, 255, 0], [178, 255, 0], [173, 255, 0], [168, 255, 0], [163, 255, 0], [159, 255, 0], [154, 255, 0], [149, 255, 0], [144, 255, 0], [139, 255, 0], [134, 255, 0], [129, 255, 0], [124, 255, 0], [119, 255, 0], [114, 255, 0], [109, 255, 0], [104, 255, 0], [99, 255, 0], [94, 255, 0], [89, 255, 0], [84, 255, 0], [79, 255, 0], [74, 255, 0], [69, 255, 0], [64, 255, 0], [60, 255, 0], [55, 255, 0], [50, 255, 0], [45, 255, 0], [40, 255, 0], [35, 255, 0], [30, 255, 0], [25, 255, 0], [20, 255, 0], [15, 255, 0], [10, 255, 0], [5, 255, 0], [0, 255, 0], [0, 255, 5], [0, 255, 10], [0, 255, 15], [0, 255, 20], [0, 255, 25], [0, 255, 30], [0, 255, 35], [0, 255, 40], [0, 255, 44], [0, 255, 49], [0, 255, 54], [0, 255, 59], [0, 255, 64], [0, 255, 69], [0, 255, 74], [0, 255, 79], [0, 255, 84], [0, 255, 89], [0, 255, 94], [0, 255, 99], [0, 255, 104], [0, 255, 109], [0, 255, 114], [0, 255, 119], [0, 255, 124], [0, 255, 129], [0, 255, 134], [0, 255, 139], [0, 255, 143], [0, 255, 148], [0, 255, 153], [0, 255, 158], [0, 255, 163], [0, 255, 168], [0, 255, 173], [0, 255, 178], [0, 255, 183], [0, 255, 188], [0, 255, 193], [0, 255, 198], [0, 255, 203], [0, 255, 208], [0, 255, 213], [0, 255, 218], [0, 255, 223], [0, 255, 228], [0, 255, 233], [0, 255, 238], [0, 255, 242], [0, 255, 247], [0, 255, 252], [0, 253, 255], [0, 248, 255], [0, 243, 255], [0, 238, 255], [0, 233, 255], [0, 228, 255], [0, 223, 255], [0, 218, 255], [0, 213, 255], [0, 208, 255], [0, 203, 255], [0, 198, 255], [0, 193, 255], [0, 188, 255], [0, 183, 255], [0, 178, 255], [0, 173, 255], [0, 169, 255], [0, 164, 255], [0, 159, 255], [0, 154, 255], [0, 149, 255], [0, 144, 255], [0, 139, 255], [0, 134, 255], [0, 129, 255], [0, 124, 255], [0, 119, 255], [0, 114, 255], [0, 109, 255], [0, 104, 255], [0, 99, 255], [0, 94, 255], [0, 89, 255], [0, 84, 255], [0, 79, 255], [0, 74, 255], [0, 70, 255], [0, 65, 255], [0, 60, 255], [0, 55, 255], [0, 50, 255], [0, 45, 255], [0, 40, 255], [0, 35, 255], [0, 30, 255], [0, 25, 255], [0, 20, 255], [0, 15, 255], [0, 10, 255], [0, 5, 255], [0, 0, 255], [5, 0, 255], [10, 0, 255], [15, 0, 255], [20, 0, 255], [25, 0, 255], [30, 0, 255], [34, 0, 255], [39, 0, 255], [44, 0, 255], [49, 0, 255], [54, 0, 255], [59, 0, 255], [64, 0, 255], [69, 0, 255], [74, 0, 255], [79, 0, 255], [84, 0, 255], [89, 0, 255], [94, 0, 255], [99, 0, 255], [104, 0, 255], [109, 0, 255], [114, 0, 255], [119, 0, 255], [124, 0, 255], [129, 0, 255], [133, 0, 255], [138, 0, 255], [143, 0, 255], [148, 0, 255], [153, 0, 255], [158, 0, 255], [163, 0, 255], [168, 0, 255], [173, 0, 255], [178, 0, 255], [183, 0, 255], [188, 0, 255], [193, 0, 255], [198, 0, 255], [203, 0, 255], [208, 0, 255], [213, 0, 255], [218, 0, 255], [223, 0, 255], [228, 0, 255], [232, 0, 255], [237, 0, 255], [242, 0, 255], [247, 0, 255], [252, 0, 255], [255, 0, 252], [255, 0, 247], [255, 0, 241], [255, 0, 236], [255, 0, 230], [255, 0, 224], [255, 0, 219], [255, 0, 213], [255, 0, 208], [255, 0, 202], [255, 0, 196], [255, 0, 191], [255, 0, 185], [255, 0, 180], [255, 0, 174], [255, 0, 168], [255, 0, 163], [255, 0, 157], [255, 0, 151], [255, 0, 146], [255, 0, 140], [255, 0, 135], [255, 0, 129], [255, 0, 123], [255, 0, 118], [255, 0, 112], [255, 0, 107], [255, 0, 101], [255, 0, 95], [255, 0, 90], [255, 0, 84], [255, 0, 79], [255, 0, 73], [255, 0, 67], [255, 0, 62], [255, 0, 56], [255, 0, 50], [255, 0, 45], [255, 0, 39], [255, 0, 34], [255, 0, 28], [255, 0, 22], [255, 0, 17], [255, 0, 11], [255, 0, 6]
    ],
    "repeat": 255
  },
  "set_all_colors": {
    "logo_color": {
      "blue": 0,
      "green": 0,
      "red": 0
    },
    "z1_color": {
      "blue": 0,
      "green": 0,
      "red": 0
    },
    "z2_color": {
      "blue": 0,
      "green": 0,
      "red": 0
    },
    "z3_color": {
      "blue": 0,
      "green": 0,
      "red": 0
    },
    "zone_mask": 15
  },
  "set_all_resolution": {
    "level_active": 1,
    "level_max": 2,
    "resolution_1": 18,
    "resolution_2": 36,
    "resolution_3": 46,
    "resolution_4": 111,
    "resolution_5": 167
  }
}

@flozz
Copy link
Owner

flozz commented May 9, 2020

Also, can you add a screenshot of the SSE interface for that mouse (that helps me to have context). :)

@flozz
Copy link
Owner

flozz commented May 9, 2020

Oops I forget, can you also give the result of the following command:

 lsusb | grep 1038

to have the exact product_string from the mouse :)

@BenJuan26
Copy link
Author

image
This is what the interface looks like for steady colours. As you can see, there are only three selectable areas. My guess is that they keep the logo colour separate in the metadata to keep it consistent with some of the other models that treat the logo separately.

The complete lsusb entry on my system is this:

Bus 002 Device 005: ID 1038:1824 SteelSeries ApS SteelSeries Rival 3

@flozz flozz self-assigned this May 10, 2020
@flozz
Copy link
Owner

flozz commented May 10, 2020

I started working on the branch 111-rival3. Currently I only implemented:

  • Polling rate
  • save

I have some questions for the other settings :)

Sensitivity

  • If I understand, you can configure up to 5 different sensitivity preset?
  • You can also configure only one and in that case, the packet size is different (0b 00 01 01 04 for example?)
  • The second param is the currently selected sensitivity preset.
    • So you can switch sensitivity preset from the PC (I ask because the Rival 3 is the first to do that)?
    • They start counting presets from 0 or from 1 (to select the first preset, you have to write 00 or 01 in this param)?
  • Does the button under the wheel switches between DPI profiles like on other Rival mice?

Colors

However, like I said, although I was always able to see these packets coming through, I couldn't write them myself like I could with sensitivities and polling rate.

How did you tries to write those packets? Using /dev/hidraw*?

Some Rival models uses HID feature report instead of a simple output report for colors... If you still have your captured packet, can you check this? In Wireshark, there is a wValue field near the data fragment. if it contains 02 XX it is an output report, and if it is 03 XX it is a feature report.

image

@BenJuan26
Copy link
Author

Sensitivity

  • Yes, up to 5 different sensitivity presets can be configured.
  • Correct, if you only configure one the packet size is different, however you could consider it as the same size just with zeros for the other values.
  • Yes, you can switch presets from the PC using SSE3.
  • Presets are 1-indexed. 01 will select Preset 1.
  • Yes, the switch under the middle mouse button will cycle through presets in ascending order.

Colors

Yes, I tried to write the color data to /dev/hidrawX and it did not work. Sometimes it would say Invalid argument, sometimes it would return successfully but the colors would not change.

The value of wValue is 02 00 for all packets I'm seeing during the color setup.

@flozz
Copy link
Owner

flozz commented May 12, 2020

I will try to work on this the weekend. But I have just a question... What happened if you set 0x00 as preset ID? Does it just keep the currently selected preset?

@cdeegz
Copy link

cdeegz commented Jun 9, 2020

Hey! Thanks for the work on this handy utility. Nicely written.

Initially I got as far as BenJuan26, but then after checking out the rival3 branch, and putting in the udev rule, I managed to get colour control working by changing to interface_number 3 in the profile and adding in a colour control command.

Also, note that there are four zones, being base top, base mid, base bottom and logo. I just hacked in a new value type rgbcolorzone that takes a list of colors and sends them accordingly. I might check out the blinky stuff later if I get time, but my real motivation was to turn annoying bling off.

HTH

@BenJuan26
Copy link
Author

Sorry for the delayed response. Setting 0x00 as preset ID is identical to setting 0x01, no matter which one was previously selected.

@cdeegz Do you have a fork with colour control working that I could try?

@cdeegz
Copy link

cdeegz commented Jun 10, 2020

@BenJuan26 sorry, no fork, but how about a patch?

rival3-colorfix.patch.txt

@BenJuan26
Copy link
Author

BenJuan26 commented Jun 10, 2020

Nice, the colours work for me with the patch applied. It's interesting that the logo is indeed its own zone, but they haven't exposed that through SSE3.

Edit: Perhaps it's because there's a lot of bleed between the logo colour and the bottom zone colour, and they wanted to avoid that.

@flozz
Copy link
Owner

flozz commented Jun 10, 2020

I am currently working on Rivalcfg 4.0, so I do not know if I will add support for this mouse in Rivalcfg 3.x. Probably I will add its support directly to Rivalcfg 4.0.

Anyway, thank you for your work! :D

@flozz
Copy link
Owner

flozz commented Jun 18, 2020

Hello,

I am working on the support of the Rival 3 on Rivalcfg 4.0. I just implemented sensitivity. Can you test it works ?

→ I start working on colors now :)

@BenJuan26
Copy link
Author

Getting an error. I think it's related to the change to 4.0:

$ sudo rivalcfg -s 800
Traceback (most recent call last):
  File "/usr/bin/rivalcfg", line 11, in <module>
    load_entry_point('rivalcfg==4.0.0.dev0', 'console_scripts', 'rivalcfg')()
TypeError: main() missing 1 required positional argument: 'args'

@flozz
Copy link
Owner

flozz commented Jun 18, 2020

it seems there is a mix of both versions...

For now, you can try from the git repository:

git clone https://github.com/flozz/rivalcfg/
cd rivalcfg
git checkout rivalcfg4.0-rival3
python -m rivalcfg --version

I will try to reproduce you issue tomorrow to see how this can be fixed :)

@flozz
Copy link
Owner

flozz commented Jun 19, 2020

Colors are now implemented too for the Rival 3. This can be tested with params like this:

--colors FF1800
--colors blue
--colors red,lime,blue,purple

@flozz
Copy link
Owner

flozz commented Jun 23, 2020

any news ? :)

@flozz flozz added this to In progress in Rivalcfg v4.x Jun 23, 2020
@w3aponx
Copy link

w3aponx commented Jun 23, 2020

I lost quite a bit of time trying to make it work, as I'm not very familiar with Python, but I finally found my problem. Here's the result:

sudo python3 -m rivalcfg -c red,green,blue,white

image

@flozz
Copy link
Owner

flozz commented Jun 24, 2020

@w3aponx Yeah ! It works :D

Can you try sensitivity too? For example

sudo python3 -m rivalcfg -s 200,200,200,200,8000

With this setting, the cursor should be very slow at first, then if you click on the dpi switch button 4 times, you will be on the 5th preset and the mouse cursor should move quickly

You can then reset to the default value (with 2 presets):

sudo python3 -m rivalcfg -s 800,1600

Thank you for your help :)

@w3aponx
Copy link

w3aponx commented Jun 24, 2020

@flozz Works like a charm. And also I now do away with sudo, having run with --update-udev once. Nice touch.

@flozz
Copy link
Owner

flozz commented Jun 24, 2020

Thank you very much for the feedback, I will merge this in the rivalcfg4.0 branch :D

→ This mouse will be supported in rivalcfg 4.0 :)

@flozz flozz moved this from In progress to Done in Rivalcfg v4.x Jun 24, 2020
@flozz flozz closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Rivalcfg v4.x
  
Done
Development

No branches or pull requests

4 participants