libratbag / libratbag

A DBus daemon to configure input devices, mainly high-end and gaming mice
MIT License
2.13k stars 258 forks source link

Logitech G402 #694

Open Simon-Laux opened 5 years ago

Simon-Laux commented 5 years ago

see for the piper side: https://github.com/libratbag/piper/issues/338

johnjacobkenny commented 4 years ago

I have the same mouse and I was trying to change the LED modes. Tried using piper as well as ratbagctl.

Simply running ratbagctl gives

warbling-mara:       Logitech Gaming Mouse G402

Running systemctl status ratbagd.service gives

ratbag error: LED 1 does not support effect HIDPP20_LED_MODE_OFF(0001), supports 0080
ratbag error: hidpp20: failed to update led
ratbagd error: error committing device (-1000)

What I was trying to achieve was to dim (or possibly turn off) the LEDs. Should I use sudo?

beatussum commented 4 years ago

I think that, since even on the official Logitech software (G HUB) we cannot set the DPI led, it may not be possible to do this.

johnjacobkenny commented 4 years ago

Is that the case for both LEDs? I tried with both leds but no success

FFY00 commented 4 years ago

We are missing the led capabilities in the public API, this is one of the reasons we have not declared it as stable yet. In the future you won't be able to set unsupported led modes.

beatussum commented 4 years ago

In my case, the logo light works. Its particularity is that it seems to only support Off and Breathing modes:

dbus-send --system --dest=org.freedesktop.ratbag1 --print-reply /org/freedesktop/ratbag1/led/hidraw2/p0/l1 org.freedesktop.DBus.Properties.Get string:org.freedesktop.ratbag1.Led string:Modes
method return time=1588695307.452193 sender=:1.232 -> destination=:1.239 serial=122 reply_serial=2
   variant       array [
         uint32 0
         uint32 3
      ]

I do not know whether this is normal but we can mimic the On mode by setting an EffectDuration to 0, and a Brightness different from 0:

ratbagctl "Logitech Gaming Mouse G402" led 1 set duration 0      # always on
ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 255  # for the maximum

From my tests, the Breathing mode supports numbers (EffectDuration) from 533 to x, and 0. Moreover, the Off mode seems not to work, but we can "disable" the light by:

ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 0

Many of the points in my message have already been reported by @Simon-Laux (above).

@johnjacobkenny But, as I said before, the DPI light does not work, on my side, and I do not think that it is developed for it.

johnjacobkenny commented 4 years ago

Now I tried the following commands

ratbagctl "Logitech Gaming Mouse G402" led 1 set duration 0
ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 255
ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 0

And in ratbagd.service I'm getting,

ratbagd error: error committing device (-1000)
ratbag error: LED 1 does not support effect HIDPP20_LED_MODE_ON(0002), supports 0080
ratbag error: hidpp20: failed to update led
ratbagd error: error committing device (-1000)
ratbag error: LED 1 does not support effect HIDPP20_LED_MODE_ON(0002), supports 0080
ratbag error: hidpp20: failed to update led
ratbagd error: error committing device (-1000)
ratbag error: LED 1 does not support effect HIDPP20_LED_MODE_ON(0002), supports 0080
ratbag error: hidpp20: failed to update led
ratbagd error: error committing device (-1000) 

@FFY00 @beatussum Thank you for helping out. :smiley: This isn't a major issue, so I don't want to take up too much more of your time. If it isn't immediately obvious what I'm doing wrong, we can just leave it at this! Thanks :+1:

beatussum commented 4 years ago

@johnjacobkenny Well, I have managed (if we can call it a success) to have your errors. I think this is due to the fact that the led does not support the On mode as I said later: only the Breathing and Off modes work (the latter does not seem to work for an unclear reason). Try to do this before the other commands:

ratbagctl "Logitech Gaming Mouse G402" led 1 set mode breathing
johnjacobkenny commented 4 years ago

My bad :speak_no_evil:

I completely forgot about the mode. After running this command the led is off now. :tada:

Thank you so much for helping out! :smiley:

beatussum commented 4 years ago

The Disable() method for buttons seems also not to work:

ratbag error: hidpp20: failed to update button (-95)
ratbagd error: error committing device (-1000)
Rohit44647 commented 1 year ago

i was using piper but it made g402 to breathe from dim to high i want to either stop it or have full brightness.
full brightness - ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 255
0 birghtness or dim - ratbagctl "Logitech Gaming Mouse G402" led 1 set brightness 0
thank you guys this what i was exactly looking for.