Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-27-2014, 06:02 PM   #16
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
Quote:
Originally Posted by peterson View Post
If you can wait a few days, I can add this to the online screensaver extension. I'm just a bit swamped right now with work.
Of course I have a few days. I was just playing around to learn.
Thanks so much for your great work!

Hades.
Hades77 is offline   Reply With Quote
Old 03-27-2014, 06:23 PM   #17
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
Sorry to bother you again. But there's one more thing I noticed:
Assuming in config.sh I have
Code:
DISABLE_WIFI=1
then WiFi is switched off regardless whether the Kindle is in Screen Saver mode or not. In my eyes that makes no sense. I think it only should switch WiFi off, when in Screen Saver mode.

Maybe this could be realized as follows (update.sh):
Code:
# disable wireless if necessary
if test 1 -eq $DISABLE_WIFI; then
	lipc-get-prop com.lab126.powerd status | grep "Screen Saver" && (
                 logger "Disabling WiFi"
                 lipc-set-prop com.lab126.cmd wirelessEnable 0
        )
fi
Hades.

Last edited by Hades77; 03-27-2014 at 06:29 PM.
Hades77 is offline   Reply With Quote
Advert
Old 03-27-2014, 06:42 PM   #18
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
Quote:
Originally Posted by Hades77 View Post
Sorry to bother you again. But there's one more thing I noticed:
Assuming in config.sh I have
Code:
DISABLE_WIFI=1
then WiFi is switched off regardless whether the Kindle is in Screen Saver mode or not. In my eyes that makes no sense. I think it only should switch WiFi off, when in Screen Saver mode.
DISABLE_WIFI was an internal variable where the script would remember whether it enabled the WiFi and would turn it back off. I thought maybe somebody would like to use it to make sure that wifi is always disabled (e.g. in case you turned it on and forgot to turn it back off), however I did not assume a 5 minute check-interval as in your case

I am not sure whether it makes sense to have this extension support turning wifi off only during sleep. This would not be the task of the script, but rather something new, and here it probably should be "turn wifi off after X minutes of use".

Last edited by peterson; 03-27-2014 at 06:51 PM.
peterson is offline   Reply With Quote
Old 03-27-2014, 07:03 PM   #19
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
@hades77: attached is a version with support for a schedule. This has been tested a total of 5 minutes, so even though I am optimistic that it is correct, it may cause your device to explode or tell you the endings of your unread books.

EDIT: Updated file (9 hours after next post date) to better handle intervals overlapping midnight, also subsequent schedule entries that are shorter will adjust the interval accordingly.
Attached Files
File Type: zip onlinescreensaver-test-schedule.zip (9.8 KB, 122 views)

Last edited by peterson; 03-28-2014 at 03:57 AM.
peterson is offline   Reply With Quote
Old 03-27-2014, 07:07 PM   #20
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
Wow this was a very short plenty of days. Thank's! I'll have to test it tomorrow. Going to sleep now.

