Repository: pwr-Solaar/Solaar

Issue:
G502 (wired) mouse support
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version (`solaar --version` and `git describe --tags`): 1.0.6
- Distribution: ElementaryOS
- Kernel version (ex. `uname -srmo`): Linux 5.4.0-74-generic x86_64 GNU/Linux
- Output of `solaar show` for the target device (if applicable): 

<details>

```
solaar: error: Traceback (most recent call last):
  File "/usr/share/solaar/lib/solaar/cli/__init__.py", line 203, in run
    raise Exception('No devices found')
Exception: No devices found
```
</details>


**Description**
I've just switched to linux, and thought there is a GHub for it, but it turned out there isn't. I have posted my problem on their reddit, and someone told me to check out solaar. I have downloaded it, but it looks like there is no support for G502 Hero mouse (wired).

**Describe the solution you'd like**
Add support for G502 Hero mouse

P.S.: I hope it is possible :)



Discussion:
I have a G502 and it is working fine.  Run `lsusb`.  There should be a line like:
```
Bus ... Device ...: ID 046d:c539 Logitech, Inc. USB Receiver
```
The c539 is the id number for the G502's receiver.  If you don't  have this line then you might have a newer or older receiver than I have.   Please post the output of `lsusb`
```
Bus 001 Device 008: ID 046d:c08b Logitech, Inc.
```

Do you need the whole list?

Edit: Seems like it is not in the supported list. (Sorry for not checking that the first time, I am just a beginner linux user and didn't even know how to check the receiver version). I hope it is possible to add it in a future update
Oh, you have your mouse wired.  When my 502 is wired I see
```
Bus 003 Device 006: ID 046d:c08d Logitech, Inc. G502 LIGHTSPEED Wireless Gaming Mouse
```
It looks as if you have a slightly different mouse.

It appears that the problem is that you are running an old version of Linux that does not fully recognize your mouse when it is wired.  Solaar doesn't need information on Logitech devices that connect directly via wireless but they do need to be fully recognized by the OS.

If your mouse can connect via a wireless receiver try that.  Otherwise it is very likely that the only way to have Solaar work for your mouse is to upgrade your OS.   Linux 5.4 is old - I run 5.11 and will be switching to 5.12 soon.
Sorry, I am confused. What do you mean when your 502 is wired? Since I think you have the wireless version. Also, I have the G502 Hero, not the G502, and that could have inner changes.

Regarding the OS update: I have elementaryOS, and I think I've heard that it updates when a new elementary version comes out. Not sure, but currently I don't see any available system updates for the OS.
I have a G502 that can be either connected via a USB cable or communicate wirelessly to a special USB dongle, called a receiver.   You may have a different version that can only be connected via a USB cable.

Elementary OS is a distribution for Linux.  It appears to not be updated very often, or purposely sticks with older versions of the Linux kernel.  Other distributions (Fedora, in particular) update to newer versions of the Linux kernel shortly after they come out.  Thus they get the benefits of newer capabilities, drivers, etc., at the cost of more rapid change and maybe exposure to bugs.
@AdamTmHun Have you been able to address your issue?
Hey,

Actually, thanks for reminding. I just switched to Ubuntu, since other stuff like Unity wasn't working properly on Elementary. Let me check if it works now
It didn't solve the issue.

Except, I see for some reason, it installs the 1.0.1 version instead of the 1.0.6, and I don't know why. In the command line, it says it is installing the 1.0.6, but its not.

Terminal:
```
adam@adam-pc:~$ sudo apt install solaar
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gir1.2-appindicator3-0.1 python3-psutil python3-pyudev python3-xlib
Suggested packages:
  python-psutil-doc
The following NEW packages will be installed:
  gir1.2-appindicator3-0.1 python3-psutil python3-pyudev python3-xlib solaar
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 460 kB/497 kB of archives.
After this operation, 2.997 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://hu.archive.ubuntu.com/ubuntu focal/main amd64 gir1.2-appindicator3-0.1 amd64 12.10.1+20.04.20200408.1-0ubuntu1 [3.448 B]
Get:2 http://hu.archive.ubuntu.com/ubuntu focal/main amd64 python3-psutil amd64 5.5.1-1ubuntu4 [141 kB]
Get:3 http://hu.archive.ubuntu.com/ubuntu focal/universe amd64 python3-xlib all 0.23-2build1 [112 kB]
Get:4 http://ppa.launchpad.net/solaar-unifying/ppa/ubuntu focal/main amd64 solaar all 1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1 [203 kB]
Fetched 460 kB in 0s (1.561 kB/s)                   
Preconfiguring packages ...
Selecting previously unselected package gir1.2-appindicator3-0.1.
(Reading database ... 177357 files and directories currently installed.)
Preparing to unpack .../gir1.2-appindicator3-0.1_12.10.1+20.04.20200408.1-0ubunt
u1_amd64.deb ...
Unpacking gir1.2-appindicator3-0.1 (12.10.1+20.04.20200408.1-0ubuntu1) ...
Selecting previously unselected package python3-psutil.
Preparing to unpack .../python3-psutil_5.5.1-1ubuntu4_amd64.deb ...
Unpacking python3-psutil (5.5.1-1ubuntu4) ...
Selecting previously unselected package python3-pyudev.
Preparing to unpack .../python3-pyudev_0.21.0-3ubuntu1_all.deb ...
Unpacking python3-pyudev (0.21.0-3ubuntu1) ...
Selecting previously unselected package python3-xlib.
Preparing to unpack .../python3-xlib_0.23-2build1_all.deb ...
Unpacking python3-xlib (0.23-2build1) ...
Selecting previously unselected package solaar.
Preparing to unpack .../solaar_1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1_
all.deb ...
Unpacking solaar (1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1) ...
Setting up python3-xlib (0.23-2build1) ...
Setting up python3-psutil (5.5.1-1ubuntu4) ...
Setting up gir1.2-appindicator3-0.1 (12.10.1+20.04.20200408.1-0ubuntu1) ...
Setting up python3-pyudev (0.21.0-3ubuntu1) ...
Setting up solaar (1.0.6+git1363-8854ca6-202106160734~ubuntu20.04.1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
```

But in the application, it says 1.0.1

If the version isn't the problem, then it still isn't working for some reason.

Edit: The cmd `solaar --version` shows 1.0.6, wtf???

Edit 2: My new kernel and ubuntu version: `Linux 5.8.0-55-generic x86_64 GNU/Linux`, `Ubuntu 20.04.2 LTS 64-bit`
`lsusb` result: 
```
Bus 001 Device 002: ID 046d:c08b Logitech, Inc. G502 HERO Gaming Mouse
```
Running Solaar from the terminal with cmd `solaar` instead of from the app list, it shows it needs `udve`, but it was already installed when installing solaar. After the error, it opens the GUI, and the version is still 1.0.1 in the about section.
The output from lsusb indicates that a modern version of Solaar should work for your mouse.

The issue that you are seeing with versions is probably due to the fact that the Solaar GUI starts up by looking for any already-running programs that provide a Solaar GUI and quickly quitting if there is one.  So if Solaar 1.0.1 is already running (as a startup program or whatever) the only thing that will happen if you try to run `solaar` is that the main window of the already-running Solaar will be shown.  To get around this you need to find and kill this program, e.g., via `killall solaar`.
This worked, now its 1.0.6, but the mouse is still not showing up.
I expect that the problem is that permissions are not being set up for the mouse.  You should run `ls -l /dev/hidraw*`, then disconnect and reconnect your mouse, then run `ls -l /dev/hidraw*` again.  There should be a change in the output, with at least one line starting with `crw-rw----+`.  The '+' indicates that special permissions have been set up.  If there is no change then you may have to reboot.  If there is still no change then I'll have to figure out what the problem is.

Then run Solaar.   The mouse should show up, but the main window will very likely look a bit wrong - the short name for the mouse is likely to be something like '?? (C08B)'.   Let me know what shows up there and also the long name at the top of the right-hand side of the main window.
Nope, no mouse is shown. Also, running `ls -l /dev/hidraw*` showed two line starting with `crw-rw----+`, both for the first and the second time.
Hmm.  Are any devices or receivers shown on your Solaar main window?  If so, click on them and then on the little light bulb icon (towards the bottom, sort of in the middle).   What is the path given for each of them?  What is the output of `ls -l /dev/hidraw*`?  What is the output of `udevadm info -n /dev/hidraw*`?

Another possibility is that your mouse uses a different interface than modern Logitech devices that connect via USB.   This is probably fixable.  But try the above first.

The bad possibility is that your mouse doesn't talk the HID++ protocol that Solaar needs.  This would not be fixable.
Are you still having the problem?
I have the same problem, same mouse too :/

Information

    Solaar version (solaar --version and git describe --tags): solaar 1.1.1
    Distribution: Mint
    Kernel version (ex. uname -srmo): Linux 5.13.0-27-generic x86_64 GNU/Linux
    Output of solaar show for the target device (if applicable):

Description
I've just switched to linux, and thought there is a GHub for it, but it turned out there isn't. I have posted my problem on their reddit, and someone told me to check out solaar. I have downloaded it, but it looks like there is no support for G502 Hero mouse (wired).
What USB id does this mouse have?   Provide output of lsusb with the mouse connected.   Does the mouse show up at all in Solaar?
> What USB id does this mouse have? Provide output of lsusb with the mouse connected. Does the mouse show up at all in Solaar?

Bus 001 Device 003: ID 046d:c08b Logitech, Inc. G502 HERO Gaming Mouse

No it doesn't show :/
Is is likely that this device uses a different USB interface so Solaar needs to know which one.  

Look at output of `lsusb` to find ID of device or receiver, which you already have done.
Provide output of `lsusb -vv -d xxxx:yyyy` where xxxx:yyyy is ID of device or receiver.

Look at output of `grep -H . /sys/class/hidraw/hidraw*/device/uevent` to find directory for the device or receiver, e.g., `/sys/class/hidraw/hidraw3/device/uevent:HID_NAME=Logitech USB Receiver`.
Provide contents of the file `/sys/class/hidraw/hidrawN/device/report_descriptor` where N was found above.  You will have to copy the contents to a file with txt extension before attaching it.
Or, better, install hidrd-convert and provide output of `hidrd-convert -o spec /sys/class/hidraw/hidrawN/device/report_descriptor`.


Can you provide the information requested?
Closing due to no response.
Hi, I hate to be the 3rd person to re-open this issue but I have this same mouse and am experiencing the same issue.

```
➜ lsusb | grep -i logitech
Bus 003 Device 017: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse
```

[Here is the rest of the information you requested from the previous several comments](https://github.com/pwr-Solaar/Solaar/files/8207751/g502.txt)
PR #1481 should support your mouse.  Try it out and see.


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 #1481, 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/1481/head:pull_1481
git checkout pull_1481
```
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_1481
git fetch origin pull/1481/head
git reset --hard FETCH_HEAD
```

![image](https://user-images.githubusercontent.com/6119870/157336692-89c58655-b5c8-40cd-bb5e-94e4922dbcb5.png)

It appears to be working now! DPI changes take effect when changed. I'm glad the issue was as simple as adding a new descriptor.
Will there be support for the non-hero version? The info for my mouse is as follows:
```
lsusb | grep Logitech
Bus 003 Device 003: ID 046d:c07d Logitech, Inc. G502 Mouse
```
```
sudo lsusb -vv -d 046d:c07d

Bus 003 Device 003: ID 046d:c07d Logitech, Inc. G502 Mouse
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc07d G502 Mouse
  bcdDevice           88.02
  iManufacturer           1 Logitech
  iProduct                2 Gaming Mouse G502
  iSerial                 3 1388344E3138
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003b
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 U88.03_B0017            
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              300mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      67
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     151
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0014  1x 20 bytes
        bInterval               1
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)
```
```
udevadm info -n /dev/hidraw*
P: /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/0003:1B1C:1B09.0001/hidraw/hidraw0
N: hidraw0
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/0003:1B1C:1B09.0001/hidraw/hidraw0
E: DEVNAME=/dev/hidraw0
E: MAJOR=239
E: MINOR=0
E: SUBSYSTEM=hidraw

P: /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.1/0003:1B1C:1B09.0002/hidraw/hidraw1
N: hidraw1
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.1/0003:1B1C:1B09.0002/hidraw/hidraw1
E: DEVNAME=/dev/hidraw1
E: MAJOR=239
E: MINOR=1
E: SUBSYSTEM=hidraw

P: /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.2/0003:1B1C:1B09.0003/hidraw/hidraw2
N: hidraw2
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.2/0003:1B1C:1B09.0003/hidraw/hidraw2
E: DEVNAME=/dev/hidraw2
E: MAJOR=239
E: MINOR=2
E: SUBSYSTEM=hidraw

P: /devices/pci0000:00/0000:00:12.0/usb3/3-2/3-2:1.0/0003:046D:C07D.0004/hidraw/hidraw3
N: hidraw3
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-2/3-2:1.0/0003:046D:C07D.0004/hidraw/hidraw3
E: DEVNAME=/dev/hidraw3
E: MAJOR=239
E: MINOR=3
E: SUBSYSTEM=hidraw

P: /devices/pci0000:00/0000:00:12.0/usb3/3-2/3-2:1.1/0003:046D:C07D.0005/hidraw/hidraw4
N: hidraw4
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:12.0/usb3/3-2/3-2:1.1/0003:046D:C07D.0005/hidraw/hidraw4
E: DEVNAME=/dev/hidraw4
E: MAJOR=239
E: MINOR=4
E: SUBSYSTEM=hidraw

P: /devices/pci0000:00/0000:00:10.1/usb8/8-2/8-2:1.0/0003:1852:7022.0006/hidraw/hidraw5
N: hidraw5
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:10.1/usb8/8-2/8-2:1.0/0003:1852:7022.0006/hidraw/hidraw5
E: DEVNAME=/dev/hidraw5
E: MAJOR=239
E: MINOR=5
E: SUBSYSTEM=hidraw
```
```
grep -H . /sys/class/hidraw/hidraw*/device/uevent
/sys/class/hidraw/hidraw0/device/uevent:DRIVER=corsair
/sys/class/hidraw/hidraw0/device/uevent:HID_ID=0003:00001B1C:00001B09
/sys/class/hidraw/hidraw0/device/uevent:HID_NAME=Corsair Corsair K70R Gaming Keyboard
/sys/class/hidraw/hidraw0/device/uevent:HID_PHYS=usb-0000:00:12.0-1/input0
/sys/class/hidraw/hidraw0/device/uevent:HID_UNIQ=
/sys/class/hidraw/hidraw0/device/uevent:MODALIAS=hid:b0003g0001v00001B1Cp00001B09
/sys/class/hidraw/hidraw1/device/uevent:DRIVER=corsair
/sys/class/hidraw/hidraw1/device/uevent:HID_ID=0003:00001B1C:00001B09
/sys/class/hidraw/hidraw1/device/uevent:HID_NAME=Corsair Corsair K70R Gaming Keyboard
/sys/class/hidraw/hidraw1/device/uevent:HID_PHYS=usb-0000:00:12.0-1/input1
/sys/class/hidraw/hidraw1/device/uevent:HID_UNIQ=
/sys/class/hidraw/hidraw1/device/uevent:MODALIAS=hid:b0003g0001v00001B1Cp00001B09
/sys/class/hidraw/hidraw2/device/uevent:DRIVER=corsair
/sys/class/hidraw/hidraw2/device/uevent:HID_ID=0003:00001B1C:00001B09
/sys/class/hidraw/hidraw2/device/uevent:HID_NAME=Corsair Corsair K70R Gaming Keyboard
/sys/class/hidraw/hidraw2/device/uevent:HID_PHYS=usb-0000:00:12.0-1/input2
/sys/class/hidraw/hidraw2/device/uevent:HID_UNIQ=
/sys/class/hidraw/hidraw2/device/uevent:MODALIAS=hid:b0003g0001v00001B1Cp00001B09
/sys/class/hidraw/hidraw3/device/uevent:DRIVER=hid-generic
/sys/class/hidraw/hidraw3/device/uevent:HID_ID=0003:0000046D:0000C07D
/sys/class/hidraw/hidraw3/device/uevent:HID_NAME=Logitech Gaming Mouse G502
/sys/class/hidraw/hidraw3/device/uevent:HID_PHYS=usb-0000:00:12.0-2/input0
/sys/class/hidraw/hidraw3/device/uevent:HID_UNIQ=1388344E3138
/sys/class/hidraw/hidraw3/device/uevent:MODALIAS=hid:b0003g0001v0000046Dp0000C07D
/sys/class/hidraw/hidraw4/device/uevent:DRIVER=hid-generic
/sys/class/hidraw/hidraw4/device/uevent:HID_ID=0003:0000046D:0000C07D
/sys/class/hidraw/hidraw4/device/uevent:HID_NAME=Logitech Gaming Mouse G502
/sys/class/hidraw/hidraw4/device/uevent:HID_PHYS=usb-0000:00:12.0-2/input1
/sys/class/hidraw/hidraw4/device/uevent:HID_UNIQ=1388344E3138
/sys/class/hidraw/hidraw4/device/uevent:MODALIAS=hid:b0003g0001v0000046Dp0000C07D
/sys/class/hidraw/hidraw5/device/uevent:DRIVER=hid-generic
/sys/class/hidraw/hidraw5/device/uevent:HID_ID=0003:00001852:00007022
/sys/class/hidraw/hidraw5/device/uevent:HID_NAME=FiiO DigiHug USB Audio
/sys/class/hidraw/hidraw5/device/uevent:HID_PHYS=usb-0000:00:10.1-2/input0
/sys/class/hidraw/hidraw5/device/uevent:HID_UNIQ=
/sys/class/hidraw/hidraw5/device/uevent:MODALIAS=hid:b0003g0001v00001852p00007022
```
```
hidrd-convert -o spec /sys/class/hidraw/hidraw3/device/report_descriptor
Usage Page (Desktop),               ; Generic desktop controls (01h)
Usage (Mouse),                      ; Mouse (02h, application collection)
Collection (Application),
    Usage (Pointer),                ; Pointer (01h, physical collection)
    Collection (Physical),
        Usage Page (Button),        ; Button (09h)
        Usage Minimum (01h),
        Usage Maximum (10h),
        Logical Minimum (0),
        Logical Maximum (1),
        Report Count (16),
        Report Size (1),
        Input (Variable),
        Usage Page (Desktop),       ; Generic desktop controls (01h)
        Logical Minimum (-32767),
        Logical Maximum (32767),
        Report Size (16),
        Report Count (2),
        Usage (X),                  ; X (30h, dynamic value)
        Usage (Y),                  ; Y (31h, dynamic value)
        Input (Variable, Relative),
        Logical Minimum (-127),
        Logical Maximum (127),
        Report Size (8),
        Report Count (1),
        Usage (Wheel),              ; Wheel (38h, dynamic value)
        Input (Variable, Relative),
        Usage Page (Consumer),      ; Consumer (0Ch)
        Usage (AC Pan),             ; AC pan (0238h, linear control)
        Report Count (1),
        Input (Variable, Relative),
    End Collection,
End Collection
```
```
hidrd-convert -o spec /sys/class/hidraw/hidraw4/device/report_descriptor
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Keyboard),                       ; Keyboard (06h, application collection)
Collection (Application),
    Report ID (1),
    Usage Page (Keyboard),              ; Keyboard/keypad (07h)
    Usage Minimum (KB Leftcontrol),     ; Keyboard left control (E0h, dynamic value)
    Usage Maximum (KB Right GUI),       ; Keyboard right GUI (E7h, dynamic value)
    Logical Minimum (0),
    Logical Maximum (1),
    Report Size (1),
    Report Count (8),
    Input (Variable),
    Input (Constant, Variable),
    Report Count (6),
    Report Size (8),
    Logical Minimum (0),
    Logical Maximum (164),
    Usage Minimum (None),               ; No event (00h, selector)
    Usage Maximum (KB ExSel),           ; Keyboard ExSel (A4h, selector)
    Input,
End Collection,
Usage Page (Consumer),                  ; Consumer (0Ch)
Usage (Consumer Control),               ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (3),
    Report Size (16),
    Report Count (2),
    Logical Minimum (1),
    Logical Maximum (652),
    Usage Minimum (Consumer Control),   ; Consumer control (01h, application collection)
    Usage Maximum (AC Send),            ; AC send (028Ch, selector)
    Input,
End Collection,
Usage Page (Desktop),                   ; Generic desktop controls (01h)
Usage (Sys Control),                    ; System control (80h, application collection)
Collection (Application),
    Report ID (4),
    Report Size (2),
    Report Count (1),
    Logical Minimum (1),
    Logical Maximum (3),
    Usage (Sys Sleep),                  ; System sleep (82h, one-shot control)
    Usage (Sys Power Down),             ; System power down (81h, one-shot control)
    Usage (Sys Wake Up),                ; System wake up (83h, one-shot control)
    Input (No Preferred, Null State),
    Report Size (6),
    Input (Constant, Variable),
End Collection,
Usage Page (FF00h),                     ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
    Report ID (16),
    Report Size (8),
    Report Count (6),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage (01h),
    Input,
    Usage (01h),
    Output,
End Collection,
Usage Page (FF00h),                     ; FF00h, vendor-defined
Usage (02h),
Collection (Application),
    Report ID (17),
    Report Size (8),
    Report Count (19),
    Logical Minimum (0),
    Logical Maximum (255),
    Usage (02h),
    Input,
    Usage (02h),
    Output,
End Collection
```

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -279,8 +279,10 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 _D('Wireless Mouse Pebble M350', protocol=2.0, wpid='4080', codename='Pebble')
 _D('MX Master 3 Wireless Mouse', codename='MX Master 3', protocol=4.5, wpid='4082', btid=0xb023)
 _D('PRO X Wireless', kind='mouse', codename='PRO X', wpid='4093', usbid=0xc094)
+
 _D('G9 Laser Mouse', codename='G9', usbid=0xc048, interface=1, protocol=1.0,
     settings=[_PerformanceMXDpi, _ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
+_D('G502 Gaming Mouse', codename='G502', usbid=0xc07d, interface=1)
 _D('G402 Gaming Mouse', codename='G402', usbid=0xc07e, interface=1)
 _D('G900 Chaos Spectrum Gaming Mouse', codename='G900', usbid=0xc081)
 _D('G403 Gaming Mouse', codename='G403', usbid=0xc082)
@@ -288,7 +290,7 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 _D('G703 Lightspeed Gaming Mouse', codename='G703', usbid=0xc087)
 _D('GPro Gaming Mouse', codename='GPro', usbid=0xc088)
 _D('G502 SE Hero Gaming Mouse', codename='G502 Hero', usbid=0xc08b, interface=1)
-_D('G502 Lightspeed Gaming Mouse', codename='G502', usbid=0xc08d)
+_D('G502 Lightspeed Gaming Mouse', codename='G502 Lightspeed', usbid=0xc08d)
 _D('MX518 Gaming Mouse', codename='MX518', usbid=0xc08e, interface=1)
 _D('G703 Hero Gaming Mouse', codename='G703 Hero', usbid=0xc090)
 _D('G903 Hero Gaming Mouse', codename='G903 Hero', usbid=0xc091)


Test patch: