Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-05-2019, 03:27 AM   #16
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,751
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by davidfor View Post
I'm not sure what you are looking for. From memory, the syslog will show the timer being set when the device sleeps.
What do you mean by the syslog? A particular logfile Nickel writes to?

I thought it was impossible to schedule a wake-up on Kobo. If Nickel is indeed doing so in some wacky non-standard way, we want to know how.
Frenzie is offline   Reply With Quote
Old 09-05-2019, 03:44 AM   #17
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Frenzie View Post
What do you mean by the syslog? A particular logfile Nickel writes to?
I mean syslog. You can enable developer mode which will enable logging within nickel and other elements. This is written to syslog and written to disk at particular times.
Quote:
I thought it was impossible to schedule a wake-up on Kobo. If Nickel is indeed doing so in some wacky non-standard way, we want to know how.
As this conversation started from a comment about scheduling a wake-up to do a sync, then if it is obviously possible to schedule a wake-on on the Kobo. How it is done, I have no idea, but, I doubt it is a "wacky non-standard way".
davidfor is offline   Reply With Quote
Advert
Old 09-05-2019, 04:36 AM   #18
baskerville
Evangelist
baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.baskerville ought to be getting tired of karma fortunes by now.
 
baskerville's Avatar
 
Posts: 446
Karma: 305160
Join Date: Aug 2015
Device: Kobo Glo HD, Kobo Aura ONE
Quote:
Originally Posted by Frenzie View Post
I thought it was impossible to schedule a wake-up on Kobo.
I can do that, on the Glo HD, by writing a Unix Epoch to /sys/class/rtc/rtc0/wakealarm.
baskerville is offline   Reply With Quote
Old 09-05-2019, 05:27 AM   #19
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,751
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by davidfor View Post
As this conversation started from a comment about scheduling a wake-up to do a sync, then if it is obviously possible to schedule a wake-on on the Kobo. How it is done, I have no idea, but, I doubt it is a "wacky non-standard way".
I specified precisely why I didn't think it was possible here, so "obviously" the past tense was referring to the time before the beginning of the conversation.

My H2O has a wacky non-standard implementation of the Linux touch protocol, and the framebuffer is wacky too. This is true of many Kobos to some degree. If the H2O has a method to schedule wake-ups, it's not one specified by the Linux kernel docs. It's therefore non-standard by definition. Whether it's wacky is in the eye of the beholder, but as long as the standard methods aren't practically unusable even a superior non-standard implementation is wacky by default.

Quote:
Originally Posted by baskerville View Post
I can do that, on the Glo HD, by writing a Unix Epoch to /sys/class/rtc/rtc0/wakealarm.
Not on H2O, but it's interesting to know that it's not just 2013-era devices running older firmware on which that works.
Frenzie is offline   Reply With Quote
Old 09-05-2019, 07:07 AM   #20
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The Glo HD is a generation newer than the H2O (MK.6 vs. Mk. 5). If comparing my Forma to my H2O has taught me anything it's basically that everything was terrible until Mk. 6, so this doesn't surprise me too much .

Last edited by NiLuJe; 09-05-2019 at 09:27 AM.
NiLuJe is offline   Reply With Quote
Advert
Old 09-05-2019, 07:52 AM   #21
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,751
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Incidentally, that's the kind of thing I meant when I asked if this "indeed happens on all Kobos?" As stated in the linked references I was well aware that it was possible on the Kobo Touch, for example.

Edit: I just updated from 4.5 to 4.15 to see if there was anything new in the Linux kernel. There wasn't, at least not in this regard, but I do notice the wording changed from background sync to automatic sync.

Edit 2: also also, here's an example of a customized Kobo kernel without wacky behavior. Concretely, it sends EV_SYN so the touch events actually work how they should, it doesn't have a wonky framebuffer, and it supports multitouch because the hardware does.

Last edited by Frenzie; 09-05-2019 at 08:39 AM. Reason: About new firmware.
Frenzie is offline   Reply With Quote
Old 09-05-2019, 11:04 AM   #22
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,751
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Good news, I figured it out. The Kobo Aura H2O wakes up at the time of the alarm set through a relevant ioctl RTC_WKALM_SET call.

You can test this, for example, by using:
Code:
rtcwake -m on -s 300
And then suspending.

The key is that if rtcwake tries to perform a suspend-related action it detects that it can't, but if you just set the alarm the device will wake up from suspend at the specified time.

So I'm going to go with likely standard, but still kind of weird? Because the /sys/class/rtc/rtc0/wakealarm method is just a convenient way to do the same thing without having to compile a program.
Frenzie is offline   Reply With Quote
Old 09-05-2019, 03:48 PM   #23
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
I continue to think it's not difficult. You have simply to check if the device is in sleeping mode, and if it continues to be in that state for more than 1 day, you do shutdown, poweroff or every other command that Kobo ships. This will work if Kobo does not send STOP signal to all background tasks when it goes in sleep mode (I don't think so). It's basically something like this:

