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

G502 Lightspeed Mouse LED-Control #1766

Closed
Svenum opened this issue Sep 18, 2022 · 17 comments
Closed

G502 Lightspeed Mouse LED-Control #1766

Svenum opened this issue Sep 18, 2022 · 17 comments

Comments

@Svenum
Copy link
Contributor

Svenum commented Sep 18, 2022

Is it possible to add LED-Control to solaar for the G502 Lightspeed Mouse.
With the output of

solaar show

I know its these two HID++ 2.0 features:

  • 7: COLOR LED EFFECTS {8070} V4
  • 8: LED CONTROL {1300} V0
@pfps
Copy link
Collaborator

pfps commented Sep 18, 2022

This requires documentation on these features, which I have not yet been able to acquire.

@Svenum
Copy link
Contributor Author

Svenum commented Sep 18, 2022

I do not know if its help but the program "Piper" is able to do that already.

@pfps
Copy link
Collaborator

pfps commented Sep 18, 2022

Figuring out what the features do by examining the libratbg (the system that Piper uses to talk to HID++ devices) code is not easy at all.

@Nubebuster
Copy link

I just bought a G502 Hero and I had not given a single thought to fact that logitech doesn't support linux (wow).

The program does not seem to detect my mouse. Is it different than the G502? @Svenum

$ lsusb
...
Bus 001 Device 006: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse
...

@pfps
Copy link
Collaborator

pfps commented Mar 30, 2023

If the mouse uses HID++, recent versions of Solaar should support it. Which version of Solaar are you using and what is the output of solaar show with the mouse active?

@Nubebuster
Copy link

Nubebuster commented Mar 30, 2023

I found another github issue regarding this mouse and figured out that installing using apt gives an outdated version.

I am running #1481 by cloning and running sudo bin/solaar
The mouse shows up but key bindings dont seem to work
I followed the steps from
#1183 (comment)

image

Am I doing it right?

@pfps
Copy link
Collaborator

pfps commented Mar 30, 2023

Generally Solaar should not be run as root as it will then use a configuration file in root's home directory.

PR #1481 is about a year old. You should probably clone from the master branch of this repository.

Solaar rules only trigger on diverted keys. The output of solaar show provides information on what Solaar can do with your mouse.

@Nubebuster
Copy link

Nubebuster commented Mar 30, 2023

I installed the latest version 1.1.8rc3+git1940-4e7b6b3 from this page https://launchpad.net/~solaar-unifying/+archive/ubuntu/ppa
I now run as not sudo

image

The issue persists.

1: G502 SE Hero Gaming Mouse
     Device path  : /dev/hidraw7
     USB id       : 046d:C08B
     Codename     : G502 Hero
     Kind         : mouse
     Protocol     : HID++ 4.2
     Polling rate : 1 ms (1000Hz)
     Serial number: 
     Model ID:      C08B00000000
     Unit ID:       30324703
          Firmware: U1  27.03.B0010
        Bootloader: BOT 81.00.B0002
     Supports 19 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: COLOR LED EFFECTS      {8070}   
         3: DEVICE FW VERSION      {0003}   
            Firmware: Firmware U1  27.03.B0010 C08B
            Firmware: Bootloader BOT 81.00.B0002 AAE6
            Unit ID: 30324703  Model ID: C08B00000000  Transport IDs: {'usbid': 'C08B'}
         4: DEVICE NAME            {0005}   
            Name: G502 HERO Gaming Mouse
            Kind: mouse
         5: LED CONTROL            {1300}   
         6: unknown:18A1           {18A1}   internal, hidden
         7: unknown:1E00           {1E00}   hidden
         8: unknown:1E22           {1E22}   internal, hidden
         9: unknown:1EB0           {1EB0}   internal, hidden
        10: ADJUSTABLE DPI         {2201}   
            Sensitivity (DPI) (saved): 2400
            Sensitivity (DPI)        : 2400
        11: REPORT RATE            {8060}   
            Polling Rate (ms): 1
            Polling Rate (ms) (saved): 1
            Polling Rate (ms)        : 1
        12: ONBOARD PROFILES       {8100}   
            Device Mode: Host
        13: MOUSE BUTTON SPY       {8110}   
        14: DFUCONTROL SIGNED      {00C2}   
        15: unknown:1801           {1801}   internal, hidden
        16: DEVICE RESET           {1802}   internal, hidden
        17: CONFIG DEVICE PROPS    {1806}   internal, hidden
        18: unknown:18B1           {18B1}   internal, hidden
     Battery status unavailable.

