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 01-14-2014, 08:51 AM   #1
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
My k3 drives me crazy.

Dear All,

I spent lot of time to read many posts regarding jailbreak , dev etc.
Some time ago I aplied JB , Kual and had some fun to see it working.

Last time I wanted to make Kindle Weather Display hack, to have nice weather info always when not using it to read.

Linux server part is done - and now I tried to install script to see effects on k3.

And here bad story begins. I can not tell you now what I really did, but the effect now is that device does not want to start KUAL due to missing keys.
Keys installation trial is always failure.

I have no idea if I still have JB isntalled, because I did factory reset. (due to forum info - JB should be there)

So on fact factory reset did not changed anything.

Then my logic was - let's do deeper "reset" - use kubrick to flash my K3

Now after few hours - i am suprised - because the device seems not be touched by flashing procedure. Everything stays the same, kite as was intalles - it's there , Kual as was - it's there (not working)
Keys are not aplicable - as it was...

MORE strange (for me... ) was that after Kubrick flashing , i see some ebooks (they were deleted during factory reset! ) ....

Now I don't know what to do...

All I want to do is to start playing with Kual - to have possibility to easy start and stop Weather display script...

Please help... Kind regads from Poland - pacraf
pacraf is offline   Reply With Quote
Old 01-14-2014, 01:43 PM   #2
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The factory reset killed the JB. (The is a K3, the JB behaves in a different way than on most newer devices, the 'survives a factory reset' thing, while true for newer devices, isn't applicable here).

Restart the device, and install the JB again.
NiLuJe is offline   Reply With Quote
Advert
Old 01-14-2014, 02:21 PM   #3
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
Thank you for answer. I was afraid of applying JB on my device again - especially after reading somewhere that JB survives FactoryReset.
Now I installed JB - and installation is succesfull. Keys are installed succesfully too.

But could you explain this strange behaviour after Kubrick flashing procedure?
Is it as I described:
- device was registered on my name as before flashing
- Kite survived ,
AND this what suprised me most - some books appeared on device (they were deleted with FactoryReset just day before Kubrick flashing)

I expected that flashing will restore the device as COMPLETELY CLEAN (maybe with JB installed - according to description in forum)

Once again - thank you for awesome work.
Kindest regards.
pacraf is offline   Reply With Quote
Old 01-14-2014, 04:06 PM   #4
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
I have a new observation. Like I said before - everything worked (JB , keys , Kual ).
I was offline, and now I see that after first connection to intenet via WiFi (first after reset and reinstall of JB etc) just after connection (no registration) i recived email from amazon that my keys are no longer valid... what I am doing wrong?

Last edited by pacraf; 01-14-2014 at 04:11 PM.
pacraf is offline   Reply With Quote
Old 01-14-2014, 05:57 PM   #5
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@pacraf: The deregistration process kills the developer keys, and triggers this mail.

As far as Kubrick is concerned, no idea, sorry.
NiLuJe is offline   Reply With Quote
Advert
Old 01-15-2014, 04:56 AM   #6
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
Again did FactoryReset.
This time not started woth JB installation , but first connected to WiFi , registered in amazon account, then after some minutes to give the device to sync with account - started to install JB , keys, KUAL.

And hallelujah! - no bad email, already one hour installed and works.

Now I started to think on Weather Script addon to KUAL.

My linux knowledge is more than poor, but like saind on begining - server side works nice.

I would like to have this Weather screen to be isntalled in a way that can be easy switched off (no need of device restart).

I tried to take example addon (choice was on battery reporter).

what was changed:
config.xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<extension>
    <information>
        <name>Helper</name>
        <version>1.0</version>
        <author>Twobob</author>
        <id>Weather</id>
    </information>
    <menus>
        <menu type="json" dynamic="true">menu.json</menu>
    </menus>
</extension>
file menu.json

Code:
{
    "items": [
        {
        "name": "Helper",
        "priority": 0,
        "items": [
            {"name": "Weather", "priority": 1, "action": "bin/weather.sh"}
        ]
        }
    ]
}

and file weather.sh in folder /bin
(intentionally left server addres of script author, because this one is available on internet - my only on intranet - so this one is better to discuss here...)
Code:
#!/bin/sh
killall -STOP cvm;
killall -STOP powerd;
cd "$(dirname "$0")"
rm .weather-script-output.png
eips -c
if wget http://docs.volcanis.me/weather-script-output.png -O .weather-script-output.png; then
	eips -g .weather-script-output.png
else
	eips -g .weather-image-error.png
fi;
waitforkey;
killall -CONT cvm;
killall -CONT powerd;
# Go Home
echo "send 101" > /proc/keypad
above works. I mean works once is run - then never updates, of course becasue
this script is intended to be started by cron. (because started from KUAL once is displaying weather picture, but no update loop)

I saw another solution on this forum (I only replaced server address to this one available on internet):

weather.sh


Code:
#!/bin/sh

if [ `lipc-get-prop com.lab126.wifid cmState` != "CONNECTED" ]; then
	exit 0
fi

stop pillow
sleep 1

URL=http://docs.volcanis.me/weather-script-output.png
FILE=${URL##*/}

fetch () {
	while :
	do
		sleep 60
		if wget $URL 1>/dev/null 2>/dev/null; then
			eips -g $FILE
			rm $FILE
		fi;
	done
}

cd /var/tmp

if wget $URL 1>/dev/null 2>/dev/null; then
	eips -g $FILE
	sleep 1
	eips -g $FILE # just in case Kindle Launcher is repainted
	rm $FILE

	fetch &
	pid=$!
	waitforkey;
	kill -9 $pid
else
	eips -g /mnt/us/extensions/apiweather/weather-image-error.png
fi;

start pillow
Unfortunatelly this script does nothing on my kindle. (leaving from KUAL to main Home screen)

Any suggestion...

Author of this script added connection checker - no doubts I am connected...

Last edited by pacraf; 01-16-2014 at 02:45 AM.
pacraf is offline   Reply With Quote
Old 01-15-2014, 07:26 PM   #7
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Please use CODE blocks to avoid the forum software mangling your code .

And, yes, the second example depends in parts on FW 5.x features, so it's not terribly surprising that it doesn't behave on your device.
OTOH, a cron job would indeed be the most painless & cleanest solution.

Barring that, a crappy for-ever loop in a shell script (you should be able to rip parts of the second example for that).

Last edited by NiLuJe; 01-15-2014 at 07:29 PM.
NiLuJe is offline   Reply With Quote
Old 01-16-2014, 03:00 AM   #8
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
Now code blocks looks much better ...
so second script is not for me. that's clear too...

I will go the cron job way, but...
I have some doubts before I will touch my k3 cron job list...
My poor experience says that if I will modify cron job list - then all these tasks will be processed all the time (according to programmed schedule , so for example every 30 minutes. So, after that every 30 minutes of reading (or whatever) , the screen will be took over by weather script... and cron is started with system boot - so no chance to switch it off (without change of cron job list)...

so if I put in cron a starter for script - how to stop it (and start after lets say a day of normal reading on device) ?

cron job line example :
Code:
*/30 * * * * /mnt/us/weather/weather.sh


****edit *****

after some googling I found another example of weather scripts, but this example has two files, but it looks like similar functionality as first script.

weather.sh

Code:
#!/bin/sh

cd "$(dirname "$0")"

rm weather-script-output.png
eips -c
eips -c

if wget http://server/path/to/weather-script-output.png; then
        eips -g weather-script-output.png
else
        eips -g weather-image-error.png
fi
init-weather.sh

Code:
#!/bin/sh

/etc/init.d/framework stop
/etc/init.d/powerd stop
/mnt/us/weather/weather.sh

So in few words - how to switch it ON/OFF after it will be in cron job list...

Last edited by pacraf; 01-16-2014 at 03:19 AM.
pacraf is offline   Reply With Quote
Old 01-16-2014, 01:27 PM   #9
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The framework & powerd stop is fairly useless in your situation, and actually counter productive if you want a togglable solution to keep the device usable.

I'd go with either tweaking the cronjob programmatically, which isn't necessarily pretty or sane; or a for-ever loop in a background process that you just start/stop as needed.
NiLuJe is offline   Reply With Quote
Old 01-16-2014, 03:16 PM   #10
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
I never wrote a line of script...

but maybe something like this
Code:
#!/bin/sh
killall -STOP cvm;
killall -STOP powerd;
while :
do
cd "$(dirname "$0")"
rm .weather-script-output.png
eips -c
if wget http://docs.volcanis.me/weather-script-output.png -O .weather-script-output.png; then
	eips -g .weather-script-output.png
else
	eips -g .weather-image-error.png
fi;
sleep 600
done
#we will never reach this point right?
#killall -CONT cvm;
#killall -CONT powerd;
# Go Home
#echo "send 101" > /proc/keypad
so when script will be started - only device reboot will stop it, right?
Will it work - don't want to make my kindle fubar...

Show mercy and write good script... please.
pacraf is offline   Reply With Quote
Old 01-16-2014, 04:55 PM   #11
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,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Again, if you want to keep your device usable, do not touch powerd and/or the framework.

Apart from that, the loop itself looks sane enough. Just kill the process to stop it (if you didn't stop the framework, that is). (You can do it the ugly way, or do it neatly and create/check a pidfile, through whichever means you prefer [doing it manually, or using start-stop-daemon]).

Might I suggest trying your hand at basic shell stuff on a safer playground than a live, in production semi-closed device like the Kindle? (And learning a bit more about your target device/system without blindly trying stuff?).

As for the last question: nope, we're not here to write stuff for you. In fact, we're pretty much completely against it. Helping people figuring out stuff, sure. Making stuff for fun/personal reasons, yup. Pointing people in the right direction, hell yeah. But just straight-up spoon-feeding? MEEP.

Last edited by NiLuJe; 01-16-2014 at 05:00 PM.
NiLuJe is offline   Reply With Quote
Old 01-17-2014, 02:48 AM   #12
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
OK, the weather thing was additional topic I would say.
Primary problem was with keys , JB etc. and it's OK now.
So thanks for your input.

Regarding your "spoon" statement - I understand.
Nevertheless I give up - I am barely able to reproduce hacks prepared by others, so will not cheat myself that I will do my own one, finnaly I do not want to kill my k3 - I'ts my lifesaver during hospital long nights...

So once again - THANKS!

Last edited by pacraf; 01-17-2014 at 03:31 AM.
pacraf is offline   Reply With Quote
Old 01-17-2014, 09:18 AM   #13
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by pacraf View Post
Regarding your "spoon" statement - I understand.
Nevertheless I give up - I am barely able to reproduce hacks prepared by others, so will not cheat myself that I will do my own one, finnaly I do not want to kill my k3 - I'ts my lifesaver during hospital long nights...

So once again - THANKS!
On the subject of the weather display -
As I understand it.....

You want a weather display updated at regular intervals **When not reading a book**
and
The usual e-book reader behavior **When you are reading a book**.

Perhaps with a manual control of some sort that tells the system "I am done reading for now".
(Rather than just taking a long time to read the current page.)

Hmm...
That might be doable - but it **will not** be a "beginner's script" by a long shot.

Think about it this way and see where it leads -

Perhaps set up the Kindle screen saver to display the most recent weather report image it rather than the cover of the current book -

Now when the Kindle times out (or you tell it "go to screen saver") - the most recent weather report image is displayed.
Great - until the time comes to update the image with the next report.

Ah, what does the Kindle do while the screen saver is being displayed?
Ans: It shuts down.
I.E: No computer running, no computing of the next weather report.

The Kindle system just isn't implemented to support that kind of activity.
It's **ON** when your reading a book - It's **OFF** when you are not.

At this point - your alternate weather display project runs into some really complex issues to solve.

Perhaps the way forward from this point would be to examine how the SO units do their "get next ad." process.
(The Kindle can awake from sleep to **try** to get the next advertisement.)

Still - that doesn't make your project any less complex.

- - - -

I hope that helps you find someone to give you a hand.
knc1 is offline   Reply With Quote
Old 01-17-2014, 11:35 AM   #14
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
I will phrase my expectation of "perfect pacraf weather" script:
-be able to start is from KUAL by button
- periodically try to get new weather picture from server
-be able to shut it down easy - maybe another button script from KUAL (if a keypress is not aplicable)

Power saving is not issue , because if Kindle is not used to read books at work (as I said hospital 24h service can be boring if nothing happens) , then comes 2 days of home pause - it's time when kindle spends it's time on charging station - and could be usefull as very fancy weather displayer.)

so maybe a forever loop script , but with some exit mechanism (not necesarily by device reset) maybe a keypress event... but how to do it (and not kill my k3)
pacraf is offline   Reply With Quote
Old 01-18-2014, 08:13 AM   #15
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by pacraf View Post
Power saving is not issue , because if Kindle is not used to read books at work (as I said hospital 24h service can be boring if nothing happens) , then comes 2 days of home pause - it's time when kindle spends it's time on charging station - and could be usefull as very fancy weather displayer.)
I do not think you can get 24 hours of run-time on a single charge of the battery.

The actual run-time on a single charge varies a wide amount, but in general, I think about 10 hours.

Note: Our "development Kindles" - which are "ON" (cpu running) for days at a time are also always on a USB cable - running on the external USB power.

So plan on carrying an external battery pack / re-charger for your K-3.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 my prs-650 drives me crazy bernardpar Sony Reader 15 10-14-2011 06:50 PM
Kindle free book: She Drives Me Crazy: Three Favorite Essays greencat Deals and Resources (No Self-Promotion or Affiliate Links) 0 05-28-2011 05:34 AM
Free (Kindle) Crazy Sexy Cancer Tips (Crazy Sexy) arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 1 01-21-2011 01:15 PM
iliad drives me crazy with Chinese pdf documents logit iRex 6 07-18-2008 07:36 PM
PDF drives me crazy! Ektoplasma Workshop 3 06-17-2008 09:04 PM


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


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