pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.45k stars 404 forks source link

k780 support? #298

Closed faassen closed 4 years ago

faassen commented 7 years ago

I have a k780 and while I have it working with bluetooth, it doesn't seem to want to pair with the unified receiver. I have two (one that came with my mouse, a M705, the other came with k780). The mouse pairs with both receivers just fine.

I managed to pair the keyboard with ltunify once, but it still didn't actually let me type anything. But at least it showed up in the listing. That pairing did show up in solaar. I haven't even been able to replicate this behavior -- I can't get any of the tools to pair anything. It's possible that is because that dongle was pre-paired (it came with the k780), and I didn't check properly, but anyhow, I could remove the pairing just fine. :)

k780 has function keys to pair, and turning off and on the device isn't possible. I try holding the key for a few seconds to initiate pairing, and it blinks, but solaar simply times out. The instructions suggest that on Windows you need to press fn-P and on Mac OS fn-O to finalize pairing, but pressing either has no effect either.

I don't see the k780 in the list of devices in docs. Is it supposed to work? Has anyone gotten it to work? Any way I can help debug this?

Lekensteyn commented 7 years ago

Having links to the technical specifications of the device would be nice. In particular, what kind of protocol is in use. Maybe some device IDs?

Got links to the official support information from Logitech?

faassen commented 7 years ago

I actually just came back to this issue to report I just made it work!

What was confusing is that this keyboard has 3 buttons which can be connected to 3 different devices, either bluetooth or the universal receiver. You can press the button for a few seconds to let it set up the connection. But that didn't work.

But I actually found the on and off button on the right side; it is very small and I didn't realize it was there. Once I turned it off and on during connection, Solaar connects fine and I'm typing this right now using the keyboard. I'll see whether I run into any other issues.

Before we close this issue it might be useful to include a note in the documentation that even though the k780 doesn't specify it, you must actually use the on and off button on the right side of the keyboard to make the connection, just like Solaar says. It seems to retain the device key setting between turning off and on, and I was able to hook it up to device 3. What would also be nice if just the long press of those device switch buttons could be used to make things work instead of having to turn things off and on. But for that we'd need the specifications, and a cursory google doesn't turn up anything yet.

faassen commented 7 years ago

Okay, I rebooted. The keyboard is still working. Oddly enough it doesn't show up in the Solaar GUI anymore, which is rather confusing. The Solaar CLI does show it, along with some potentially useful information:

  2: K780 Multi-Device Keyboard
     Codename     : K780
     Kind         : keyboard
     Wireless PID : 405B
     Protocol     : HID++ 4.5
     Polling rate : 20 ms (50Hz)
     Serial number: 4D71FEE1
        Bootloader: BOT 25.00.B0005
          Firmware: MPK 01.00.B0018
             Other: 
     The power switch is located on the edge of top right corner.
     Supports 31 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
         3: DEVICE NAME            {0005}   
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: unknown:0007           {0007}   
         7: BATTERY STATUS         {1000}   
         8: CHANGE HOST            {1814}   
         9: unknown:1815           {1815}   
        10: REPROG CONTROLS V4     {1B04}   
        11: unknown:1C00           {1C00}   
        12: NEW FN INVERSION       {40A2}   
        13: ENCRYPTION             {4100}   
        14: KEYBOARD DISABLE       {4521}   
        15: unknown:4531           {4531}   
        16: LOCK KEY STATE         {4220}   
        17: unknown:00C2           {00C2}   
        18: unknown:1803           {1803}   internal, hidden
        19: unknown:1806           {1806}   internal, hidden
        20: unknown:1805           {1805}   internal, hidden
        21: unknown:1813           {1813}   internal, hidden
        22: unknown:1830           {1830}   internal, hidden
        23: unknown:1861           {1861}   internal, hidden
        24: unknown:1890           {1890}   internal, hidden
        25: unknown:1891           {1891}   internal, hidden
        26: unknown:18A1           {18A1}   internal, hidden
        27: unknown:1DF3           {1DF3}   internal, hidden
        28: unknown:1E00           {1E00}   hidden
        29: unknown:1EB0           {1EB0}   internal, hidden
        30: unknown:18B0           {18B0}   internal, hidden
     Battery: 90%, discharging.

It's ironic it points out where the power switch it only after I found it myself to make it connect so it could tell me where it is. :)

faassen commented 7 years ago

The GUI does show '2 paired devices', the cli shows that the k780 is paired, but the GUI doesn't actually show the k780 in the tree. It did show it after the first pairing, but it doesn't show it after reboot. I tried this with the version of Solaar included in Fedora 23, but I now also double checked this with git master and the behavior is still the same. My M705 mouse does show up.

Lekensteyn commented 7 years ago

Can you include the output of solaar --debug? Maybe there are some hints there.

The pairing via off/on is a firmware thing, Solaar cannot change it.

ralphdd commented 7 years ago

Hi faassen, what system you use? i use an ubuntu 14.04 with the keyboard k780(solaar version: 0.9.2). And I don't have the option to switch the fn-key. In your infolist above shows something about fn key Maybe you find a way.

jrbenito commented 7 years ago

@ralphdd ,

Could you please test my branch k780 for this device? In order to do it follow:

$ mkdir Solaar
$ git clone https://github.com/jrbenito/Solaar.git Solaar
$ cd Solaar
$ git checkout k780
$ bin/solaar show
$ bin/solaar 

Don´t forget to close solaar (system installed) before last command above.

Please, report if FN Swap is possible and results of solaar show.

thanks a lot.

ralphdd commented 7 years ago

@jrbenito it seems to work with the k780-branch. here the output

` Unifying Receiver Device path : /dev/hidraw0 USB id : 046d:c52b Serial : 14689F6A Firmware : 24.01.B0023 Bootloader : 01.08 Other : AA.AC Has 2 paired device(s) out of a maximum of 6. Notifications: wireless, software present (0x000900) Device activity counters: 1=163, 2=219

2: Wireless Solar Keyboard K780 Codename : K780 Kind : keyboard Wireless PID : 405B Protocol : HID++ 4.5 Polling rate : 20 ms (50Hz) Serial number: CBC6C5BC Bootloader: BOT 25.00.B0005 Firmware: MPK 01.01.B0019 Other: The power switch is located on the edge of top right corner. Supports 31 HID++ 2.0 features: 0: ROOT {0000}
1: FEATURE SET {0001}
2: DEVICE FW VERSION {0003}
3: DEVICE NAME {0005}
4: WIRELESS DEVICE STATUS {1D4B}
5: RESET {0020}
6: unknown:0007 {0007}
7: BATTERY STATUS {1000}
8: CHANGE HOST {1814}
9: unknown:1815 {1815}
10: REPROG CONTROLS V4 {1B04}
11: unknown:1C00 {1C00}
12: NEW FN INVERSION {40A2}
13: ENCRYPTION {4100}
14: KEYBOARD DISABLE {4521}
15: unknown:4531 {4531}
16: LOCK KEY STATE {4220}
17: unknown:00C2 {00C2}
18: unknown:1803 {1803} internal, hidden 19: unknown:1806 {1806} internal, hidden 20: unknown:1805 {1805} internal, hidden 21: unknown:1813 {1813} internal, hidden 22: unknown:1830 {1830} internal, hidden 23: unknown:1861 {1861} internal, hidden 24: unknown:1890 {1890} internal, hidden 25: unknown:1891 {1891} internal, hidden 26: unknown:18A1 {18A1} internal, hidden 27: unknown:1DF3 {1DF3} internal, hidden 28: unknown:1E00 {1E00} hidden 29: unknown:1EB0 {1EB0} internal, hidden 30: unknown:18B0 {18B0} internal, hidden Battery: 90%, discharging.

`

good work, thanks many-times

jrbenito commented 7 years ago

Thanks for testing this patch, I submitted PR #319.

Regarding the bug reported above, @faassen are you to test it on my branch?

Best regards.

faassen commented 7 years ago

Sorry for the slow response; I didn't have a chance to test it further yet, but if I find more issues I'll be sure to let you know.

awd97 commented 7 years ago

I'm having an issue with Solaar and the K780 keyboard due to its power saving. It seems to turn off after short inactivity, and while it comes back on again as expected when you press a key, unfortunately the first keystroke does not get registered.

jrbenito commented 7 years ago

@awd97 ,

This behavior, while annoying, is not related to Solaar. In fact, Solaar plays no role when you keyboard turn back on nor it have any influence on input keystroke processing. This last behavior ir controlled by Linux Kernel drivers. Nothing we can do about in Solaar.

Out of curiosity, I have a K375s connected through bluetooth to my laptop. Sometimes I see similar behavior where the very first keystroke (bringing the keyboard back to live) is lost. However, I see same behavior while using it with Android tablet (officially supported by Logitech). Are you using bluetooth or unifying receiver? K780 and K375 are multi-device if my memory does not fail me and I never experienced this with my K270 (unifying) but it was single device. Also I never tested K375s over unifying, only Bluetooth. Once again, Solaar plays no role here so this is just personal thinking exercise.

SlySven commented 7 years ago

... learn to tap Num-Lock a couple of times if the keyboard hasn't been touched for a while... ? 😜

awd97 commented 7 years ago

ahh ok. I had the K780 on the unifying receiver. I just now changed over to bluetooth and the problem goes away. So now I have the K780 on bluetooth and the MX Anywhere 2S on the unifying receiver (as the mouse polling rate is appalling on bluetooth).

jrbenito commented 7 years ago

Nice trick

Em 10 de out de 2017 19:20, "Stephen Lyons" notifications@github.com escreveu:

... learn to tap Num-Lock a couple of times if the keyboard hasn't been touched for a while... ? 😜

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pwr/Solaar/issues/298#issuecomment-335625281, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH6ItpsKPxfvkkYcrTsLyM4ubcTwDhBks5sq-2SgaJpZM4KlwwQ .

chjie7 commented 6 years ago

Thank your for your great efforts. It works for my K780 and Ubuntu 15.10. The Fn-swap now can be turned off (and keys become F1-12)!

However there is a problem: the setting may be reset from time to time.

  1. It can lose the setting in minutes (of idle time), or when I switch it back from other machine.

  2. solaar UI will not get aware of it (still showing Fx swap is 'off').

  3. I can turn it on and then off to make it really off. But I do it more often from cmdline. (just set it off)

I'm looking into the code to see what I can help...

  1. Logitech customer service said that the keyboard doesn't have memory to keep its setting. It's the connected hosts maintaining Fn-swap. Each host must have a tool doing it.

  2. For my Mac with their Options app installed, it can keep the Fn-swap off all the time (every time switching the keyboard to it). I also see that it takes some time for the Fn-swap 'off' to be ready when reboot.

  3. For Mac, the Fn-swap off is quite stable. However, I also observed that it takes Mac a few seconds for the 3 white keys (F1/F2/F3) to behave as F1/F2/F3 when the keyboard is switched to Mac. The White 1 key is for my Ubuntu box; the White 2 key for Mac. Whenever I press F2 to save file but find its LED blink and switch keyboard to Mac, I can just press White 1 to get back to Ubuntu instead of pressing Fn-F1. (That reflects it needs the daemon in Mac to get aware of the existence of K780 and help the keyboard to know it should deliver F1/F2/F3 key code instead of switching host for the 3 white keys.)

Thank you for listening. I hope such information is helpful.

stavrev commented 6 years ago

Can you please help me to turn onf F1-12 keys to be really functional keys (instead of multimedia)? I have solaar v0.9.2 (on Kubuntu 16.04.3 LTS)

chjie7 commented 6 years ago

stavrev, you have to "git clone" the up-to-date solaar, which has merged the necessary code for such control and info. (It's the same version 0.9.2 but with the needed commit mentioned above.)

chjie7 commented 6 years ago

Further information about my usage:

After days of manual "setting fn-swap false" in terminal whenever the F1-12 got back to switching keys and media keys, I wrote a little script to automate this job. I found some interesting things:

  1. I check its status with "solaar config K780 fn-swap" every second and set with "solaar config K780 fn-swap false" if true is reported. I log the changes to syslog.

  2. Later I enlarge the polling interval from 1s to 1m, it's safe. I can hardly find my log for change in syslog. At last, I set the polling interval to 5m because the keyboard looks usually reset for that interval of idleness. The syslog remains quiet and I'm happy. I conclude that our polling may prevent the K780 from getting idle and reset.

  3. We still need to face another case - it will lose our setting as well when it's switched back from other machines. So my helper tool indeed wakes up every 3 seconds to check the status. I will keep such short-interval polling if it finds the K780 is offline. (The Logitech Options for Mac looks using such interval to detect if K780 is back and connected to it.)

hiqua commented 6 years ago

About 3, I just started using Solaar so I haven't experienced your problems yet, however I see that in the debug output of Solaar you know that the keyboard just connected ("paired online"). By reading this output and checking whether a "paired online" event has occurred, one could tune the parameter at every connection, I guess this could easily be done within Solaar itself, but I haven't looked at the code yet.

chjie7 commented 6 years ago

hiqua, Thank you. I was not aware of its debug mode. I should take a look of it.

For my system (ubuntu 15.10), (a little old, but I can't upgrade because of ATI video driver's issue):

  1. K780 may go to bed after 5 minutes of idleness. (then reset)
  2. K780 will get reset after switching back from iPad For such condition, it changes to fn-swap=true (but solaar indicator is not aware of it)

(By the way, most of the time, the solaar indicator has a wrong icon (a battery icon). Only in some special conditions, it gets the right wheel icon. I don't know whether others have such problem.)

chjie7 commented 6 years ago

Update for the behavior of my solaar from git (up-to-date):

I've installed and used the solaar from git since 1 month ago. During the period, I need my helper daemon to poll the K780 keyboard's fn-swap status and set it false if it's true. (I have rebooted the system a couple of times (the last time is 5 days ago), mostly because the system can't wake up as expected.)

Last night, because of a X window hang, I restarted the display manager (# service lightdm restart), and something magic occurred to my solaar system - Now it will pop up a message at up-right corner, telling me my M585 mouse is back from offline (said "powered on"), and my K780 keyboard as well! (It's never appeared before.)

Now I don't need to run my experimental helper to help the keyboard work as expected. The solaar can now respond to the mouse and keyboard's re-connection. (They communicate with the same receiver.)

Now my solaar works pretty much like Logitech's 'options' tool on my Mac. If the K780 has fallen asleep. The first keypress is used to notice the system "I'm back". It takes a few seconds for the tool to restore the keyboard's working mode from the built-in mode. (So don't use the F1-12 keys for the first keypress.)

I don't know what has influenced solaar to work abnormally. I'll keep an eye on it.

stavrev commented 6 years ago

I managed to solve my case. I was trying to set fn-swap to true (which I thought was the right mode), but it should have been set to "false".

Regarding the problem that when the keybord goes to sleep for a while, I set up a cron script, hourly to run this:

for i in `seq 1 12`; do
       solaar config 2 fn-swap false
       sleep 5m
done

basically it executes on each 5 min. :)

chjie7 commented 6 years ago

@stavrev Yes. Your method works, with at most 5m you can't work, while you can make a coffee. ^_^

    ☆*☆*☆ *☆*☆ *☆*☆ *☆* ☆* I summarize my observation in the past 3 days.

  1. In fact, it can do a good job to respond to the online (re-connection) events of mouse/kbd if nothing goes wrong. Whenever a device is connected, it shows "powered on" at up-right corner.

  2. It may fail over time, usually in hours, without clear reason. (I cannot see any clue with its debug info.) It happened 7 times in the past 3 days.

  3. I've given up my watchdog (polling) helper, nor will I use the crontab. I found the simplest way (and with least system overhead) is a tiny script to restart the solaar service. It contains only 3 lines:

#! /bin/bash
kill `pgrep solaar`
gtk-launch solaar &> /dev/null &

Whenever solaar fails, I just run it to restart the service.

hiqua commented 6 years ago

You can probably use pkill directly.

trinitronx commented 5 years ago

@Lekensteyn : As I said in #407, I just got a K780 and was able to test that support is added in master branch as of PR #319. All basic support appears working and functional, fn-switch can be manually switched via:

solaar config 1 fn-swap False

The GTK UI shows up under Ubuntu 18.04 as a battery icon in the upper right task bar. When clicked, it opens a drop down menu for inspecting the Unifying Receiver and Keyboard. Clicking on the keyboard opens a GTK window with Battery, Wireless Link, and "Swap Fx function" toggle On / Off button. This does appear to work, but I noticed sometimes the GTK window keyboard status can flicker and say "Wireless Link offline". It then says "NN% (last known)" for the battery state giving the last known percentage as NN. Maybe it's a communications issue from solaar to the receiver, but it appears that the keyboard is functional and able to be used for typing while it thinks it is "offline". So maybe this is a new separate bug?

Anyway, as I said before the basic functionality and support is available and appears good enough for daily use. Maybe there are some nitpick issues but it's good enough for basic support.

So once a new release is made, fix for this issue is included. Until then, K780 users will have to use the version of solaar from this source code repo via python setup.py install, or maybe sudo python setup.py install --dry-run --prefix /usr/local --install-layout deb

I can confirm that the issue with fn-switch is reproducible and affects the code in master branch still. That issue appears to have been reported in #437, so the details in here might help solve that, but this issue can probably be scoped down now or marked as duplicate of #437.

As for this issue name as written (#298) scoped down to basic support for K780 device, it sounds like it can be closed as of PR #319.

trinitronx commented 5 years ago

Oh, almost forgot:

As @awd97 noticed, the keyboard does appear to go to sleep or power save mode over some period of time. I have not timed this, so I don't know the sleep timeout precisely. I have only left keyboard on and never touched the right side switch since I got it, and can verify that just pressing a key or two will wake it up. Usually arrow keys or shift keys are a good option ;-)

The sleep & wake behavior is as I'd expect with a wireless keyboard. I have a Gyration brand keyboard that works in much the same way. The big plus about the K780 so far is that it does not suffer from an issue where key press / un-press events are not registered properly, and sometimes got stuck on the Gyration keyboard. This was maddening and could cause lost work in terminals, filling up files with repeated key presses, unpredictable behavior in vi caused by bad repeated keystrokes, etc...

So big :clap: for Logitech in avoiding these issues, even on Linux!

buffex commented 5 years ago

I am not so sure what to do to resolve this issue, I have Zorin platform recently bought a K780 keyboard works ok with Mac loaded Solaar it can see and pair both K780 and the unifying adapter but the keyboard does not work any help appreciated. Kind regards

pfps commented 4 years ago

Is there any Solaar problem remaining here?

kwccoin commented 4 years ago

I actually just came back to this issue to report I just made it work!

What was confusing is that this keyboard has 3 buttons which can be connected to 3 different devices, either bluetooth or the universal receiver. You can press the button for a few seconds to let it set up the connection. But that didn't work.

But I actually found the on and off button on the right side; it is very small and I didn't realize it was there. Once I turned it off and on during connection, Solaar connects fine and I'm typing this right now using the keyboard. I'll see whether I run into any other issues.

Before we close this issue it might be useful to include a note in the documentation that even though the k780 doesn't specify it, you must actually use the on and off button on the right side of the keyboard to make the connection, just like Solaar says. It seems to retain the device key setting between turning off and on, and I was able to hook it up to device 3. What would also be nice if just the long press of those device switch buttons could be used to make things work instead of having to turn things off and on. But for that we'd need the specifications, and a cursory google doesn't turn up anything yet.

Same as I. After struggling for half a day, I found the button. I have other unifying mouse and hence got this one to easy my use of different system. It is strange not to tell us in the manual.

pfps commented 4 years ago

Solaar is pretty much about generic HID++ behaviour of Logitech devices that connect through a Logitech USB receiver. The maintainers only have access to a very few of these devices so they don't know about all their peculiarities. There is a documentation file that lists some aspects of some receivers and devices. It might be a good idea to add a section to that document with helpful information about particular devices, but this information is going to have to mostly come from users. If you craft a section for the K780 I can see if it is suitable for inclusion in the Solaar documentation.

pfps commented 4 years ago

Closing as handled correctly in the current version. Updates to the Solaar documentation about how this device works are welcome.

prime-optimal commented 1 year ago

I actually just came back to this issue to report I just made it work!

What was confusing is that this keyboard has 3 buttons which can be connected to 3 different devices, either bluetooth or the universal receiver. You can press the button for a few seconds to let it set up the connection. But that didn't work.

But I actually found the on and off button on the right side; it is very small and I didn't realize it was there. Once I turned it off and on during connection, Solaar connects fine and I'm typing this right now using the keyboard. I'll see whether I run into any other issues.

Before we close this issue it might be useful to include a note in the documentation that even though the k780 doesn't specify it, you must actually use the on and off button on the right side of the keyboard to make the connection, just like Solaar says. It seems to retain the device key setting between turning off and on, and I was able to hook it up to device 3. What would also be nice if just the long press of those device switch buttons could be used to make things work instead of having to turn things off and on. But for that we'd need the specifications, and a cursory google doesn't turn up anything yet.

OMG THANK YOU! I woulda never figured this out! Logitech support site is useless lol.

pfps commented 1 year ago

Solaar should display a message telling you to turn the device on (or off and on) when pairing. If not, please provide a screenshot of the pairing window.