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

GS66 Support #49

Open
Kayo4life opened this issue Mar 12, 2022 · 15 comments
Open

GS66 Support #49

Kayo4life opened this issue Mar 12, 2022 · 15 comments

Comments

@Kayo4life
Copy link

The power button backlight is not customizable and when using FN+F11 4 times, instead of turning off the keyboard backlight, a few keys are red with varying degrees of brightness. Also not an issue but I would like to see FN+F9 (The SteelSeries button) cycle through the color settings, ie; aqua, disco, roulette, etc.
Using GS66 10ug-219

@gturi
Copy link

gturi commented Apr 26, 2022

How did you manage to make it work with GS66? From the instruction I could not figure out how to setup an unsupported vendor

@TheBigSadd
Copy link

I'm also planning on using this tool for the GS66, could you share how you got it to work?

@gturi
Copy link

gturi commented Jul 1, 2022

After some trial and error I managed to make some progress.

The udev rules are not working, permission for hidraw* devices are not changed for GS66, since it has different idProduct.

To find my GS66 idProduct I used MSIKLM. By running sudo msiklm list it will output something similar to:

Device: SteelSeries KLC
    Device Vendor ID:        4152
    Device Product ID:       4410
    Device Serial Number:    (null)
    Device Manufacturer:     SteelSeries
    Device Path:             Y-YY:Y.Y
    Device Interface Number: 0
    Device Release Number:   XXX

Device: SteelSeries KLC
    Device Vendor ID:        4152
    Device Product ID:       4410
    Device Serial Number:    (null)
    Device Manufacturer:     SteelSeries
    Device Path:             Y-YY:Y.Y
    Device Interface Number: 1
    Device Release Number:   XXX

Vendor id and product id needs to be converted to exadecimal, so

  • 4152 becomes 1038
  • 4410 becomes 113a

So the following rule should be added to make GS66 work (even though I am thinking whether giving read and write access to other to everyone could be a security issue, but this is another matter...)

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="113a", MODE="0666"

Finally running this should make everything work:

# keyboard should be turning green
msi-perkeyrgb --model GS65 --id 1038:113a -s 00ff00

However, it does not!

Running the command the first time makes the keyboard blink white for half a second, and then prints the following stacktrace:

Traceback (most recent call last):
  File "/usr/local/bin/msi-perkeyrgb", line 33, in <module>
    sys.exit(load_entry_point('msi-perkeyrgb==2.1', 'console_scripts', 'msi-perkeyrgb')())
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/main.py", line 133, in main
    kb.set_colors(colors_map)
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/msi_keyboard.py", line 90, in set_colors
    self._hid_keyboard.send_feature_report(key_colors_packet)
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/hidapi_wrapping.py", line 65, in send_feature_report
    raise HIDSendError("HIDAPI returned error upon sending feature report to keyboard.")
msi_perkeyrgb.hidapi_wrapping.HIDSendError: HIDAPI returned error upon sending feature report to keyboard.

Running the command a second time makes the keyboard blink white for half a second, and then does not show any stack trace.

Running the command a third time shows the following message:

No USB device with ID 1038:113a found.

As a matter of fact, running sudo msiklm list does not display any info for the laptop steelseries keyboard.

To reproduce this steps rebooting the laptop will not be enough, I must turn it completely off. A funny thing is that during grub menu selection the laptop keyboard is now green, but it turns back to not be backlit after I reach the login screen.

I am testing everything on Fedora, but I do not think that the distro I am using is the issue.

@infobuscador
Copy link

I have the same behavior and just like you I followed the instructions and tried it on Ubuntu 20.04, Ubuntu 22.04 and Fedora36 but it doesn't work. Did you find any solution?

@gturi
Copy link

gturi commented Aug 22, 2022

Unfortunately not... I managed to catch the packets using wireshark on a windows boot, however I could not figure out how to modify this project or MSIKLM to make them compatible with this newer keyboard typology.

Others have reported the same issues even in the other project, but there seems to not be any progress
Gibtnix/MSIKLM#46
Gibtnix/MSIKLM#42

@jifarina
Copy link

jifarina commented Nov 23, 2022

Tried this on a GS66 11UE running on Mint, Ubuntu and now Fedora. Same result and behaviour (flash after executing command, then nothing)

Has anyone here tried this? https://gitlab.com/joncppl/mkb

I had no luck on Fedora.

@klarrieu
Copy link

@FlamingTuri thanks for posting this! I have a GP66 and managed to get it working thanks to your hint to convert the vendor/product IDs to hexadecimal. For me sudo msi-perkeyrgb --id 1038:113a <options> worked.

@jifarina
Copy link

After some trial and error I managed to make some progress.

The udev rules are not working, permission for hidraw* devices are not changed for GS66, since it has different idProduct.

To find my GS66 idProduct I used MSIKLM. By running sudo msiklm list it will output something similar to:

Device: SteelSeries KLC
    Device Vendor ID:        4152
    Device Product ID:       4410
    Device Serial Number:    (null)
    Device Manufacturer:     SteelSeries
    Device Path:             Y-YY:Y.Y
    Device Interface Number: 0
    Device Release Number:   XXX

Device: SteelSeries KLC
    Device Vendor ID:        4152
    Device Product ID:       4410
    Device Serial Number:    (null)
    Device Manufacturer:     SteelSeries
    Device Path:             Y-YY:Y.Y
    Device Interface Number: 1
    Device Release Number:   XXX

Vendor id and product id needs to be converted to exadecimal, so

* 4152 becomes 1038

* 4410 becomes 113a

So the following rule should be added to make GS66 work (even though I am thinking whether giving read and write access to other to everyone could be a security issue, but this is another matter...)

KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="113a", MODE="0666"

Finally running this should make everything work:

# keyboard should be turning green
msi-perkeyrgb --model GS65 --id 1038:113a -s 00ff00

However, it does not!

Running the command the first time makes the keyboard blink white for half a second, and then prints the following stacktrace:

Traceback (most recent call last):
  File "/usr/local/bin/msi-perkeyrgb", line 33, in <module>
    sys.exit(load_entry_point('msi-perkeyrgb==2.1', 'console_scripts', 'msi-perkeyrgb')())
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/main.py", line 133, in main
    kb.set_colors(colors_map)
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/msi_keyboard.py", line 90, in set_colors
    self._hid_keyboard.send_feature_report(key_colors_packet)
  File "/usr/local/lib/python3.10/site-packages/msi_perkeyrgb-2.1-py3.10.egg/msi_perkeyrgb/hidapi_wrapping.py", line 65, in send_feature_report
    raise HIDSendError("HIDAPI returned error upon sending feature report to keyboard.")
msi_perkeyrgb.hidapi_wrapping.HIDSendError: HIDAPI returned error upon sending feature report to keyboard.

Running the command a second time makes the keyboard blink white for half a second, and then does not show any stack trace.

Running the command a third time shows the following message:

No USB device with ID 1038:113a found.

As a matter of fact, running sudo msiklm list does not display any info for the laptop steelseries keyboard.

To reproduce this steps rebooting the laptop will not be enough, I must turn it completely off. A funny thing is that during grub menu selection the laptop keyboard is now green, but it turns back to not be backlit after I reach the login screen.

I am testing everything on Fedora, but I do not think that the distro I am using is the issue.

Hey! Any luck with this? I have your exact same hardware with your exact same results...

@gturi
Copy link

gturi commented Feb 16, 2023

Unfortunately not... I thought about booting into Windows and then analyse Steelseries gg packets via wireshark and adapt this tool. However I did not have time to dig through this. Moreover, since I usually use an external keyboard, I decided that this issue was not a priority (even though it still bugs me a lot not being able to control my laptop keyboard lightning).

I also tried following this guide to setup Steelseries GG on linux. I managed to make it start but unfortunately it was not detecting the keyboard. But it has been a while since my last attempt, I could give it another shot using the latest wine version.

@jifarina
Copy link

I also hate not being able to fully utilize my hardware... Yesterday I was finally able to set my battery thresholds from within Fedora. Keyboard backlight is the only thing I am missing in order to completely wipe out Windows from this laptop. And I am not asking much, I would be happy with just a white fixed light! Sadly I am too new to Linux to figure this thing out....

@OuttaBody
Copy link

OuttaBody commented Jun 20, 2023

Hello folks!

Let me reiterate the whole thing! I have MSI GS76 and (Linux) Manjaro installed. Everything with Manjaro worked perfectly other than the keyboard backlight.

The keyboard backlight is not simply a flashy or fancy accessory for me, but it is a must as I type things on my computer either in very dim light or no light at all at night! So, I really and truly needed the keyboard backlight to work! That's why I was hellbent on getting the keyboard backlight to work. I didn't care about the fancy and flashy keyboard backlight color functions or patterns. All I simply wanted was the keyboard backlight to light up. That's all.

I searched the internet and many different forums for months and longer than a year. I found no solution and with everything I tried I came to a dead-end and cluttered the operating system by installing bunch of stuff that didn't work or help at the end.

And finally another user (ulrickpsp) at github responded to another message I posted at the link below. With his simple solution, the keyboard backlight on my MSI GS76 laptop worked! I could not believe my eyes! I give all the credit to "ulrickpsp".
#52

Very shortly, let me state what I did.

I installed msi-perkeyrgb
If you scroll up to the very first message I posted at the site below, you'll see that I figured out the 1- vendor id (1038) and 2- product id (113A)
Gibtnix/MSIKLM#46

Type the command below, in terminal. "-p" below means pulsing. The keyboard backlight turns on and off in sequence. As you see after "--id", I inserted "1038:113a". It is specific to my laptop. When you scroll back up to the first post here, by following the steps, you will find your own computer's vendor and product id and insert your own product and vendor id instead of "1038:113a"
sudo msi-perkeyrgb --model GS75 --id 1038:113a -p aqua

As I said above, I didn't want or care about pulsing keyboard backlight. I just wanted the keyboard backlight to say on "solid". To do that, I replaced "-p" with "-s" as below. When I used "-s", it didn't recognize (understand) aqua color, probably it was not defined. So, instead of using the name "aqua", I had to use the corresponding number (ffffff) when I had to use "-s" for my own purpose. If you want a steady (solid) keyboard backlight color of your choice, you can replace "ffffff" with your preference. Once you define the keyboard backlight color, it still keeps the keyboard backlight color even after you reboot the computer or even after you update your current kernel. That's my experience. It may be different in your experience, depending on how your setup is or what Linux distro you have, installed. So, please keep that in mind. (Also, I have GS76, but still I had to go with "GS75" as shown below because GS76 was not supported or included in "msi-perkeyrgb", but it still worked!?!)
sudo msi-perkeyrgb --model GS75 --id 1038:113a -s ffffff

Here is the key. Here is what turned the keyboard backlight on.
Find your device identifier under the folder below
/sys/bus/usb/drivers/usb/

Don't ask me why, but as I understand it, Linux sees the keyboard as a usb device. You may see folders like
3-10
3-11
3-12
3-14

"3-10" may be for the mouse. "3-11" may be for webcam. "3-12" may be for the keyboard..

Even though I was told to type the command below, to find the keyboard number. I had an error because Manjaro didn't recognize the "-T" argument in the command. So, I went with "3-12" because the person (who was helping me) had the same laptop as mine (MSI GS76) and his number was "3-12". In worse case, you just have to try whatever folder numbers you see under "/sys/bus/usb/drivers/usb/"
mesg -T | grep -i usb

Get the superuser privilege by typing the command below (It may be different in your Linux distro).
sudo su

Then type the command below to turn on the keyboard backlight once and for all! Yeah!?! (Don't forget to replace '3-12' below with whatever corresponding number is, for your keyboard.)
echo '3-12' |sudo tee /sys/bus/usb/drivers/usb/unbind

Since you don't want to type the command below each time you reboot your computer, create a simple script with the instruction below to automatically start at every boot-up. That's all.
echo '3-12' |sudo tee /sys/bus/usb/drivers/usb/unbind

Good luck!

@gturi
Copy link

gturi commented Jun 28, 2023

@OuttaBody thanks for the unbind tip, it worked! I have created an udev rule and a simple script to detect the usb device by vendor and product id and then unbind the usb driver to see the effect. Now I am curious to understand why you need to unbind the driver to see the effects applied... But most importantly I am very happy that after more than one year my keyboard backlight is finally working!

100-msi-steelseries-init.rules

KERNEL=="hidraw*", \
SUBSYSTEM=="hidraw", \
ATTRS{idVendor}=="1038", \
ATTRS{idProduct}=="113a", \
MODE="0666", \
ACTION=="add", \
RUN+="/bin/su root -c '/usr/local/sbin/msi-steelseries-init.sh'"

msi-steelseries-init.sh

#!/bin/bash

idVendor="1038"
idProduct="113a"

# File used to determine whether the script has been already run.
# This is necessary to avoid entering into an infinite loop, since 
# bind makes the udev rule to trigger again.
outFile=/tmp/msi-keyboard-initialized

if [ ! -f "$outFile" ]; then
  for dir in /sys/bus/usb/drivers/usb/*; do
    if [ -d "$dir" ] &&
      [ "$(cat "$dir/idVendor")" == "$idVendor" ] &&
      [ "$(cat "$dir/idProduct")" == "$idProduct" ]; then
      touch "$outFile"

      basename "$dir" | sudo tee /sys/bus/usb/drivers/usb/unbind
      sleep 1
      basename "$dir" | sudo tee /sys/bus/usb/drivers/usb/bind
      sleep 1
      break
    fi
  done
fi

@gturi
Copy link

gturi commented Jul 11, 2023

One annoying thing about the workaround I mentioned before is that the keyboard light will not turn up after resuming from sleep. To fix that I have added the following script into /usr/lib/systemd/system-sleep (remember to give it execution permissions).

reinit-msi-steelseries-keyboard.sh

#!/bin/sh

case "$1" in
  pre)
  # Do the thing you want before suspend here, e.g.:
  # echo "going to sleep at $(date)..." > /tmp/systemd_suspend_test
  ;;
  post)
  # Do the thing you want after resume here, e.g.:
  # echo "resuming from sleep at $(date)..." > /tmp/systemd_resume_test
  rm /tmp/msi-keyboard-initialized
  /usr/local/sbin/msi-steelseries-init.sh
  ;;
esac

@FedericoCozziVM
Copy link

FedericoCozziVM commented Jul 12, 2023

I'm on G66 stealth and thanks to @gturi I've tested the fixes proposed in this thread. And... It works!!! That's fantastic!

To sum up for future readers, here's the process:

  • After cloning repo, follow the install procedure. DO NOT copy 99-msi-rgb.rules file into /etc/udev/rules.d/ (read below)
  • Identify keyboard IDs with MSIKLM as proposed by @gturi and convert them to hexadecimal. Also in my case IDs were 4152 and 4410 so I could use the proposed scripts and rules as they are.
  • copy msi-steelseries-init.sh script (from @gturi answer ) and make it runnable with chmod +x [script]
  • Copy 100-msi-steelseries-init.rules into /etc/udev/rules.d/
  • Copy reinit-msi-steelseries-keyboard.sh script (from @gturi answer ) into /usr/lib/systemd/system-sleep after making it runnable with chmod +x
  • Power off and boot PC (not only reboot, in case of keyboard detecting issue - see this comment
  • Use msi-perkeyboard specifying model ad ids. For example: msi-perkeyrgb --model GS65 --id 1038:113a -s ffffff or msi-perkeyrgb --model GS65 --id 1038:113a -p aqua

Tests

  • changing lighting to still color: OK
  • changing to preset: OK
  • changing dimming level: OK
  • FN red highlighting pressing FN button: OK
  • Resuming from sleep: OK

Issues encountered

  • Keeping both 99- and 100- rules did not work. I had to remove the 99- rule file (in repo and README) and power off.
  • Testing the presets, at some point keys' CANC and POWER buttons lights were stuck with a specific preset and did not reflect the changes.

Also thanks to @OuttaBody for the great contribution

@Bergmann89
Copy link

Hey guys, I've crated a PR for the GS66 support (including the power button). On my setup I did not have any issues during reboot, so I did not add the init and reinit scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants