Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-18-2011, 12:11 PM   #1
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Question How to trigger reading location sync via cron?

Hi,

I use my Kindle 3 WiFi on my commute where it has no WiFi connection.

The Kindle is rooted and I'd like to create a cron job which wakes the Kindle at times when it should be in a place with WiFi available (home, work) and force it to sync the current reading location with the amazon network, so I can continue reading with the Kindle App on my Android.

I already found the command for waking up the Kindle (lipc-set-prop com.lab126.powerd wakeUp 1), but how do I start the syncing and can I put the Kindle back to suspend mode via another command or would I have to wait until it suspends automatically?

Any help on this is very appreciated, because if I can't find a way to accomplish the sync I'll have to buy a 3G Kindle

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 12-18-2011, 01:05 PM   #2
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by siebert View Post
Hi,

I use my Kindle 3 WiFi on my commute where it has no WiFi connection.

The Kindle is rooted and I'd like to create a cron job which wakes the Kindle at times when it should be in a place with WiFi available (home, work) and force it to sync the current reading location with the amazon network, so I can continue reading with the Kindle App on my Android.

I already found the command for waking up the Kindle (lipc-set-prop com.lab126.powerd wakeUp 1), but how do I start the syncing and can I put the Kindle back to suspend mode via another command or would I have to wait until it suspends automatically?

Any help on this is very appreciated, because if I can't find a way to accomplish the sync I'll have to buy a 3G Kindle

Ciao,
Steffen
Although there is probably a better way, you can send key codes to automatically navigate the menu system. The source code for launchpad should help there. launchpad writes keycode events to /proc/keypad and /proc/fiveway.

EDIT: It would be much better to find and launch the sync app directly. Navigating the menu can be unreliable due to different options greyed out on different units, or at different times.

Last edited by geekmaster; 12-18-2011 at 02:10 PM.
geekmaster is offline   Reply With Quote
Advert
Old 12-18-2011, 05:38 PM   #3
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by geekmaster View Post
you can send key codes to automatically navigate the menu system. The source code for launchpad should help there. launchpad writes keycode events to /proc/keypad and /proc/fiveway.
This seems to work at least in principle. Is there also a way to simulate the power switch to bring the Kindle back into suspend mode?

Quote:
EDIT: It would be much better to find and launch the sync app directly. Navigating the menu can be unreliable due to different options greyed out on different units, or at different times.
I agree that blindly navigating the menu is rather unreliable.

So any information about the sync app is still very appreciated.

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 12-18-2011, 09:15 PM   #4
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by siebert View Post
This seems to work at least in principle. Is there also a way to simulate the power switch to bring the Kindle back into suspend mode?



I agree that blindly navigating the menu is rather unreliable.

So any information about the sync app is still very appreciated.

Ciao,
Steffen
I need some sleep now, but I think changing the 1 to a 0 on the lipc powerd command will make it sleep (lipc-set-prop com.lab126.powerd wakeUp 0). Too tired to test it now. Try it and post the results.
geekmaster is offline   Reply With Quote
Old 12-19-2011, 01:42 PM   #5
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by geekmaster View Post
I need some sleep now, but I think changing the 1 to a 0 on the lipc powerd command will make it sleep (lipc-set-prop com.lab126.powerd wakeUp 0). Too tired to test it now. Try it and post the results.
Doesn't work:

Code:
[root@kindle root]# lipc-set-prop com.lab126.powerd wakeUp 1
[root@kindle root]# lipc-set-prop com.lab126.powerd wakeUp 0
com.lab126.powerd failed to set value for property wakeUp (0x8 lipcErrNoSuchProperty)
Any other suggestions?

Ciao,
Steffen
siebert is offline   Reply With Quote
Advert
Old 12-19-2011, 02:10 PM   #6
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Ha, found it!

Next to /usr/bin/powerd is a binary /usr/bin/powerd_test which gives the following usage hint when executed:

Code:
powerd_test: Utility to test powerd
Options:
  s          : Print status
  i          : Simulate input event
  p          : Simulate power button pressed event
  h          : Simulate power button held event
  l          : Simulate low batt low event
  d <value>  : Set defer sleep property to given value
  r          : Simulate a random series of events at random intervals.
               Max interval is 10s by default.
  b<optional>: Set fake battery level if a value is provided. Remember to
               there is no space between b and value.  If no value is
               provided, it interactively accepts values from you and sets
               fake battery level
  t <value>  : Max interval between events in seconds.
               Valid only when used with -r
  NOTE       : Only one of i,p,d, b and r can be used at one time
Using strings on powerd_test reveals that the following command toggles the power state:

Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed
And this command gives information about the current state:

Code:
[root@kindle /]# lipc-get-prop com.lab126.powerd status
Powerd state: Screen Saver
Remaining time in this state: Unknown
defer_suspend:0
suspend_grace:0
prevent_screen_saver:0
drive_mode:off
Battery Level: 92%
Last batt event at: 92%
Charging: Yes
batt_full=0
Battery logging: On
I still haven't found a way to trigger the whispersync without simulating key presses...

Ciao,
Steffen
siebert is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook start reading location cyberbaffled Amazon Kindle 22 09-18-2012 04:23 PM
Touch Sync books (and reading location) with iOS device? IDSmoker Barnes & Noble NOOK 1 12-10-2011 10:40 AM
What's your favorite posture & location when you are reading? bookmeal Lounge 17 10-08-2011 04:37 AM
Books I'm Reading problem after sync kimberhill Kobo Reader 27 01-09-2011 12:53 AM
Kindle 1 - Reading Location Problem gagne Amazon Kindle 4 12-26-2010 12:31 PM


All times are GMT -4. The time now is 05:39 PM.


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