Make the most of your warranty. Register Your Product File a warranty claim. Having issues with your keyboard, mouse or Logitech Options on macOS. Wireless Solar Keyboard K Support. Questions about your Wireless Solar Keyboard K? We’ve got the answers, videos, downloads and information you .
|Published (Last):||6 February 2010|
|PDF File Size:||16.36 Mb|
|ePub File Size:||12.90 Mb|
|Price:||Free* [*Free Regsitration Required]|
I’m particularly picky on keyboards, but this one is good.
Logitech K750 keyboard and Unifying Receiver Linux support
It has an incredible useful feature: My problem is that there’s obviously no way to know the battery status from Linux, the provided application only working on Windows.
And one dark night, while fragging on QuakeLive, my keyboard stopped working: This activity being quite energy consuming, it emptied the whole battery. Someone should write code to get the battery status and light meter from Linux: This logitdch, like many of the new wireless devices from Logitech, uses the Unifying interface. It’s an USB receiver that can be attached up to 6 differents devices mouse, keyboards…. Recently, a driver called hid-logitech-dj has been added to the Linux kernel.
With this driver, each device attached to the receiver is recognized as one different device. The Logitech application under Windows works that way: On the keyboard, there’s a special “light” button up right. When pressed, a LED will light up on the keyboard: Pushing this same button while the application is running will makes the light meter activated: As far as I know, there’s nothing in the USB HID protocol that handles this kind of functionality lobitech status, light meter… in a standard way.
So logitch first task to accomplish is, unfortunately, to reverse engineer the program. I discovered a bit too late that Drew Fisher did a good presentation on USB reverse engineering at 28c3. You might want to take a look at it if you want to reverse engineer on USB.
I did not need it, but Supportt learned a few things. Anyway, my plan was the following: To achieve that, you need a virtual machine emulator that logiteh do USB pass-through.
To sniff what happens on the USB, you need to load the usbmon Linux kernel module. Simply doing modprobe usbmon will work.
You can then use Wireshark which know how to use usbmon devices and understand the USB protocol. You don’t need to know much about USB to understand what I’ll write about below, but for the sake of comprehensibility I’ll write a couple of things here before jumping in. To communicate with an USB device, we communicate with one of its endpoints. Endpoints are regrouped into an interface.
Interfaces are regrouped into a configuration.
Logitech K keyboard and Unifying Receiver Linux support
A device might contains one or several configurations. There’s also several types of packets in the USB wire protocol, and at least two of them interest us there, they are:. All of this and more is well and better explained in the chapter 13 of Linux Device Drivers, Third Edition. Once everything was set-up, I ran my beloved Wireshark.
There’s a an URB of type interrupt sent each time you press any key with some data in it. Therefore I advise support to plug another keyboard or use the laptop keyboard if you’re doing this on a laptopotherwise you’ll get crazy trying to sniff the keyboard you’re typing on.
At this point, just launching the application does a bunch of USB traffic. Pressing the “light” button on the keyboard makes even more USB packets coming in and out.
Here’s the interesting packets that I noticed once I excluded the noise:. With all this, the next step was clear: What’s here interesting is the last part representing the data.
Well, actually, you can’t decode them like that, unless you’re a freak or a Logitech engineer. And I have actually no idea what they mean. But sending this to the keyboard will trigger an interesting thing: This is most interesting packet.
This is the one sent by the keyboard to the host and that contains the data we want to retrieve. This packets come in regularly 1 per second on the wire for some time once you sent the “go for the light meter” packet. At one point they are emitted less often and do not contain the value for the light meter anymore, suggesting that the control packet sent earlier triggers the activation of the light meter for a defined period.
Now you probably wonder where the data are in this. They’re in the 20 bytes leftover in the capture data part, indicated by Wireshark, at the end of the packet: Fortunately, it was easy to decode. Knowing we’re looking for 2 values battery charge and light meterwe just need to observe and compare the packet emitted on the wire with the values displayed by the Logitech Solar App. To achieve this, I looked both at the Logitech Solar App and Wireshark while bringing more and more light near the keyboard, increasing the lux value received by the meter on the Solar App, and saw that the fields represented in blue see below where changing in Wireshark.
Since 2 bytes were changing, I guessed that it was coded on 16 bits, and therefore it was easy to correlate the value with the Solar App. It’s basically dark, and that makes sense: I’ve no idea what the GOOD part of the packet is about, but it’s present in every packet and it’s actually very handy to recognize such a packet.
Therefore I’m considering this as some sort of useful mark for now. For the other bytes, they were always the same 0x11 0x2 0x9 0x10 at the beginning, 7 times 0x00 at the end. Now we’ve enough information to build our own very basic solar application.
We know how to triggers the light meter, and we know how to decode the packets. We’re going to write a small application using libusb. Here’s a quick example. It’s not perfect and does not check for error codes, be careful. Unfortunately, this approach has at least one major drawback. We have to disconnect the Logitech Unifying Receiver from the kernel. That means that while we’re waiting for the packet, we’re dropping packets corresponding to other events from every connected device key presses, pointer motions….
In order to solve that, I sent a request for help on the linux-input mailing list. This opens a whole new world. With that document, I may be able to understand the part I reverse engineered and convert this to a more useful and generic library using the hidraw interface so we don’t have to disconnect the devices from the kernel driver.
How the keyboard works This keyboard, like many of the new wireless devices from Logitech, uses the Unifying interface.
What the Logitech application does The Logitech application under Windows works that way: Let’s reverse engineer this As far as I know, there’s nothing in the USB HID protocol that handles this kind of functionality battery status, light meter… in a standard way. USB stuff you need to know You don’t need to know much about USB to understand what I’ll write about below, but for the sake of comprehensibility I’ll write a couple of things here before jumping in.
There’s also several types of packets in the USB wire protocol, and at least two of them interest us there, they are: Interrupt packets, a packet send spontaneously; Controls packets, used for command and status operations.
Sniffed data Once everything was set-up, I ran my beloved Wireshark. Here’s the interesting packets that I noticed once I excluded the noise: When pressing the “light” button, an URB of type interrupt is sent by the keyboard to the computer; An URB control packet is sent by the computer to the keyboard in response; Regularly URB interrupt packets are sent just after.
What the packets mean The “go for the light meter” packet The packet sent logitefh the computer to the keyboard logiteech the following. The “light meter and battery values” packet This is most interesting packet. Success 0 URB length [bytes]: Unknown 0xffff ] Leftover Capture Data: Building our solar app Now we’ve enough information to logltech our own very basic solar application. Found keyboard 0x0x24ec8e0 Charge: To be continued Unfortunately, this approach has at least one major drawback.