Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 05-28-2024, 10:43 PM   #1336
Asyd Rayn
Member
Asyd Rayn doesn't litterAsyd Rayn doesn't litter
 
Posts: 17
Karma: 164
Join Date: Sep 2010
Device: Kindle Oasis/Kobo Libra Colour
Love this little app - I have a quick question: In my settings, I have wifi on/off -- it takes a while for the wifi to make a connection with my saved WiFi networks. Is this normal behavior in NickelMenu? It's PDQ when not using NickelMenu and simply turning on the Wifi option.

Also, is there a string to be used to auto-connect when I click the sync button or whenever I use something that needs wifi, similar to auto USB connect without the prompt?
Asyd Rayn is offline   Reply With Quote
Old 05-30-2024, 05:19 PM   #1337
Aleron Ives
Wizard
Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.
 
Posts: 1,159
Karma: 13621998
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%
If you're using the Libra Colour, you'll want to change the v_pct divisor from 7000 to 9000, since the Libra Colour charges its battery to 4.4 V, rather than 4.2 V.
Attached Thumbnails
Click image for larger version

Name:	kobo_battcalc2.png
Views:	25
Size:	26.4 KB
ID:	208591  
Aleron Ives is offline   Reply With Quote
Old 05-30-2024, 06:15 PM   #1338
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by Aleron Ives View Post
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.
#
#
Hi Aleron, thanks for the battery script.
What number of v_pct divisor for Clara 2E (3.7 V)?
Thanks

Last edited by hatuluang; 05-30-2024 at 07:05 PM.
hatuluang is offline   Reply With Quote
Old 05-30-2024, 07:01 PM   #1339
Aleron Ives
Wizard
Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.
 
Posts: 1,159
Karma: 13621998
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.
Aleron Ives is offline   Reply With Quote
Old 05-30-2024, 08:42 PM   #1340
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by Aleron Ives View Post
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.
Thanks,
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
Attached Thumbnails
Click image for larger version

Name:	result.jpg
Views:	38
Size:	81.0 KB
ID:	208593  
hatuluang is offline   Reply With Quote
Old 05-30-2024, 08:50 PM   #1341
Aleron Ives
Wizard
Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.
 
Posts: 1,159
Karma: 13621998
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.
Aleron Ives is offline   Reply With Quote
Old 05-30-2024, 09:50 PM   #1342
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by Aleron Ives View Post
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.
Thanks,
Please find the results with v_pct divisor = 6000
Attached Thumbnails
Click image for larger version

Name:	screen_002.png
Views:	39
Size:	61.4 KB
ID:	208606  

Last edited by hatuluang; 05-30-2024 at 10:00 PM.
hatuluang is offline   Reply With Quote
Old 05-30-2024, 10:38 PM   #1343
Aleron Ives
Wizard
Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.Aleron Ives ought to be getting tired of karma fortunes by now.
 
Posts: 1,159
Karma: 13621998
Join Date: Sep 2022
Device: Kobo Libra 2
It's good to see that the Clara 2E also reports nonsensical voltage values sometimes. If your battery were really at 4.6 V, your Clara would probably be on fire. The middle value should always be between 3.6 and 4.2, but sysfs doesn't always report real numbers, especially during charging.
Aleron Ives is offline   Reply With Quote
Old 05-30-2024, 10:51 PM   #1344
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by Aleron Ives View Post
It's good to see that the Clara 2E also reports nonsensical voltage values sometimes. If your battery were really at 4.6 V, your Clara would probably be on fire. The middle value should always be between 3.6 and 4.2, but sysfs doesn't always report real numbers, especially during charging.
You are right, thanks a lot.
hatuluang is offline   Reply With Quote
Old 06-02-2024, 02:43 PM   #1345
mullse01
Junior Member
mullse01 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2024
Device: 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:
menu_item : main : Reboot : dbg_msg : Are you sure you want to reboot?
chain_failure : skip -1
chain_success : power : reboot
(I know this is not how dbg_msg works, I'm just using it as a placeholder)
mullse01 is offline   Reply With Quote
Old 06-02-2024, 02:49 PM   #1346
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,762
Karma: 6990705
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by mullse01 View Post
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?
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.
geek1011 is offline   Reply With Quote
Old Yesterday, 08:58 AM   #1347
Rid
Addict
Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.Rid can self-interpret dreams as they happen.
 
Posts: 204
Karma: 20980
Join Date: Oct 2020
Device: Kobo Aura One, Aura HD (R.I.P.) :(
Quote:
Originally Posted by Asyd Rayn View Post
Also, is there a string to be used to auto-connect when I click the sync button or whenever I use something that needs wifi, similar to auto USB connect without the prompt?
But it would be awesome if you could have a start sync in NickelDBus...

Last edited by Rid; Yesterday at 09:18 AM.
Rid is offline   Reply With Quote
Old Yesterday, 10:29 AM   #1348
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by mullse01 View Post
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:



(I know this is not how dbg_msg works, I'm just using it as a placeholder)
I know that is a good idea.
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.
hatuluang is offline   Reply With Quote
Old Yesterday, 10:41 AM   #1349
hatuluang
Connoisseur
hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.hatuluang ought to be getting tired of karma fortunes by now.
 
hatuluang's Avatar
 
Posts: 76
Karma: 348662
Join Date: Jan 2023
Location: Indonesia
Device: Kobo Clara 2E
Quote:
Originally Posted by Asyd Rayn View Post
Love this little app - I have a quick question: In my settings, I have wifi on/off -- it takes a while for the wifi to make a connection with my saved WiFi networks. Is this normal behavior in NickelMenu? It's PDQ when not using NickelMenu and simply turning on the Wifi option.
When you access the discovery page with WiFi turned off, the Kobo preview window will appear asking whether to enable WiFi or not. When confirming yes, the time to connect the WiFi will be the same as when you turn on WiFi via Nickelmenu.

Last edited by hatuluang; Yesterday at 10:47 AM.
hatuluang is offline   Reply With Quote
Old Yesterday, 05:42 PM   #1350
mullse01
Junior Member
mullse01 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2024
Device: Kobo Clara BW
Quote:
Originally Posted by geek1011 View Post
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.
Hello again,

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:
#!/bin/sh

signal=$(qndb -t 10000 -s dlgConfirmResult -m dlgConfirmAcceptReject "Reboot Kobo" "Are you sure you want to reboot?" "Yes" "No")

if ( $signal -eq 1 )
then
qndb -m mwcToast 3000 "Rebooting..."
qndb -m pwrReboot
elif ( $signal -eq 0 )
then
qndb -m mwcToast 3000 "Reboot cancelled."
fi
Am I missing some obvious syntax issue?

(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...)
mullse01 is offline   Reply With Quote
Reply

Tags
kobo, launcher, ldpreload, nickel


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:05 AM.


MobileRead.com is a privately owned, operated and funded community.