From 07bff8cb376d3516551d230a0a3b646d646e73f9 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 21 May 2013 10:59:46 +0200 Subject: [PATCH 1/3] docs/installation: typo fix, clarification - Fix typo in rules path - Fix capitalisation. - `udevadm control --reload-rules` is unnecessary[1]. - `adduser` is Debian-specific, use the more portable `gpasswd`. - No need to wait 10 seconds before re-inserting. - After adding to group, user must re-login. [1]: http://unix.stackexchange.com/a/39485/8250 --- docs/installation.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 7dccdfe5..4c59df5f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -27,23 +27,22 @@ You can run the `rules.d/install.sh` script from Solaar to do this installation automatically (it will switch to root when necessary), or you can do all the required steps by hand, as the root user: -1. copy `rules.d/99-logitech-unfiying-receiver.rules` from Solaar to - `/etc/udev/rules.d/` +1. Copy `rules.d/99-logitech-unifying-receiver.rules` from Solaar to + `/etc/udev/rules.d/`. udev will automatically pick up this file using + inotify. - By default, the rule makes the Unifying Receiver device available for r/w by - all users belonging to the `plugdev` system group (standard Debian/Ubuntu + By default, the rule allows all members of the `plugdev` group to have + read/write access to the Unifying Receiver device. (standard Debian/ Ubuntu group for pluggable devices). It may need changes, specific to your particular system's configuration. If in doubt, replacing `GROUP="plugdev"` with `GROUP=""` should just work. -2. run `udevadm control --reload-rules` to let the udev daemon know about the - new rule - -3. physically remove the Unifying Receiver, wait 10 seconds and re-insert it +2. Physically remove the Unifying Receiver and re-insert it. This is necessary because if the receiver is already plugged-in, it already has a `/dev/hidraw?` device node, but with the old (`root:root`) permissions. Plugging it again will re-create the device node with the right permissions. -4. make sure your desktop users are part of the `plugdev` group, by running - `adduser plugdev` as root +3. Make sure your desktop users are part of the `plugdev` group, by running + `gpasswd $USER plugdev` as root. If these users were not assigned to the + group before, they must re-login for the changes to take effect. From 2f8e330b73f81d21c779f4b5436e9110231a3c53 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 21 May 2013 23:56:44 +0200 Subject: [PATCH 2/3] doc/logitech: add HID++1.0 battery level info This should help in https://github.com/pwr/Solaar/issues/49. This information was shared by Nestor Lopez Casado from Logitech. What remains unclear are the 0x25 and 0x26 values for r1 (Charging state). It is also not clear whether r0 (Battery/Charging level) always reports 0x00 while charging the Performance MX. (Perhaps this is only reported the first few seconds?) --- docs/logitech/battery-level.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/logitech/battery-level.txt diff --git a/docs/logitech/battery-level.txt b/docs/logitech/battery-level.txt new file mode 100644 index 00000000..719f058d --- /dev/null +++ b/docs/logitech/battery-level.txt @@ -0,0 +1,26 @@ +The battery/charging level and status is reported only if the related +reporting flag in register 0x00 is enabled by the host. The +"Battery/Charging Level" byte indicates the battery level if the +"Charging State" indicates 0x00 ("Not Charging"). If "Charging State" +indicates 0x21 to 0x23 ("Charging"), the "Battery/Charging Level" byte +indicates the level of charging. + +10 ix 07 r0 r1 r2 00 +r0 -> Battery/Charging Level + 0x00 = Reserved/Unknown + 0x01 = Critical + 0x02 = Critical (legacy value, don't use) + 0x03 = Low + 0x04 = Low (legacy value, don't use) + 0x05 = Good + 0x06 = Good (legacy value, don't use) + 0x07 = Full + 0x08..0xFF = Reserved +r1 -> Charging state + 0x00 = Not charging + 0x01..0x1F = Reserved (not charging) + 0x20 = Unknown charging state + 0x21 = Charging + 0x22 = Charging complete + 0x23 = Charging error + 0x24..0xFF = Reserved From 9c0dac044cce4b5262cf7768394062dc714c6c40 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 22 May 2013 00:10:17 +0200 Subject: [PATCH 3/3] hid10: update 07 battery parsing based on spec This fixes pwr/Solaar#49 partially, at least the charging state will be reported correctly hereafter. The charge level may still be incorrect though. --- lib/logitech/unifying_receiver/hidpp10.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/logitech/unifying_receiver/hidpp10.py b/lib/logitech/unifying_receiver/hidpp10.py index 1cc9842c..6b5dba91 100644 --- a/lib/logitech/unifying_receiver/hidpp10.py +++ b/lib/logitech/unifying_receiver/hidpp10.py @@ -132,9 +132,10 @@ def parse_battery_reply_07(level, battery_status): else 20 if level == 3 # low else 5 if level == 1 # critical else 0 ) # wtf? - status = ('charging' if battery_status == 0x25 + status = ('charging' if battery_status == 0x21 or battery_status == 0x25 else 'fully charged' if battery_status == 0x22 - else 'discharging') + else 'discharging' if battery_status == 0x00 + else None) return charge, status