Code:
start_time=$(date +%s)

while true; do
    sleep 3 # or whatever you want. 10? Write 10

    # there should be a way to check if the device is in sleeping mode
    device_is_sleeping=boh 

    if [ $device_is_sleeping -eq 0 ] ; then
        start_time=$(date +%s)
    else
        current_time=$(date +%s)
        elapsed_time = $(echo "$current_time - $start_time | bc)

        if [ $elapsed_time -ge 86400 ] ; then
            poweroff
        fi
    fi
done
I remember there's a way to check if Kobo is in sleeping mode. Probably `nickel` process is in stopped state, but also other third party programs stops nickel.

Alternatively, there's /etc/pm/sleep.d . If Kobo has this folder and it works, you can follow this SO answer.

Last edited by Lucas Malor; 09-05-2019 at 04:07 PM.
Lucas Malor is offline   Reply With Quote
Old 09-05-2019, 04:02 PM   #24
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Except when a device is in suspend... it's in suspend. You can't interact with it via software. For all intents and purposes, it's dead to the (user-space) OS.

Hence the need to setup a *hardware* wakeup via rtc (which will in turn wake the kernel up).
NiLuJe is offline   Reply With Quote
Old 09-05-2019, 04:14 PM   #25
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Quote:
Originally Posted by NiLuJe View Post
But the point still stands even if you replace it with something they do.
halt does not do a shutdown...
Lucas Malor is offline   Reply With Quote
Old 09-05-2019, 04:16 PM   #26
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Quote:
Originally Posted by NiLuJe View Post
Except when a device is in suspend... it's in suspend. You can't interact with it via software. For all intents and purposes, it's dead to the (user-space) OS.

Hence the need to setup a *hardware* wakeup via rtc (which will in turn wake the kernel up).
Have you tried it? Because I remember I wrote a similar script and it seems to me it worked even if Kobo was in sleeping mode.

I don't think Kobo do a real suspend mode. It probably shows the sleep image and then send a STOP signal to nickel.
Lucas Malor is offline   Reply With Quote
Old 09-05-2019, 04:22 PM   #27
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,751
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Apologies for the tautology, but when you're sleeping you're sleeping. If a script were running it wouldn't be sleeping.

You need to schedule a wakeup in x time to shutdown. That's precisely what Nickel does, only for some absurd reason they don't include relevant values. I don't know if memory is bad enough of a concern to use 8-bit here in the first place, but you can just apply those 8-bits to hours and presto, you've got yourself a relevant realm of options at your disposal.

What you want is for the device to shutdown completely to preserve battery if you should let it sit for a few days. About 3-7 days probably makes the most sense as a default, although personally I'd go for something closer to two weeks.
Frenzie is offline   Reply With Quote
Old 09-05-2019, 04:23 PM   #28
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Anyway, if there's a real suspend mode, so it should exists an /etc/pm/sleep.d . You have to learn to read the entire posts, Niluge
Lucas Malor is offline   Reply With Quote
Old 09-05-2019, 04:26 PM   #29
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Quote:
Originally Posted by Frenzie View Post
Apologies for the tautology, but when you're sleeping you're sleeping. If a script were running it wouldn't be sleeping. .
Frenzie, you didn't know what is a syslog and now you are a Linux expert?

Please, try. Do a stupid script that append to a file the current date every X seconds, put Kobo in sleep mode, resume it after a while and see in the file if there's a gap in data. If so, you have to use /etc/pm/sleep.d, if the dir exists.

Last edited by Lucas Malor; 09-05-2019 at 04:29 PM.
Lucas Malor is offline   Reply With Quote
Old 09-05-2019, 04:38 PM   #30
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Lucas Malor View Post
Frenzie, you didn't know what is a syslog and now you are a Linux expert?
Lol!

Lucas Malor, this thread has some good anwsers to specific questions. I'm sure that everybody can learn from it. Even you can join the fun too if you wish.
pazos is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo Forma: changing button behaviour franklekens Kobo Reader 5 02-05-2019 03:28 PM
Aura ONE Kobo Aura ONE touchscreen generating random button presses, unresponsive pl8o Kobo Reader 3 12-25-2018 04:04 AM
Notification about power button presses for the K5 and hopefully for the KPW PaulFreund Kindle Developer's Corner 2 04-15-2013 11:55 AM
Simulating Button Presses Externally inuxy Kindle Developer's Corner 58 08-28-2012 01:55 PM
PRS-T1 How can I use back button as power button? younghere Sony Reader 1 03-12-2012 06:37 PM


All times are GMT -4. The time now is 06:02 AM.


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