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 02-10-2019, 12:43 PM   #1
c0c01
Junior Member
c0c01 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2019
Device: K4NT
K4NT - Help with Picture Frame

K4NT
4.1.1 (1813030025)

Firstly sincere apologies for my complete lack of knowledge (i.e zero) regarding writing scripts! I have searched the forum and open source for some help and i have seem similar threads and have tried to cobble something together for several weeks already!

PROJECT
----------------------------------------------------------------------------------------------------------------------------------------------------
I am looking to use a K4NT to display a random black & white line drawn comic strip which will change one or twice daily (and work on battery alone).

I currently have a jailbroken K4NT with the screensavers hack and basically I am trying to write a script that will just do the same as a human pressing the power button twice at a set time during the day (thus changing the screensaver to another random image before going to sleep again).
----------------------------------------------------------------------------------------------------------------------------------------------------

I have been trying to use/adapt parts of other contributors scripts such as those by peterson and _nico

https://www.mobileread.com/forums/sh...=235821&page=3

where _nico is managing to get the following results with his Kindle KT3 on a single charge "57 eips updates a day, 30-35 days".

I have also poured over the onlinescreensavers hack and the kindle weather display and

https://www.linux.com/learn/wake-lin...alarm-clock%20

As a test I have been trying to set the K4NT to wake using the RTC (RTC1 as there is no wakealarm in RTC0) to wakeup after 100 seconds have lapsed using the code below which I start via the CLI when connected to the K4NT via SSH.

Code:
#!/bin/bash 

lipc-set-prop com.lab126.cmd wirelessEnable 0

echo Current Time : `date` `date +%s`
ENDWAIT=$(( `date +%s` + 100 ))
echo Wake Up Time : $ENDWAIT 

echo 0 > /sys/class/rtc/rtc1/wakealarm 
echo Readback time: `cat /sys/class/rtc/rtc1/wakealarm`
echo $ENDWAIT > /sys/class/rtc/rtc1/wakealarm

lipc-wait-event -mt com.lab126.powerd '*'
This produces these results but doesn't seem to wake the Kindle back up. I also found that following command will carry out a simulated press of the power button on the K4NT.

Code:
lipc-send-event com.lab126.powerd.debug dbg_power_button_pressed

Any help/advice greatly appreciated.
Thanks.
c0c01 is offline   Reply With Quote
Old 02-19-2019, 11:28 PM   #2
yparitcher
Junior Member
yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'yparitcher knows the difference between 'who' and 'whom'
 
Posts: 3
Karma: 10000
Join Date: Feb 2019
Device: K4
the K4NT has a different command for rtc, found after much trail and error.
Code:
lipc-set-prop -i  com.lab126.powerd rtcWakeup 100
however this can only be set when the kindle is in the readyToSuspend state which it enters for a few seconds before sleeping.

this can be trigger by writing a backround script to detect a kindle in readyToSuspend and optionaly wakeup state to have it run a script and reset th wakeup clock.

for example:
backround script
Code:
#!/bin/sh

# location of your program
PROGRAM=/mnt/us/program.sh
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8


do_program()
{
	if [[ -f "$PROGRAM" ]]; then
	  # run program function to set picture
	  $PROGRAM do
	fi
}

run_program()
{
	if [[ -f "$PROGRAM" ]]; then
	  # run program function to reset wakup rtc
	  $PROGRAM run
	fi
}

lipc-wait-event -m com.lab126.powerd goingToScreenSaver,readyToSuspend | while read event; do
	case "$event" in
		goingToScreenSaver*)
			do_program;;
		readyToSuspend*)
			run_program;
	esac
done;
program script
Code:
#!/bin/sh

do()
{
	# set picture using fbink or eips
}

run()
{
	do
	# set to your delay between picture changes
	DELTA=$(( `date +%s` + 300 ))
	lipc-set-prop -i  com.lab126.powerd rtcWakeup $DELTA
}

# Main
case "${1}" in
	"run" )
		${1}
	;;
	"do" )
		${1}
	;;
	* )
		run
	;;
esac

return 0
yparitcher is offline   Reply With Quote
Old 02-19-2019, 11:49 PM   #3
Sol Arkite
Connoisseur
Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.
 
Posts: 61
Karma: 20000
Join Date: Oct 2015
Device: KV; PW2 ; k5; KT2
I noticed someone put together a project that reminded me of yours.
https://www.instructables.com/id/Lit...From-E-reader/
Sol Arkite is offline   Reply With Quote
Old 02-20-2019, 05:22 PM   #4
c0c01
Junior Member
c0c01 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2019
Device: K4NT
yparitcher thanks so much for taking the time to explain and write both of those scripts!!!

I will try to get this working at the weekend when i have more time (as i will no doubt hit other problems). If i can get this working i owe you at least a beer.

Sol Arkite that Instructable was what had originally inspired me
c0c01 is offline   Reply With Quote
Old 02-20-2019, 05:46 PM   #5
Sol Arkite
Connoisseur
Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.Sol Arkite can self-interpret dreams as they happen.
 
Posts: 61
Karma: 20000
Join Date: Oct 2015
Device: KV; PW2 ; k5; KT2

Quote:
Originally Posted by c0c01 View Post
Sol Arkite[/B] that Instructable was what had originally inspired me
Sol Arkite is offline   Reply With Quote
Old 05-19-2019, 07:05 AM   #6
c0c01
Junior Member
c0c01 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2019
Device: K4NT
I'm afraid i will have to give up and admit defeat on this one!!!

Thanks for the help anyway.
c0c01 is offline   Reply With Quote
Reply

Tags
k4nt, picture frame, power button, rtc, screensaver hack

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura Frame covering the screen Jellby Kobo Reader 16 06-23-2014 09:55 PM
Cheap ereader to use as picture frame gonzule Which one should I buy? 6 11-03-2012 06:57 PM
Hacking an LCD picture Frame? Appeal esecallum Which one should I buy? 44 10-30-2009 06:16 AM
10.2 Inch Picture Frame and eBook Reader $79.99 Brainphart Deals and Resources (No Self-Promotion or Affiliate Links) 0 07-16-2009 11:10 AM
RJ Tech Digital Picture Frame w/ Ebook Reader simonp Alternative Devices 7 12-16-2008 03:05 PM


All times are GMT -4. The time now is 04:52 AM.


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