Closed CKraft11 closed 2 years ago
Try this powermodel, 46D_4093.zip
This is taken from the G Pro mice. As they both use a 3.8 nominal voltage battery pack. The difference is just in capacity and discharge time, which is not reported nor used. As battery percentage estimation comes from the nominal capacity left.
Further, I just compared the G Pro's power model to my G403's which both uses a 3.8 V nominal battery pack against each other with a normalised discharged capacity,
It seems like they are within a margin of error until the last 5%.
Sadly that still does not seem to work. I also tried removing the lighting section and changing the voltages under the block section to the ones my XML reported to no avail.
Could you make a copy of the xml file with the name 46D_C094.xml
and try again? It seems like the mouse may have different variants on its serial number.
Sorry for the late reply. I did check in device manager and my mouse seems to be the C094 version which is odd because the xml I got from ghub DevTools says it is 4093. I tried changing the filename and xml header to C094 and it still does not work.
I finally had time to look at the problem again. Is your problem that the program crashes on launch, or does it just give N/A for battery values.
I have attached a build with extra debugging, as a sanity check if you are still interested. From the looks of https://github.com/libratbag/piper/issues/624, it seems like your mouse isnt reporting the ability to show battery levels.
Could you please share the debug_trace.txt from running the program and leaving it for a 10 seconds, and the http webserver is also turned on, so could you please provide the list of devices from localhost:12321/devices
After diving deeper into lghub_agent.exe
I found out that it is indeed correct that Logitech has implemented a new method of querying battery charge.
If you are interested, currently I am looking for feature id 0x1000 (Battery Level Status)
or 0x1001 (Battery Voltage)
. But from what I can see G Pro X has 0x1004 (Unified Battery)
.
I could try to copy how the Linux kernel interacts with the mouse (https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-logitech-hidpp.c#L1387, https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-next&id=e037acf0b1aed31cb5f3b09ccb602b4768c133d5), but I would just be coding in the dark as I would have no hardware to test it with.
While https://github.com/andyvorld/LGSTrayBattery_GHUB did recently break due to some changes in the websocket api, I should have a new version pushed with the fixes soon. This program is more robust in the sense that the low level communications are handled by Logitech, rather than me directly interfacing with the devices.
I finally had time to look at the problem again. Is your problem that the program crashes on launch, or does it just give N/A for battery values.
I have attached a build with extra debugging, as a sanity check if you are still interested. From the looks of libratbag/piper#624, it seems like your mouse isnt reporting the ability to show battery levels.
Could you please share the debug_trace.txt from running the program and leaving it for a 10 seconds, and the http webserver is also turned on, so could you please provide the list of devices from
localhost:12321/devices
Hopefully you can make something of this. There was multiple debug files created when I ran it and I also attached the xml readout from the local server. DebugGPX.zip
After diving deeper into
lghub_agent.exe
I found out that it is indeed correct that Logitech has implemented a new method of querying battery charge.If you are interested, currently I am looking for feature id
0x1000 (Battery Level Status)
or0x1001 (Battery Voltage)
. But from what I can see G Pro X has0x1004 (Unified Battery)
.I could try to copy how the Linux kernel interacts with the mouse (https://elixir.bootlin.com/linux/latest/source/drivers/hid/hid-logitech-hidpp.c#L1387, https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-next&id=e037acf0b1aed31cb5f3b09ccb602b4768c133d5), but I would just be coding in the dark as I would have no hardware to test it with.
While https://github.com/andyvorld/LGSTrayBattery_GHUB did recently break due to some changes in the websocket api, I should have a new version pushed with the fixes soon. This program is more robust in the sense that the low level communications are handled by Logitech, rather than me directly interfacing with the devices.
How would I go about finding the 0x1000 or 0x1001 values?
Judging from debug_trace.txt
, it does show that your mouse does not support 0x1000 or x1001 for battery values. These numbers are the featureID of Logitech's hid++ protocol, you can refer to them here https://drive.google.com/drive/u/0/folders/0BxbRzx7vEV7eWmgwazJ3NUFfQ28. The document only shows bit values of 0x1000.
The steps to properly get these values are, assuming you have found the correct HID device.
I forgot to mention that I managed to fix up the other tool, https://github.com/andyvorld/LGSTrayBattery_GHUB so you can try that first if you wish.
I forgot to mention that I managed to fix up the other tool, https://github.com/andyvorld/LGSTrayBattery_GHUB so you can try that first if you wish.
Just downloaded the new build and it works!! One minor bug though is that although the percentages are correct in the server config and the icon shows the battery perfectly, when hovering over the icon it reads NaN%.
I should have it updated and hopefully fixed now.
Here is the XML output from GHUB DevTools for the Logitech G Pro X Superlight. Currently it doesn't work and the data looks significantly different than that of other mice.
https://pastebin.com/SRSqgj9G
I also found that you can get the battery xml file simply from
C:\ProgramData\LGHUB\depots\84225\pro_x_wireless_mouse\battery\battery.xml