rivalcfg icon indicating copy to clipboard operation
rivalcfg copied to clipboard

Aerox 3 Wireless

Open gort818 opened this issue 3 years ago • 62 comments

I did some reverse engineering this week, got quite a bit done, Attached is what I have found so far. ACTIVE LED colors are not saved to device memory all other settings seem to be. I could not write to the device unless I was root.. Udev rules are in place and no luck.

For the LEDs I have a systemd service running every few seconds just like the Steel Series Software.

Wireless Mode: VID:1038 PID:1838

Wired Mode: VID:1038 PID:183a

Below is what I have found out so far.

WIRELESS: aerox3-wireless.txt

WIRED: aerox3-wireless-wired.txt

Here is repo I created as well, I will update it as I find more info https://github.com/gort818/aerox3-wireless

gort818 avatar Aug 14 '21 05:08 gort818

Hello,

I am working on the Aerox 3 (#156).

  • The wired mode of the Aerox 3 Wireless seems to work the same than the non-wireless Aerox 3, so I will start there.

  • For the wireless mode, I am not able to find the 1038:1838 device in the database (I updated it, but maybe I should extract more things to it, I will check that)). Can you confirm it is the ID of the USB dongle for the 2.4 GHz mode?

  • Also, have you some information about the Bluetooth mode? Is the device handled by the SS Engine with Bluetooth mode?

flozz avatar Aug 18 '21 11:08 flozz

A first shot is available on the aerox3 branch, more info here:

  • https://github.com/flozz/rivalcfg/issues/156#issuecomment-901043925

~~please test and report info in the issue #156, we will keep that one (#167) for the wireless mode of the mouse :)~~

flozz avatar Aug 18 '21 11:08 flozz

I updated the branch with this mouse. Currently, ONLY wired mode is supported, not the wireless one.

Available settings are:

SteelSeries Aerox 3 Wireless (wired mode) Options:
  -s SENSITIVITY, --sensitivity SENSITIVITY
                        Set sensitivity preset (DPI) (up to 5 settings, from 200 dpi to 8500
                        dpi, default: '800, 1600')
  -p POLLING_RATE, --polling-rate POLLING_RATE
                        Set polling rate (Hz) (values: 125, 250, 500, 1000, default: 1000)
  --top-color Z1_COLOR, --z1 Z1_COLOR
                        Set the color of the top LED (e.g. red, #ff0000, ff0000, #f00, f00,
                        default: red)
  --middle-color Z2_COLOR, --z2 Z2_COLOR
                        Set the color of the middle LED (e.g. red, #ff0000, ff0000, #f00,
                        f00, default: lime)
  --bottom-color Z3_COLOR, --z3 Z3_COLOR
                        Set the color of the bottom LED (e.g. red, #ff0000, ff0000, #f00,
                        f00, default: blue)
  -l LED_BRIGHTNESS, --led-brightness LED_BRIGHTNESS
                        Set the brightness of the LEDs (from 0 to 16, default: 16)
  -r, --reset           Reset all settings to their factory default

can you check it work?

if it do not work at all, try to change the endpoint (https://github.com/flozz/rivalcfg/blob/aerox3/rivalcfg/devices/aerox3_wireless.py#L11)

flozz avatar Aug 19 '21 10:08 flozz

@flozz wired mode works fine (tested colors). Wireless mode - not so much, after adding a model with product_id of 0x1838. The app does --help correctly and looks like it attempts to do stuff, but I don't see any effect.

--print-debug mentions 5 endpoints - trying 0-4 makes no difference (and 5 errors, predictably)

fluffynuts avatar Aug 19 '21 11:08 fluffynuts

For the wireless mode it is normal it do not work, all command number are different, I will add it after ;)

flozz avatar Aug 19 '21 12:08 flozz

In Wired mode colors are working, sensitivity is working, not sure how to check polling rate, LED brightness is not working ValueError: Input range and output range must have the same length

gort818 avatar Aug 20 '21 00:08 gort818

Ok fixed it input range should be input_range": [0, 15, 1],

Here is the device file for wireless mode. https://gist.github.com/gort818/590f3c43b77afb917f81da0ec4bac877