PS Running XOrg

@pfps
Copy link
Collaborator

pfps commented Mar 30, 2023

There is no feature shown by solaar show that can be used to divert the G keys on this mouse so they cannot be used in Solaar to trigger rules.

@Nubebuster
Copy link

For future reference. You can forward usb to virtualbox and in windows you can change the profiles and save them into the mouse memory.

@pfps
Copy link
Collaborator

pfps commented Feb 4, 2024

Solaar doesn't (yet) support LED control on this mouse but PR #2243 adds a CLI to dump and load onboard profiles. See the comment on the PR for how it works. Be careful when editing profiles - be sure to keep around a dump of the profiles before you start making changes so that you can load it back if you mess up the profile data.

To clone and use Solar from its GitHub repository

git clone https://github.com/pwr-Solaar/Solaar.git
cd Solaar

Run Solaar as bin/solaar from this directory.

To run PR #2243, first clone Solaar if you have not already done so and cd to the clone directory. The first time you download the pull request, fetch it into a new branch and checkout that branch, as in:

git fetch origin pull/2243/head:pull_2243
git checkout pull_2243

To download a new version of the pull request, fetch it and then set your pull branch to the new fetch, as in:

git checkout pull_2243
git fetch origin pull/2243/head
git reset --hard FETCH_HEAD

@Svenum
Copy link
Contributor Author

Svenum commented Feb 4, 2024

Nice, I will try it in the next 24h 😀

@pfps
Copy link
Collaborator

pfps commented Feb 4, 2024

By the way, onboard profiles on the G502 do have LED control in them, but I still don't have any documentation on how they work, so the new code just grabs the bytes on a dump and restores them on a load. You should be able to copy the LED control bytes between profiles but that's about it.

The safest thing to do is to take one of the disabled profiles, copy data from the enabled profile, and then edit this profile. If you mess up it is very likely that the profile data will not load and there should be decent error messages to show what went wrong.

@pfps
Copy link
Collaborator

pfps commented Feb 5, 2024

@Svenum
There is now available documentation on the led color feature for this mouse. The logo can be set to a single color, it can cycle through colors (the default effect), and it can pulse a color. The leds on the side can do the same things, but it looks as if they are off unless some action on the mouse turns them on and then they do the effect that was given for them.

You can see the documentation for the feature in the Google drive folder https://drive.google.com/drive/folders/0BxbRzx7vEV7eWmgwazJ3NUFfQ28

@pfps
Copy link
Collaborator

pfps commented Feb 5, 2024

PR #2243 has been updated to dump LED control information in the G502 profiles. You can update the dump and then load it back to the mouse to control the LEDs.

@pfps
Copy link
Collaborator

pfps commented Feb 7, 2024

PR #2245 allows direct control of LED effects from config.yaml. There is no GUI yet. led_zone_1 is the lights on the side. led_zone_2 is the logo.

Here are sample values for my G502:

Off - !LEDEffectIndexed {ID: 0x}
Constant - !LEDEffectIndexed {ID: 0x1, color: 0xff00ff}
Breathing a single color - !LEDEffectIndexed {ID: 0xa, color: 0xff00ff, intensity: 0x0, period: 0x100}
Cycling through colors - !LEDEffectIndexed {ID: 0x3, intensity: 0x0, period: 0x0400}

There are only four implemented effects on my G502.

@pfps
Copy link
Collaborator

pfps commented Feb 11, 2024

PR #2245 now also has a GUI for controlling LED effects.

@pfps pfps closed this as completed Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants