-
Notifications
You must be signed in to change notification settings - Fork 185
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
Support for G915 #198
Comments
Hi, g915 aren't supported now, take a look at #188 |
@lukaszuznanski Did you ever get this working? I tried running your commands as sudo with no luck |
I'm also trying to make this work on my G915. First I've built it normally and when I run: So I've recompiled it with libusb option and now when I run it in the same way as above, I don't get any message, but the return code is |
After doing some captures I've found out few things. The G915 (or the wireless dongle actually, identified by vid/pid The g810-leds has two modes of operation: hid and libusb. LED control There are at least 2 different commands to set LED colours
where AA is a led address and following it is the RGB value for that LED.
Keyboard responds with
where AA are addresses of LEDs being set (positions not used are set to 0xFF).
where first 3 bytes are RGB value, followed by 13 LED addresses (if less, then unused positions are set to 0x00). Keyboard responds with:
where RGB is the same value as set in the command and AA is an address of the first LED in the command (I wonder if this is some bug - my keyboard is running on newest firmware).
Keyboard responds with the same data |
@yawor did you get this working? The issue is g915 but it closes g815 im confused. Im still having no luck getting this to work with my G915 Im really tired of the random light show or no lights at all. |
@LindaLawton the G915 is identical to G815 regarding the protocol, except for the second byte in the request. This library (and keyleds too) sets this byte to 0xFF, which is fine for wired keyboards, as wired keyboards ignore this value. You can test this by unplugging the wireless receiver for G915 and plugging it with a USB cable to your PC. It'll work exactly like G815. The problem with wireless keyboard like G915 is that, the second byte is not ignored anymore. It's used to select a device the software is talking to - this is because both the keyboard and the dongle are using Logitech's HID++ protocol. If the second byte is equal to 0xFF, then the software is not talking to the keyboard, but to the dongle - and obviously it doesn't work. The software needs to talk to the keyboard over the wireless link. To do that, the second byte needs to be equal to 0x01 in case of G915 and LightSpeed link. The LightSpeed dongle is very similar to a Unifying one regarding the HID++ protocol usage. In case of Unifying the second byte does the same exact thing as LightSpeed, but values can be from 0x01 to 0x06 for up to 6 paired devices and 0xFF for the dongle itself. LightSpeed doesn't have pairing ability, so it only supports two values (0x01 for the keyboard and 0xFF for the dongle). |
If you look anywhere in the code where the request packet is created, you'll see something like: data = { 0x11, 0xff, 0x0c, 0x5a }; What I mean is the second value, which is 0xff here and everywhere else. |
I have it plugged into a dock could this be the issue. Should i try pluging the wire directly into the laptop? Interesting pulging it directly into the laptop its able to detect the actual name of it now
number is still the same as the number it was pulling off from the dock though No change still cant access it.
I did try with the g815 commands and they failed. #233 |
Try changing the USB PID from c33f to c33e everywhere in the code and udev rules to test it as wired. |
I only found two places in the code with c33f i changed them as you mentioned. ran the following again. linda@linda-ThinkPad-X1-Extreme-2nd: No change. linda@linda-ThinkPad-X1-Extreme-2nd: questionWhat is the exact format of the packets we are sending here. Is there any way i can test one of those manually without the library just to test that it even works. |
@LindaLawton actually I'm also having issues trying this library to get to work, even though it should with the changes I've described above. It doesn't work with either hidapi or libusb. You can check G915 branch in my fork (https://github.com/yawor/g810-led/tree/g915) to see if it works for you. I had a strange behaviour where the keyboard stopped working at all and I had to turn it off and on using power switch and even use a different keyboard to disable g810-leds to get it working again (this was on libusb). I've also been playing around with keyleds library and there I was able to get the communication with the keyboard going (over hidapi), but the current version and structure of the library doesn't allow easy implementation of led control with G815/G915. I've been discussing this with the author of keyleds and he has some plans how to make it more flexible, but I think the main issue is the lack of time. I've also been writing my own tests using hidapi in Python and I've been able to control LEDs on my G915. If I have some time I could post it somewhere for you to play around, but these are just scraps of code put together quickly to test if it works. I've actually started planning my own application in Python for these new keyboards, but it's not on my priority list right now. Regarding the protocol itself, it's a proprietary Logitech HID++ protocol (version 4.0 or 5.0, I don't remember). There's some documentation laying around the Internet, but most of it is outdated. The protocol is modular - on the hardware (like keyboard, mouse or game controller) there can be multiple services and the device can return IDs of these services and a value which is then used to access their APIs. G815/G915 keyboards actually share most of the services with older keyboards, but LED and effect controls are newer ones. |
I have been trying to use the Hub from windows and saving this to the board and thats not working either i keep getting this random cycling though the different color presets. Its a great board for programming but i really cant take this color changing. My G11 worked fine. Im not going to be much help with rewriting it in c++ i haven't coded that in fifteen years. |
@LindaLawton on the keyboard itself, you can access multiple build-in color presets by pressing backlight button + a number key from the main area (not numpad). The build-ins are under 1-7 and 0 (1-7 are different animations, 0 sets everything to Logitech blue). You can also use backlight button + "+" or "-" keys to increase and decrease animation speeds. |
Yes i have that. But the issue is after about 30 seconds - 2 minutes it changes which color setting its using and I get another random one wither it be rainbow effect or water splash effect you never know its totally random. I am trying to use this as my daily driver for coding the effects are distracting. Its a keyboard i just want one static color. I think we will be bringing this back tonight its to expensive of a keyboard to not be working properly. My husband says its my fault for not checking if Linux was supported. Its a keyboard why would it need software. You plug them in the turn on and they work. There used to be a standard for peripheral devices. |
Well, it's a "gaming" thing 😏. |
I play games to but dont need a light show. Think its an age thing. 😉 Yeah it updated on windows. I over wrote all the M1 -M3 as well as brightness 0 and 9. When it goes into sleep mode now it comes with a light show. Once i touch it it seams to remain static until i stop typing again. So what your saying is that i should be able to configure it from windows to stop the light show? and it will remain static in Linux? I was starting to wonder if it was something in Rider or Webstorm that was setting off that extra bit. |
I only get the light show when I explicitly select it with backlight button + one of the number keys. Other than that it's always static. It's static when I power it on and when it goes to sleep and wakes up. Here are my settings: First I've configured everything with ON-BOARD MEMORY MODE: Off In my Default profile I've changed only G keys to be empty (I'll maybe change them in the future). Low Battery Mode (Auto): Inactivity Lighting: Stored Custom Lighting: ON-BOARD MEMORY MODE: On |
Hello, I tried @yawor branch with G915 support but i have problem with set keys, not working, only all leds are disabled. Have you a small example, that set led of key? For example Python or C++
Wireshark usb dump, set logo |
@mienkofax I've tried porting this quickly. It doesn't work for me either. Maybe I've missed some parts of code that also need to be changed. It needs debugging. My fork can be used as a base to work further on this. |
For info, I've made a small tool named |
Thank you for info @yawor. @MatMoul this tool is very very helpful. I tried it, but I have a problem writing to the hid I captured communication (https://github.com/mienkofax/keyboard):
And I tried run tool with: ./bin/rawwrite 046d c33e 10ff0e3c000000
sleep 0.001
./bin/rawwrite 046d c33e 10ff0e1c000000
sleep 0.001
./bin/rawwrite 046d c33e 10ff142c000000
sleep 0.001
./bin/rawwrite 046d c33e 10ff131c000000
sleep 0.001
./bin/rawwrite 046d c33e 10ff131c000000 But after all commads: Example: disable all leds I send: My submitted data, captured request using wireshark I'm a beginner in this domain, sorry, but I want to help. I think it will be just a trifle, e.g. padding or maybe typo. Thank you very much for any help. Edit: All commands were sent under sudo user. |
@mienkofax |
@MatMoul, yes I run with sudo and I tried run under sudo user, nothing helped. Data was probably sent, wireshark capture, but maybe message format is not correct. G915 supports two types of connection:
|
@mienkofax Thanks for the infos... |
Hi all. |
@yawor just to be clear, whenever your keyboard "sleeps" it still goes to rainbow effect right? Until you wake it up. Or have you managed to fix that somehow? My keyboard has my profile as long as it is active, but as soon as Im inactive for a few minutes it goes in to rainbow. But when I wake it up it works again. |
@GitJamz no, my keyboard dims when goes to low power mode. The dimming actually switched all keys to dim orange. It goes back to my profile on any activity. |
Weird.. I have tried to set it to dim also in the software but it goes in to rainbow anyways,, |
@GitJamz I've already posted them some time ago. Take a look here: #198 (comment) |
Hi all, I have installed
|
+1 for the g915 TKL and I would love to be able to use the echo press profile which can't be sync with any profile on the keyboard or maybe I missed something |
I've just created PR #267 which adds support for G915. You need to build it using libusb, it won't work with hidraw. Also right now only wireless mode is supported. Wired mode requires extra work, but it is also possible. Main problem with support for both wireless and wired modes is that wired mode has higher priority on the keyboard and actually disables wireless connection, but the keyboard is also still visible as wireless in the system (so it shows as two keyboards, but only wired works in that case). If anyone is interested, I've also created a PR adding G915 support in OpenRGB project. |
Hey buddy, Nice work! Will this also support G915 TKL ? Or maybe that is the same... Also what is OpenRGB ? |
It may or may not work with G915 TKL. The APIs are compatible for sure, but the feature indexes may be different.
You'll also need some dev tools and libraries in your system. This depends on what distribution you're on. If it's Debian based (like Ubuntu), then do
Then you can build the program:
OpenRGB is a quite large project which implements RGB controls for a lot of different hardware (motherboards, graphic cards, keyboards etc). |
@yawor is it possible to detect the battery status of the G915? If so it might be possible to determine the difference between the two. As you know the only time that the keyboard will charge is when connected via USB. Wireless implies running off battery alone. |
It is possible. There's a feature for that and it should be possible to implement reading this in g810-led. There are two ways to charge the keyboard. You can connect it either to PC or an USB charger/power supply. The difference is that if connected to PC, the keyboard actually switches to wired mode (the lightspeed button turns light blue). In this mode the keyboard doesn't react to wireless connection at all (it's probably disabled so it doesn't duplicate every key press). |
Wait, there is no wired mode for g915, is it? It can only connect wirelessly as far as I know |
Not correct, you can use it wired exactly like he explained. I'm doing that in office. |
There is, it can be operated both wired (when charging) and Wireless/Lightspeed. Typical OOTB setup for Lightspeed/Bluetooth is that you don't actually have any cables attached (required for charging). Otherwise why use it via Lightspeed/Bluetooth and also charge at the same time - kind of pointless IMHO. |
Like @mcdope and @spannerman79 already said, G915 supports both modes of operation. When connected via USB cable to computer, you can even unplug the receiver and still use the keyboard.
I don't see any other benefits. It doesn't make the keyboard faster, as lightspeed is really fast and doesn't add any latency. It has been tested by LTT team with G Pro Lightspeed mouse (they've compared it with wired G Pro). By connecting G915 via cable you basically get G815, but there's risk of faster battery degradation if it's kept always at 100% (depends on what type of battery is inside the keyboard and how charging logic is implemented). |
Tried these instructions with g915 TKL and it seems the device cannot be detected. Using this command:
|
@TheOneTrueSahil I see a potential issue here. Looking at arguments you've used I assume that receiver for G915 TKL has the same USB PID as the one for full G915 ( I've created a script which retrieves features from the keyboard and prints them out. You can find it here: It requires at least Python 3.7 (maybe it'll work on 3.6 too) and this library to be installed: If you're using Arch Linux, there's a Then just run |
@yawor Yes USB PID is the same. This is my output:
I'm confused as to how these feature IDs should be added. I guess it should be setup in help.h but it seems the IDs there don't relate? |
@TheOneTrueSahil from what I see the G915 TKL should be 100% compatible with full G915. The feature count and order is the same. According to that the G915 TKL should work without any further changes to the code. |
Ok great, I probably just need to sit down and troubleshoot my setup. Very interesting, thanks for the detailed explanation |
I managed to make it work with a g915 TKL using the same instructions and the following command: $ sudo g810-led -dv 046d -dp c545 -tuk 5 -a 000000 For it to work I have to plug in the wireless receiver and plug out the keyboard. When the keyboard itself is plugged in, both commands show no output and no error code, with no visible effect on the keyboard. $ lsusb
Bus 001 Device 077: ID 046d:c343 Logitech, Inc. G915 TKL LIGHTSPEED Wireless RGB Mechanical Gaming Keyboard
Bus 001 Device 079: ID 046d:c545 Logitech, Inc. USB Receiver $ sudo g810-led -dv 046d -dp c343 -tuk 5 -a 000000
$ sudo g810-led -dv 046d -dp c545 -tuk 5 -a 000000 |
Command:
works for my g915 TKL too! Thanks a lot! |
I wrote article to summarize what I learned from this thread and from other tools regards to setups g915 TKL. I hope it will help: How to configure Logitech G915 TKL with Ubuntu? |
@womanonrails great article, but I have some remarks. You don't have a comments section so I'll post it here: You should be careful with ratbag. When you set LED from ratbagctl, it writes that configuration to onboard flash. Basically, it overwrites the stored profile (you can even select which of the 3 profiles you want to write to). I've had some issues when I tried to set some colours. I've also noticed that it messed up power saving settings and the keyboard backlight doesn't timeout at all (only G logo blinks for a moment after ~ 30 seconds of inactivity). All other mentioned applications don't mess with the onboard flash. They only change a runtime configuration. That's why there's an issue that the LED configuration is reset after the keyboard wakes up from power save function. Unfortunately non of the current software implements detecting the wake up to reapply the configuration. But there's a workaround for this. You can switch the keyboard into software mode, which disables onboard features like power saving, backlight control etc and then control everything from software. You can do this with g810-led:
After that the keyboard immediately will go dark (but it's still working - only backlight turns off). Then you can set whatever colours you like using g810-led. But remember that the power saving is disabled in this mode. It is the software that should control dimming the keyboard, but there's no software for Linux right now that does that. Also the mode is back to "board" mode after you power cycle the keyboard. Also regarding this sentence:
You've misunderstood what the commit does. In Logitech's HID API, setting LED colors is a two step process. You first send colours for each individual key - but this step has no effect at all. It only stores what you want in the keyboard's RAM. The second step is to send a commit command, which actually outputs colours stored in RAM on to physical LEDs. For g810-leds, switches |
@yawor Thanks a lot for your feedback! If you don't mind I will update my article with your comments. |
@womanonrails sure, no problem. |
@womanonrails Would you consider posting your answer to this Stack Overflow question? Could be a great way to attract traffic to your site |
#267 is working for me, with the exceptions that I had to remove the RUN directives from the udev rule, and my dongle's ID is c545 like @abrioy & @womanonrails . I edited Keyboard.h, but you could get away with only editing the udev rule (or just inserting a new one), and use "-dv 046d -dp c545 -tuk 5" on all command lines. The udev RUN problem isn't actually just in #267, other people have reported it in the main branch. |
Instructions for this already in this actual issue earlier: #198 (comment) No need for an external link. |
It seems my instructions are outdated now. There were some recent changes in the GHub software, which makes setting custom lighting effect as a default in the onboard mode a little more complicated (but it's still possible). I've checked the link from the comment @tidalvirus replied to above (already deleted) and it wasn't correct either. It missed some key elements to be able to set default lighting effect properly.
|
Is there any way to run led controller for g915? "Matching or compatible device not found !"
The text was updated successfully, but these errors were encountered: