Comments (23)
HID++ 2.0 has support for a battery feature. Not all HID++ 2.0 devices have that feature, however: e.g. the K750 keyboard does not, but has a different feature related to the light sensor that also reports the battery charge.
from solaar.
Right now Solaar tries to enable all notifications, but on the receiver alone. I haven't looked yet at notification flags on the devices themselves.
from solaar.
Just do not enable all notifications by setting FF FF FF. On the k800, r1_bit1 has a side-effect that some keys (like Mute) are not delivered to the OS (https://git.lekensteyn.nl/ltunify/tree/registers.txt#n81). It should be possible to make Solaar generate events though... but that is getting off-topic in this issue I guess.
from solaar.
That is interesting to know; will have to check if it has the same effect on my K750.
from solaar.
Please have a look at https://github.com/Lekensteyn/Solaar/commits/sandbox, mainly:
Lekensteyn/Solaar@742d5de - RFC battery notification processing.
Lekensteyn/Solaar@e3a2731 - (simple commit moving battery register parsing into a separate function)
(the other commit is a simple fix that can be cherry picked if you want).
TODO: enable device notification enablement, can you suggest a place to do so? A quick look did not reveal a central place where new devices are (un)tracked.
from solaar.
Okay, I've done some testing with my M705 mouse; it's 0x0D register behaves the same as the 0x07 register, when the battery_notification flag is set. The battery status mesage (10 0x 0D) is only sent once, when the flag is set. No idea if it is sent at any point afterwards (the battery discharges very slow).
from solaar.
In lib/solaar/listener.py
, line 141 (in _notifications_handler()
), is where the devices are properly set-up after being discovered.
from solaar.
Heh, I wish we had more HID++ 1.0 devices to check. I see a Performance MX mouse in the repo, do you have that device in your possession? Btw, my M525 has the same "problem", it is still full ("90%") after one year and I cannot get this down (the Illuminated keyboard is easier to empty, set lights to a max brightness and wait)
from solaar.
No Performance MX, just a K750 and M705.
However, I can borrow tomorrow a M515 to check its registers.
from solaar.
That would be great. So far, the common registers seems to be:
- 00: Notifications (m510, k800, k705; should apply to every machine, in HID++ 1.0 spec)
- 01: different functions on m510, k800, k705
- 07: battery status (m510, k800)
-- D0: unknown (k800, k705); different value on m510 - F1: firmware/bootloader version (m510, k800, k705)
- F3: unknown function (m510, k800, k705)
Hopefully the differences exist only between types (keyboards, mice, ...) and not models.
from solaar.
Hm, the M515 is a HID++2.0 device, and has the standard BATTERY feature (no battery registers).
from solaar.
I own a Performance MX mouse - if you tell me what to do, i would love to help in these issue...
from solaar.
@terwarf Great, please turn off interfering programs (like Solaar) and run the tools/scan-registers.sh tool from git with Python 2 as python in your PATH. Wait a minute for completion and paste the output here.
from solaar.
@pwr I see you did some work for integrating other types of notifications. How is the battery status supposed to be updated? By writing self[BATTERY_LEVEL]
and calling self._changed()
?
from solaar.
Yup, the first if
of _process_feature_notification()
is a pretty good example.
from solaar.
I was (and am still) confused by this:
self[BATTERY_STATUS] = BATTERY_STATUS[battery_status]
BATTERY_STATUS = 'battery-status'
in status.py and _NamedInts
in hidpp20.py
. Shouldn't it be:
self[BATTERY_STATUS] = _hidpp20.BATTERY_STATUS[battery_status]
from solaar.
Yup, that's a bug.
This is what happents when I don't have a device with the feature, to trip over stuff like this :).
from solaar.
I will fix it together with refactoring this in a function in preparation for #30.
from solaar.
Here is the output of scan-registers.sh from my Performance MX mouse:
alex@linux-v34d:~/Downloads/Solaar-master/tools> ./scan-registers.sh 1
<< ( 0.017) [10 01 8100 000000] '\x10\x01\x81\x00\x00\x00\x00'
>> ( 0.049) [10 01 8100 000000] '\x10\x01\x81\x00x00x00\x00'
<< ( 1.050) [10 01 8101 000000] '\x10\x01\x81\x01\x00\x00\x00'
>> ( 1.097) [10 01 8101 020000] '\x10\x01\x81\x01\x02\x00\x00'
--
<< ( 7.335) [10 01 8107 000000] '\x10\x01\x81\x07\x00\x00\x00'
>> ( 7.382) [10 01 8107 070000] '\x10\x01\x81\x07\x07\x00\x00'
--
<< ( 86.592) [10 01 8151 000000] '\x10\x01\x81Q\x00\x00\x00'
>> ( 86.639) [10 01 8151 111100] '\x10\x01\x81Q\x11\x11\x00'
--
<< ( 108.430) [10 01 8163 000000] '\x10\x01\x81c\x00\x00\x00'
>> ( 108.477) [10 01 8163 890000] '\x10\x01\x81c\x89\x00\x00'
--
<< ( 240.505) [10 01 81D0 000000] '\x10\x01\x81\xd0\x00\x00\x00'
>> ( 240.550) [10 01 81D0 000000] '\x10\x01\x81\xd0\x00\x00\x00'
--
<< ( 245.690) [10 01 81D4 000000] '\x10\x01\x81\xd4\x00\x00\x00'
>> ( 245.737) [10 01 81D4 000012] '\x10\x01\x81\xd4\x00\x00\x12'
--
<< ( 281.016) [10 01 81F1 000000] '\x10\x01\x81\xf1\x00\x00\x00'
>> ( 282.177) [10 01 8F81 F10300] '\x10\x01\x8f\x81\xf1\x03\x00'
--
<< ( 284.106) [10 01 81F3 000000] '\x10\x01\x81\xf3\x00\x00\x00'
>> ( 284.153) [10 01 81F3 000000] '\x10\x01\x81\xf3\x00\x00\x00'
from solaar.
Odd, your notifications (the second line at 0.049) seem to miss some slashes, bug?
Please show the output of the following, it is on the tool-updates branch of my repo:
dev=1
do_req() { tools/hidconsole --hidpp | grep -v ' 8F.. ..0[12]' | grep -B 1 '^>> '; }
reg00=$(echo "10 0$dev 8100 000000" | do_req)
oldflags=$(echo "$reg00" | grep -Po '>>.*? 8100 \K[0-9a-f]{6}(?=\])')
if [ -n "$oldflags" ]; then
echo "# Old notification flags: $oldflags"
{
echo "10 0$dev 8000 ffffff" # enable all notifications
echo "10 0$dev 8100 000000" # read available notifs
echo "10 0$dev 8000 $oldflags" # restore notifications
} | do_req | grep -B 1 '^>>.* 8100 '
fi
It should looks like:
# Old notification flags: 000000
<< ( 1.098) [10 02 8100 000000] b'\x10\x02\x81\x00\x00\x00\x00'
>> ( 1.347) [10 02 8100 130200] b'\x10\x02\x81\x00\x13\x02\x00'
(if it is empty, your device is incorrect. Try 2 or 3 depending on the connected machines)
from solaar.
That's probably my fault. I copied the output from console and have reformatted it to get rid of the whitespaces...
The Code above gives me:
# Old notification flags: 000000
<< ( 1.113) [10 01 8100 000000] '\x10\x01\x81\x00\x00\x00\x00'
>> ( 1.157) [10 01 8100 100000] '\x10\x01\x81\x00\x10\x00\x00'
from solaar.
Thank you, it looks like only battery updates are available from notifications.
from solaar.
The notification flags are now enabled for each device as it becomes available.
from solaar.
Related Issues (20)
- Option to set Solaar language HOT 4
- 046d:c547
- Brightness Up and Down keys not working HOT 4
- Needed help to set basic action HOT 5
- Add ability to emit MX Master gesture events while moving rather than at end of move HOT 6
- Lost scroll , open label:"help wanted" HOT 4
- Is there a way to modify rules from a rule or set/view some internal memory/state to alter the behavior of a button once it's clicked? HOT 6
- bluetooth headset turns off wireless keyboard HOT 2
- solaar 1.1.13-30-g86b55b9 does not detect bluetooth MX Ergo, but solaar 1.1.13 release does HOT 9
- error in solaar show
- Gesture button does not work HOT 6
- Add freespinning mode for Logitech Lift HOT 1
- Termux support HOT 2
- How to navigate forward/backward with Gestures? HOT 2
- Invert fn with ctrl key on MX keys mini HOT 1
- the MX keyboard light diode of the ShiftLK key is inconsistent HOT 2
- Target the same device with different connection modes (Bluetooth vs Bolt) HOT 2
- "Exception: pairing failed: failed" when pairing logitech mx master 3s HOT 6
- Bolt Detection Issue using M650L in non sudo use HOT 3
- Allow mouse gesture button to emulate trackpad HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solaar.