|
|
Thread Tools | Search this Thread |
05-21-2024, 12:59 PM | #1 |
Connoisseur
Posts: 95
Karma: 3160
Join Date: Apr 2024
Device: none
|
Battery Statistics Calculator script (NickelMenu) not working in Libra Colour
I can't get the wonderful script Battery Statistics Calculator 1.0 (2023-05-18) that Aleron wrote to work on the Libra Colour:
Here is the script description: https://www.mobileread.com/forums/sh...postcount=1004 I used NickelMenu to trigger the script. When triggered, the script that reporting a bit of files called in the /sys/class/power_supply?battery/capacity do not exist. Am I correct that this Kobo has changed the locations of these files in the newer firmware for the Libra Colour? |
05-21-2024, 01:12 PM | #2 | |
Zealot
Posts: 122
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
|
Quote:
Last edited by hatuluang; 05-21-2024 at 01:52 PM. |
|
Advert | |
|
05-21-2024, 01:51 PM | #3 |
Connoisseur
Posts: 95
Karma: 3160
Join Date: Apr 2024
Device: none
|
I did. I put the script in the :/mnt/onboard/.adds/ which is the default (instead of :/mnt/onboard/.adds/battcalc/ as you suggested). The script is called correctly, but the various calls the script makes do not work.
It should not make a difference as long as the location referenced in NickelMenu's config file is correct, right? Can you confirm? |
05-21-2024, 01:56 PM | #4 | |
Zealot
Posts: 122
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
|
Quote:
Please look at https://www.mobileread.com/forums/sh...&postcount=999 and https://www.mobileread.com/forums/sh...postcount=1000 |
|
05-21-2024, 01:59 PM | #5 |
Bibliophagist
Posts: 39,726
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
You might want to take a look in the NickelMenu thread from message #999 and message #1000.
You can telnet to your Kobo and take a look at what you get from looking at the contents of /sys/class/power_supply/battery/. Edit: for the Libra Colour, you will need to look at the contents of /sys/class/power_supply/bd71827_bat instead. Message to self: READ TO THE END OF THE THREAD BEFORE REPLYING! Last edited by DNSB; 05-21-2024 at 02:04 PM. |
Advert | |
|
05-21-2024, 02:42 PM | #6 |
Bibliophagist
Posts: 39,726
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Played on my Libra Colour and changed battery to bd71827_bat in the shell script. I've attached the script (renamed to battcalc.sh.txt so rename back) and an image of the popup.
My first pass at the changes screwed up when I copy/pasted the script and the line endings were changed to CRLF. Used Notepad++ to change them to LF and all was happy. Spoiler:
Last edited by DNSB; 05-21-2024 at 02:45 PM. |
05-21-2024, 03:37 PM | #7 | |
Connoisseur
Posts: 95
Karma: 3160
Join Date: Apr 2024
Device: none
|
Once again, DNSB comes to the rescue!
Thank you!!! Just tried your mod. It works on the Libra Colour. Still not very accurate, as it shows a brand new Libra Colour not at 100% battery capacity (perhaps rounding error?). But better than nothing! Quote:
|
|
05-21-2024, 04:39 PM | #8 |
Bibliophagist
Posts: 39,726
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Good to hear that it works for you. Yeah, 1889 of 1890 is a bit better than 99% but the most Linux shells only do integer operations so 99% is displayed rather than 99.95%.
Perhaps someone will create a version of the script using if/then/else to allow operation on a wider variety of devices without needing editing. |
05-21-2024, 04:50 PM | #9 |
Wizard
Posts: 1,376
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
It's interesting that the Libra Colour still has all the statistics. IIRC other models like the Clara and Sage don't report as much information.
If you think 1% is "not very accurate", wait until you check the stats while charging and it says your battery is at 4.8 V. (If that were true, your Libra would be exploding and on fire lol.) I've noticed that shyhermit isn't the first person to dig my battery statistics script out of the NickelMenu thread; maybe we should have a dedicated thread for people to post NickelMenu scripts and sample configurations? |
05-21-2024, 05:46 PM | #10 |
Bibliophagist
Posts: 39,726
Karma: 154147706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
There was a Best of NickelMenu? thread which might be hijacked for that purpose or a new thread could be created.
|
05-21-2024, 06:23 PM | #11 | |
Connoisseur
Posts: 95
Karma: 3160
Join Date: Apr 2024
Device: none
|
I absolutely adore your script, Aleron. It is still fantastic stats notwithstanding the inherent issue.
I am an Apple fan. Recalling the very early days of iPhone hacking, the internal battery stats was one of the biggest achievements that the jailbreak community succeeded in cracking early on. Quote:
|
|
05-24-2024, 06:12 PM | #12 |
Wizard
Posts: 1,376
Karma: 16297052
Join Date: Sep 2022
Device: Kobo Libra 2
|
I'm experimenting with calculating the remaining capacity from the voltage, and while it does work, it messes up the lovely 3-items-per-line paradigm.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
NickelMenu script for fixing Pocket images | qkqw | Kobo Developer's Corner | 49 | 06-24-2024 03:45 PM |
Skipping forced registration on Libra Colour and Clara Colour | shyhermit | Kobo Reader | 47 | 05-18-2024 12:53 PM |
Newbie question on NickelMenu use with Libra Colour | shyhermit | Kobo Reader | 4 | 05-14-2024 02:48 PM |
Battery life of Libra Colour | Gone | Kobo Reader | 31 | 05-09-2024 12:31 AM |
NickelMenu - 'Generator error' message on Libra H2O ? | steveparry | KOReader | 1 | 04-22-2021 12:47 PM |