gort818 avatar Aug 20 '21 00:08 gort818

Added button mappings, rainbow effect, and reactive led

gort818 avatar Aug 20 '21 01:08 gort818

@gort818 YAS, works like a charm. Nicely done.

fluffynuts avatar Aug 20 '21 14:08 fluffynuts

I have an orange-to-red static color flow over my rig and this was the final piece of the puzzle

image

fluffynuts avatar Aug 20 '21 14:08 fluffynuts

Nice, there are a few more settings I need to add, also the colors will not stay after a reboot or if the mouse goes inactive.. might want a script to keep writing the colors. use the no-save option since the colors are not written to memory

gort818 avatar Aug 20 '21 14:08 gort818

yeah, I noticed that they don't persist after the mouse sleeps; I gather that SS removed practically everything to get the weight down on this device.

fluffynuts avatar Aug 20 '21 16:08 fluffynuts

I am going to need some help with the sensitivity settings.. they are 100–18,000 in 100 CPI Increments

gort818 avatar Aug 21 '21 00:08 gort818

how can I help?

fluffynuts avatar Aug 21 '21 06:08 fluffynuts

Updates:

  • I fixed the brightness command
  • I added the button mapping

→ Can you check it works?


Questions:

  • I saw you added the rainbow effect command but kept only the 0b111 (all) option. Is it because the other options do not work?
  • For the commands that are specific to the wireless mode, are they working in wired mode too? For example, the "wireless sleep time" (0x69), can it be changed in wired mode with the 0x29 command?
  • What is the command to get the battery level? Is this command available in both wired and wireless mode?
    • Looking at your text files, it seems to be 0x12 (in wired mode?)
    • If 0x12 is the command in wired mode, is 0x52 the corresponding command in wireless mode?

NOTE: I still work only on the wired mode as the wireless one is identical with only the command ids that change (once the wired mode finished I will duplicate the profile for the wireless mode)

flozz avatar Aug 21 '21 09:08 flozz

Brightness command and button mapping work in wired mode.

  1. Rainbow effect only affects all the LEDs.
  2. The same settings are available in both wired and wireless modes.
  3. That was actually the response I got when the mouse as plugged in couldn't see any corresponding command. I haven't found the command to get battery level yet.

gort818 avatar Aug 21 '21 18:08 gort818

I also need to figure out how to determine when the mouse "wakes up" - if I cron a script to ping the mouse with colors every minute, the mouse never goes to sleep, so ideally, I'd like to ping it once when it wakes up / connects and not again until next time; as noted before, colors are forgotten when the mouse has a nap.

Battery level indicator would be aces - I'd like to configure a plasmoid to watch that.

fluffynuts avatar Aug 23 '21 06:08 fluffynuts

That was actually the response I got when the mouse as plugged in couldn't see any corresponding command. I haven't found the command to get battery level yet.

Can you try sending the 0x12 command to the mouse (maybe it worth trying with 0x52 too in wireless mode) to see if the device respond with the battery level?

Here is a Python code that can help you to test:

import hid


def open_device(vendor_id, product_id, endpoint):
    path = None
    device = hid.device()
    for interface in hid.enumerate(vendor_id, product_id):
        if interface["interface_number"] == endpoint:
            path = interface["path"]
            break
    if path:
        device.open_path(path)
        return device
    raise Exception("Requested device or endpoint not found: %04x:%04x:%02x" % (  # noqa
        vendor_id, product_id, endpoint))


# Mabe try with 0x183a in wired mode too?
device = open_device(0x1038, 0x1838, 0x03)
device.write(b"\x12")  # Mabe try with \x52 in wireless mode too?
print(device.read(31))
device.close()

flozz avatar Aug 23 '21 07:08 flozz

ok, I've tried all combinations for:

  • device ids: 0x1838 (wireless) 0x183a (wired)
  • bytes to write: 0x12 and 0x52

Initially, 0x12 against wireless hung, 0x52 returned an array of mostly zeros, leading with 64, 255. However, after switching to wired and performing the tests there (both hung) now wireless hangs on the read for both input bytes. I've tried turning the mouse off and on again - no difference. Even if I reduce the buffer size to 1 byte, the script hangs on the read now.

