![]() |
#1336 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688
Karma: 16307824
Join Date: Sep 2022
Device: Kobo Libra 2
|
I made an update for my battery statistics calculation script. It now also calculates the remaining percentage from the battery's voltage, which I've found to be a more reliable capacity indicator than either the mAh-based estimate or Nickel's built-in estimate. I removed some trailing zeroes on the voltage line to make more room for displaying the extra statistic. Here's the new script:
Code:
# Battery Statistics Calculator 1.1 (2024-05-25) by Aleron Ives # # This script calculates battery statistics for the Kobo Libra 2. # Check the contents of /sys/class/power_supply/ if you use a different # model to ensure that the statistics you want to track are available. # # You can use NickelMenu to invoke this script like so: # menu_item :main :Battery :cmd_output :500 :/mnt/onboard/.adds/battcalc.sh # Gather the necessary statistics meter=$(cat /sys/class/power_supply/battery/capacity) v_now=$(cat /sys/class/power_supply/battery/voltage_now) v_min=$(cat /sys/class/power_supply/battery/voltage_min) v_max=$(cat /sys/class/power_supply/battery/voltage_max) c_now=$(cat /sys/class/power_supply/battery/charge_now) c_full=$(cat /sys/class/power_supply/battery/charge_full) c_dfull=$(cat /sys/class/power_supply/battery/charge_full_design) # Format the statistics let v_pct=$v_max-$v_now; let v_pct/=7000 # Calculate charge percentage from V let v_pct=100-$v_pct # " let v_now/=1000; let v_min/=10000; let v_max/=10000 # Convert to V let c_now/=1000; let c_full/=1000; let c_dfull/=1000 # Convert to mAh let v_nowr=$v_now%1000; let v_now/=1000 # Simulate floating-point arithmetic let v_minr=$v_min%100; let v_min/=100 # " let v_maxr=$v_max%100; let v_max/=100 # " let charge=$c_now*100/$c_full # Calculate charge percentage from mAh let c_health=$c_full*100/$c_dfull # Calculate health percentage from mAh # Display the results echo Capacity: $c_now mAh / $charge% / $meter% echo Voltage: $v_min.$v_minr V / $v_now.$v_nowr V / $v_max.$v_maxr V / $v_pct% echo Health: $c_full mAh / $c_dfull mAh / $c_health% |
![]() |
![]() |
![]() |
#1337 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
What number of v_pct divisor for Clara 2E (3.7 V)? Thanks Last edited by hatuluang; 05-30-2024 at 07:05 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1338 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688
Karma: 16307824
Join Date: Sep 2022
Device: Kobo Libra 2
|
Enable telnet with devmodeon, cd into /sys/class/power_supply/ and use the ls command to see what's there. You can use cat to view the contents of the various statistics.
|
![]() |
![]() |
![]() |
#1339 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
I am using your nm syntax (https://www.mobileread.com/forums/sh...&postcount=993) to get /sys/class/power_supply/ and compare to your latest battery calculation (image attached) The difference in current voltage is 4.11 vs 4.10, while the calculated percentage by dividing (current capacity / maximum capacity) is 81% So it is ok to use battery calculation for Libra to Clara 2E or does it need to be changed? Thanks |
|
![]() |
![]() |
![]() |
#1340 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688
Karma: 16307824
Join Date: Sep 2022
Device: Kobo Libra 2
|
Oh nice, it seems the Clara 2E has all the statistics, too.
![]() It looks like v_max is the same (4.2 V), but v_min is not (3.6 instead of 3.5 V). You should change the v_pct divisor from 7000 to 6000. I do wonder if the Libra 2 reports v_min incorrectly. I've noticed that the charge drops off rapidly below 3.6 V, so perhaps 3.52 V is not the real minimum. |
![]() |
![]() |
Advert | |
|
![]() |
#1341 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
Please find the results with v_pct divisor = 6000 Last edited by hatuluang; 05-30-2024 at 10:00 PM. |
|
![]() |
![]() |
![]() |
#1342 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688
Karma: 16307824
Join Date: Sep 2022
Device: Kobo Libra 2
|
It's good to see that the Clara 2E also reports nonsensical voltage values sometimes.
![]() |
![]() |
![]() |
![]() |
#1343 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
|
|
![]() |
![]() |
![]() |
#1344 | |
Member
![]() Posts: 10
Karma: 10
Join Date: May 2024
Device: Kindle PW 3, Kobo Clara BW
|
Hello,
I've been poring over the NM guides, but I haven't been able to find a clear answer: is there a way to display a confirmation dialog in NickelMenu before an action takes place? For example, with the "power : reboot" command, is there a way to display a dialog that asks you to confirm or cancel the reboot, and then have a chain_success/chain_failure that then takes (or doesn't take) the action? Something like this: Quote:
|
|
![]() |
![]() |
![]() |
#1345 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,804
Karma: 7025947
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
|
Not in the current form where all actions are synchronous. For now, the recommended way is to use NickelDBus with a shell script and cmd_spawn.
|
![]() |
![]() |
![]() |
#1346 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 209
Karma: 20980
Join Date: Oct 2020
Device: Kobo Aura One, Aura HD (R.I.P.) :(
|
But it would be awesome if you could have a start sync in NickelDBus...
Last edited by Rid; 06-03-2024 at 09:18 AM. |
![]() |
![]() |
![]() |
#1347 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
However, for this sample, the objective of having a reboot command in Nickelmenu is for the user to be able to reboot their device easily rather than take a manual reboot with the power button. |
|
![]() |
![]() |
![]() |
#1348 | |
Teluk Biru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 154
Karma: 348662
Join Date: Jan 2023
Device: Kobo Clara 2E
|
Quote:
Last edited by hatuluang; 06-03-2024 at 10:47 AM. |
|
![]() |
![]() |
![]() |
#1349 | ||
Member
![]() Posts: 10
Karma: 10
Join Date: May 2024
Device: Kindle PW 3, Kobo Clara BW
|
Quote:
I'm attempting to create a shell script like you mentioned, but i can't seem to get NickelDBus to actually *do* anything after the dialog box appears. Here's the text of the script as I've got it: Quote:
(Sorry if this is the wrong thread--the NickelDBus thread hasn't been posted in for like two years, and I didn't want to necropost...) |
||
![]() |
![]() |
![]() |
#1350 |
Enthusiast
![]() Posts: 38
Karma: 10
Join Date: Mar 2023
Device: Kindle Paperwhite SE, Kindle Oasis, Kobo Libra Colour
|
I have tried Nickelmenu on my Kobo Libre Colour, I enabled telnet but I can not log in.
I tried with username root and empty password but it won't log me in. Any advice? whats the password? |
![]() |
![]() |
![]() |
Tags |
kobo, launcher, ldpreload, nickel |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo eReaders and Heat | PeterT | Kobo Reader | 13 | 08-02-2014 04:35 AM |
kobo arc launcher not working | lana loves books | Kobo Tablets | 8 | 03-21-2014 06:40 AM |
Orginization on kobo ereaders | crochetgeek2010 | Kobo Reader | 7 | 09-03-2013 02:13 PM |
Kobo Announces eReaders Available for Purchase on Kobo.com in Canada and US | markemark | News | 1 | 04-02-2013 01:46 PM |
Ereaders with Integrated Dictionary | poohbear_nc | Which one should I buy? | 4 | 04-08-2010 06:42 AM |