Hades.
Hades77 is offline   Reply With Quote
Advert
Old 03-28-2014, 04:01 AM   #21
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
Ah, well, I had most of the code already anyway. FYI, I uploaded a new version in my previous post to improve some things. Again, this has not been tested for a full day (d'oh!), but I guess it won't do much harm. Keep an eye on the log file (must not be stdout!) and let me know how it works.

Out of curiousity: what are you updating your screensaver every 5 minutes with? I'm getting bored already with my weather display and am thinking of freshing it up :-)

Next feature in my mind: use different intervals depending on whether the device is being charged or running on battery. Probably also a nice idea for another extension where it turns wifi on/off depending on that.
peterson is offline   Reply With Quote
Old 03-28-2014, 02:15 PM   #22
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
OK. I installed the new version and am now testing with the following schedule:
Code:
SCHEDULE="00:00-07:30=240 07:30-19:00=5 19:00-23:00=10 23:00-24:00=20"
Tomorrow I'll post my log and experience.

What I noticed today:
when I set DIASABLE_WIFI=1 the Kindle goes to plane mode after updating the first time, but doesn't wake up again, i.e. I always get a timeout. But maybe the problem is in my network.
Code:
Thu Mar 27 23:30:01 CEST 2014: Disabling online screensaver auto-update
Fri Mar 28 07:47:38 CEST 2014: Enabling online screensaver auto-update
Fri Mar 28 07:47:38 CEST 2014: Screen saver image updated
Fri Mar 28 07:47:39 CEST 2014: Start waiting for timeout (300 minutes)
Fri Mar 28 07:47:39 CEST 2014: Starting to wait for timeout to expire
Fri Mar 28 07:52:40 CEST 2014: Finished waiting
Fri Mar 28 07:52:44 CEST 2014: Screen saver image updated
Fri Mar 28 07:52:44 CEST 2014: Updating image on screen
Fri Mar 28 07:52:45 CEST 2014: Disabling WiFi
Fri Mar 28 07:52:45 CEST 2014: Start waiting for timeout (300 minutes)
Fri Mar 28 07:52:45 CEST 2014: Starting to wait for timeout to expire
Fri Mar 28 07:57:47 CEST 2014: Finished waiting
Fri Mar 28 07:57:47 CEST 2014: WiFi is off, turning it on now
Fri Mar 28 07:58:07 CEST 2014: No connection after timeout, aborting.
Fri Mar 28 07:58:07 CEST 2014: Disabling WiFi
Fri Mar 28 07:58:07 CEST 2014: Start waiting for timeout (300 minutes)
...

Quote:
Out of curiousity: what are you updating your screensaver every 5 minutes with? I'm getting bored already with my weather display and am thinking of freshing it up :-)
I'm using an open source home automation --> www.fhem.de
The Kindle displays my home informations, like room temperatures, the state of my ipcam and when my baby is sleeping (see attached png).

Hades.
Attached Thumbnails
Click image for larger version

Name:	KindleDisplay.png
Views:	340
Size:	38.2 KB
ID:	120942  
Hades77 is offline   Reply With Quote
Old 03-28-2014, 02:59 PM   #23
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
Quote:
Originally Posted by Hades77 View Post
when I set DIASABLE_WIFI=1 the Kindle goes to plane mode after updating the first time, but doesn't wake up again, i.e. I always get a timeout. But maybe the problem is in my network.
Code:
[...]
Fri Mar 28 07:57:47 CEST 2014: WiFi is off, turning it on now
Fri Mar 28 07:58:07 CEST 2014: No connection after timeout, aborting.
Fri Mar 28 07:58:07 CEST 2014: Disabling WiFi
Fri Mar 28 07:58:07 CEST 2014: Start waiting for timeout (300 minutes)
...
I have this at work, too. At home it works just fine, at work it times out 8 out of 10 times. Try increasing the timeout, maybe the handshaking and DHCP stuff takes longer than anticipated.

Quote:
I'm using an open source home automation --> www.fhem.de
The Kindle displays my home informations, like room temperatures, the state of my ipcam and when my baby is sleeping (see attached png).
Nice.
peterson is offline   Reply With Quote
Old 03-29-2014, 08:30 AM   #24
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
OK I've tested your latest version and will let it run. Everything looks very fine. Log attached.

Just wondering what that means:
Code:
Full two day schedule
Hades.
Attached Files
File Type: txt onlinescreensaver.log.txt (43.2 KB, 116 views)

Last edited by Hades77; 03-29-2014 at 08:32 AM.
Hades77 is offline   Reply With Quote
Old 03-29-2014, 12:49 PM   #25
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
Quote:
Originally Posted by Hades77 View Post
OK I've tested your latest version and will let it run. Everything looks very fine. Log attached.
Looks correct, very nice.

Quote:
Just wondering what that means:
Code:
Full two day schedule
If the next update is scheduled past midnight, I need to start checking the schedule at 0:00 again. It's easier to extend SCHEDULE to cover two days.

Last edited by peterson; 03-29-2014 at 05:01 PM.
peterson is offline   Reply With Quote
Old 03-31-2014, 02:35 AM   #26
peterson
Connoisseur
peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.peterson ought to be getting tired of karma fortunes by now.
 
Posts: 74
Karma: 889004
Join Date: Mar 2014
Device: Kindle PW2
I've made some minor fixes and uploaded this version as 0.3 to the first post.
peterson is offline   Reply With Quote
Old 04-08-2014, 01:52 PM   #27
Hades77
Member
Hades77 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2014
Location: Germany
Device: Kindle Paperwhite 2 WiFi
Thank you!
Hades77 is offline   Reply With Quote
Old 05-04-2014, 10:56 AM   #28
seeadler
Junior Member
seeadler began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2014
Device: Kindle 3 Wifi
I've been trying to get this to work on a Kindle 3 (wifi).
But upon running the command
Code:
/mnt/us/extensions/onlinescreensaver/bin/scheduler.sh &
i only receive the following error:
Code:
[root@kindle bin]# /mnt/us/extensions/onlinescreensaver/bin/scheduler.sh: source: line 25: config.sh: not found
Does anyone have an idea why it's not working?
Thanks.
seeadler is offline   Reply With Quote
Old 05-04-2014, 12:20 PM   #29
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: 8,813
Karma: 12901868
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
@seeadler: You broke the config by editing it with a nasty Windows editor that doesn't honor the linebreak format?
NiLuJe is offline   Reply With Quote
Old 05-04-2014, 01:37 PM   #30
seeadler
Junior Member
seeadler began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2014
Device: Kindle 3 Wifi
@NiLuJe
I just double checked and the file has the correct Unix EOLs.

With my rather limited knowledge of shell scripts I was able to edit the scheduler.sh script and add the full path for both the config.sh and the utils.sh. Now the error mentioned above is gone and the script is actually running. But I'm still getting error messages:

Code:
[root@kindle bin]# /mnt/us/extensions/onlinescreensaver/bin/scheduler.sh &
[root@kindle bin]# Sun May 4 21:28:47 GMT+03:53 2014: Full two day schedule: 00:00-06:00=300 06:00-22:00=10 22:00-24:00=30 24:0-30:0=300 30:0-46:0=10 46:0-48:0=30
com.lab126.cmd failed to access property wirelessEnable (0x8 lipcErrNoSuchProperty)
sh: -eq: argument expected
Sun May 4 21:28:48 GMT+03:53 2014: Screen saver image updated
Sun May 4 21:28:48 GMT+03:53 2014: Schedule 06:00-22:00=10 used, next update in 10 minutes
Sun May 4 21:28:48 GMT+03:53 2014: Next update in 10 minutes
/mnt/us/extensions/onlinescreensaver/bin/scheduler.sh: line 126: syntax error:  60 *
seeadler is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AZW3 Extension fcm52 Amazon Kindle 6 09-29-2013 06:47 PM
SSModeSwitcher: An extension to change Screensaver mode thomass Kindle Developer's Corner 13 11-04-2012 09:31 PM
Troubleshooting file extension gerry7 Amazon Kindle 1 05-25-2011 06:55 AM
Will there be another US copyright extension? pdurrant General Discussions 30 04-08-2011 10:12 AM
NO extension, no sugar.... Ralph Sir Edward Lounge 7 01-16-2010 10:23 AM


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


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