fluffynuts avatar Aug 23 '21 09:08 fluffynuts

That mean this is not the right command to get the battery level...

Thank you for the tests! :D

flozz avatar Aug 23 '21 09:08 flozz

Updates... :)


I added the rainbow effect command. To try it: rivalcfg --rainbow-effect (it takes no parameter).

After trying this command, please check the content of the ~/.config/rivalcfg/1838_183*.device.json files: the rainbow_effect setting sould not be present. :)


I added the profile for the Aerox 3 Wireless in 2.4 GHz mode. Can you try everything work as expected?

flozz avatar Aug 23 '21 11:08 flozz

Everything seems to be working great.. the sensitivity is wrong though.. it is 100–18,000 in 100 CPI Increments

gort818 avatar Aug 23 '21 22:08 gort818

he sensitivity is wrong though.. it is 100–18,000 in 100 CPI Increments

Oh yes, you are right, I forget to update it /o\

Should be OK now :)

flozz avatar Aug 24 '21 06:08 flozz

Update: I added the reactive color option:

  -a REACTIVE_COLOR, --reactive-color REACTIVE_COLOR
                        Set the color of the LEDs in reaction to a button click (e.g. off,
                        disable, red, #ff0000, ff0000, #f00, f00, default: off)

can you check it works in both wired and 2.4 GHz wireless mode? :)

flozz avatar Aug 24 '21 11:08 flozz

Both rainbow and reactive worked perfectly first time for me over wireless, thanks a lot! :D

mewtlu avatar Aug 24 '21 13:08 mewtlu

@fluffynuts Think I got the battery level sorted WIRED

    Device.write(b"\x92")
    data = device.read(2)
    print(data)
    percent = "{:.0%}".format(data[1] / 149)
    print(percent)

WIRELESS

    device.write(b"\xD2")
    data = device.read(2)
    print(data)
    percent = "{:.0%}".format(data[1] / 21)
    print(percent)

gort818 avatar Aug 28 '21 17:08 gort818

Thank you for the tests, I will work on this as soon as possible.

Also it seems we should read-back after each commands on this device. I will implement that too, but I do not know how much Bytes I should read. If you can check that too... :)

flozz avatar Aug 30 '21 11:08 flozz

Hello,

I implemented the battery level:

  --battery-level       Print the battery level of the mouse and exit

You should have results like

Charging [========= ] 95 %
Discharging [========= ] 95 %

Can you check it works?

flozz avatar Sep 01 '21 11:09 flozz

Both charging states look to work well for me including discharging when on wireless, and the level appears to be displaying correctly before and after a quick charge!

mewtlu avatar Sep 01 '21 12:09 mewtlu

aerox 3 tests in wireless mode (2.4G) on commit 7357c7d:

working

  • --battery-level
  • --top-color '#ff4444'
  • --middle-color '#88ff88'
  • --bottom-color '#4444ff'
  • --led-brightness 4
  • --reactive-color '#888888'
  • --reactive-color disable

not working

  • --sensitivity 100 and --sensitivity 3200
    • no change
  • --polling-rate 125 and --polling-rate 1000
    • I haven't measured the polling rate, but it caused the mouse to stop responding for a few seconds, and then caused the sensitivity to change. 1000 polling rate makes the cursor slower than 125 polling rate.
  • --rainbow-effect (all LEDs just turn off)
  • --reset
    • changed the colors to red, green, blue and changed the sensitivity but printed this to the terminal:
Traceback (most recent call last):
  File "/usr/bin/rivalcfg", line 33, in <module>
    sys.exit(load_entry_point('rivalcfg==4.3.0', 'console_scripts', 'rivalcfg')())
  File "/usr/lib/python3.9/site-packages/rivalcfg/__main__.py", line 100, in main
    mouse.reset_settings()
  File "/usr/lib/python3.9/site-packages/rivalcfg/mouse.py", line 168, in reset_settings
    method(setting_info["default"])
KeyError: 'default'

vith avatar Sep 14 '21 16:09 vith