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 07-07-2018, 12:41 PM   #1
aleq
Enthusiast
aleq began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2012
Location: CZ, EU
Device: K4NT (4.0.1), KT (5.3.7.3), KPW1 (sold), KPW2
WebLaunch fullscreen browser crash after few hours

Hi,
this may be hard to crack, I wonder if anyone has any advice. I was planning to use Kindle Touch as Smart Home control panel. Just a local HTML page doing regular HTTP (REST) calls and displaying results. My test page runs JavaScript code every second, doing screen updates (and calling JQuery ajax method every 30 seconds). It crashes after several hours of flawless operation (ie. overnight) - you can see the error message in the attachment. The calls are to localhost, to my tiny python sever which forwards the call to Smart home (mainly handles the HTTP authentication, which doesn't work reliably from WAF (for some reason, it sometimes displays a popup asking for a login and password although I have filled that in JavaScript)).

The crash happened to me twice already (I haven't been testing it for longer, so it seems it does crash always, eventually). I have been monitoring free memory via SSH, seems not to drop down significantly, at least not in the first several hours.

This basically destroys my plan to use it as a permanent Smart Home control panel on the wall.

Any advice, tip?

I was thinking of workaround - in the Python script I could trigger an action if no request came in for certain amount of time. Is there a way to start KUAL extension (WebLaunch) from a command line? This way I could restart WebLaunch as soon as it crashes.

I liked the idea of developing it in HTML since it's very flexible and rather easy, compared to let's say custom Python PyGTK app.
Attached Thumbnails
Click image for larger version

Name:	kindle-error.PNG
Views:	481
Size:	953.0 KB
ID:	164922  
aleq is offline   Reply With Quote
Old 07-07-2018, 01:47 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,494
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
The system enforces specific memory limits per service, so you may want to check the logs if it's not simply pmond having killed it out of spite .

But that's just for science, that won't really help you if memory usage keeps growing for real (you can tweak pmond's quotas [it's not fun, but you can], but if there's a leak, the OOM killer will eventually take care of it, so, not a solution).

Since KUAL is a launcher, you can of course launch a specific action/params pair yourself, just look at the json of the specific extension you're using.

Last edited by NiLuJe; 07-07-2018 at 01:49 PM.
NiLuJe is offline   Reply With Quote
Old 07-07-2018, 04:40 PM   #3
aleq
Enthusiast
aleq began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2012
Location: CZ, EU
Device: K4NT (4.0.1), KT (5.3.7.3), KPW1 (sold), KPW2
Thank you, NiLuJe!
Geez, that was easy, there was a shell command in the JSON indeed. For some reason I was worried the framework is completely separated from linux (like Android). Cool. So in the worst case, there may be a chance to restart the application when it crashes. Some "flickering", but still better than nothing.

I haven't found any suitable log (/var/log/*) so I might need to investigate here more. For the time being, the rough test - I have stopped pmond and restarted the extension. And added periodic reloads to that page. Let's see tomorrow, if it survives.

If there is memory leak, then it's the WAF itself :-/ WebLaunch doesn't seem to do much, just launches mesquite, does some tweaking and then loads an URL. There goes my HTML with jQuery. So I wonder is it likely that there is a memory leak in there? It's used everywhere else, isn't it?
Plus, I have monitored the memory using "free" command in the console. It drop
aleq is offline   Reply With Quote
Old 07-07-2018, 05:45 PM   #4
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,494
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
showlog -f is your new friend
NiLuJe is offline   Reply With Quote
Old 07-10-2018, 09:41 AM   #5
lucasmpr
Enthusiast
lucasmpr began at the beginning.
 
Posts: 45
Karma: 10
Join Date: Jul 2017
Device: Kindle
Quote:
Originally Posted by aleq View Post
Is there a way to start KUAL extension (WebLaunch) from a command line?

lipc-set-prop com.lab126.appmgrd stop app://com.PaulFreund.WebLaunch

and

lipc-set-prop com.lab126.appmgrd start app://com.PaulFreund.WebLaunch


This way you can restart the application. If you wish. You can even use once a day in a cron script or make your server do the call via ssh. It's very easy and may be a nice workaround.

I don't know wich version you're using. I have some troubles with my weblaunch version sometimes. But it never crashes like that. The javascript just seem not to work anymore.
lucasmpr is offline   Reply With Quote
Old 07-10-2018, 01:46 PM   #6
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 lucasmpr View Post
- - - -
You can even use once a day in a cron script
- - - -
Rethink that bit of advice.
"cron" is a computer utility, it requires an running CPU, only that when a Kindle goes to sleep, the CPU is not running.
knc1 is offline   Reply With Quote
Old 07-10-2018, 04:23 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,494
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yeah, that sort of advice only works for full conversion projects that happens to be stationary and always connected to a power source .

Otherwise, cron is a no go .
NiLuJe is offline   Reply With Quote
Old 07-10-2018, 10:28 PM   #8
lucasmpr
Enthusiast
lucasmpr began at the beginning.
 
Posts: 45
Karma: 10
Join Date: Jul 2017
Device: Kindle
Quote:
Originally Posted by knc1 View Post
Rethink that bit of advice.
"cron" is a computer utility, it requires an running CPU, only that when a Kindle goes to sleep, the CPU is not running.
My kindles never go to sleep. They are full time on and powered. But whatever you like.

I didn't mind to ask if it was the case. It was a workaround anyway. A Fairly easy one to do. I didn't think too much.

Peace
lucasmpr is offline   Reply With Quote
Old 07-26-2018, 06:43 AM   #9
aleq
Enthusiast
aleq began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2012
Location: CZ, EU
Device: K4NT (4.0.1), KT (5.3.7.3), KPW1 (sold), KPW2
The same for me, it's going to be a total conversion, perhaps even on the wall somewhere. Permanently on AC, never going to sleep.

I'm still investigating what's going on with that Application error (noticed NiLuJe's showlog -f just now, so I'm going to continue). It's happening even in the Experimental Browser. As soon as there are periodic XmlHttpRequest calls, it crashes eventually. Without XmlHttpRequest (but still refreshing the HTML page using JavaScript), it's stable.

Cron and midnight restarts may not be sufficient, I have the feeling it crashes relatively randomly. Sometimes more often then just once in 24 hours. In the worst case I could restart the app more then just once a day, but then it may not be that pleasing to see flickering screen on the wall during the day.

I'll keep this topic updated as soon as I find out more or which workaround I took.

Thanks all,
Aleq
aleq is offline   Reply With Quote
Old 07-28-2018, 12:42 AM   #10
lucasmpr
Enthusiast
lucasmpr began at the beginning.
 
Posts: 45
Karma: 10
Join Date: Jul 2017
Device: Kindle
Well.

I tried a bit of stress testing.

Code:
<html>
<script src="http://console.re/connector.js" data-channel="projeto-abcdefgh" id="consolerescript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>

var a = 0


setInterval(lucLoader, 100);

function lucLoader () {
$.get( "[SOMEWEBSITE you're not afraid to spam] ", function( data ) {
  $( "#luc" ).html( a++ );
  if(a > 1000) { $( "#luc" ).html( data ); }
});
}

</script>


<div id="luc">
</div>
</html>

I didn't manage to crash my experimental browser in 20 minutes of testing.
lucasmpr is offline   Reply With Quote
Old 07-29-2018, 01:13 PM   #11
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,007
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by lucasmpr View Post
lipc-set-prop com.lab126.appmgrd stop app://com.PaulFreund.WebLaunch

and

lipc-set-prop com.lab126.appmgrd start app://com.PaulFreund.WebLaunch


This way you can restart the application. If you wish. You can even use once a day in a cron script or make your server do the call via ssh. It's very easy and may be a nice workaround.

...

Quote:
Originally Posted by knc1 View Post
Rethink that bit of advice.
"cron" is a computer utility, it requires an running CPU, only that when a Kindle goes to sleep, the CPU is not running.
Quote:
Originally Posted by NiLuJe View Post
Yeah, that sort of advice only works for full conversion projects that happens to be stationary and always connected to a power source .

Otherwise, cron is a no go .


Perhaps the situation might be helped in combination with something like this?
PoP is offline   Reply With Quote
Old 07-29-2018, 01:15 PM   #12
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,494
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yep, although I'm not sure if anyone ever tried anything rtc related on a >= K5
NiLuJe is offline   Reply With Quote
Reply

Tags
commandline, crash, kual, weblaunch

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WebLaunch - Fullscreen browser for web-applications PaulFreund Kindle Developer's Corner 130 01-07-2023 01:39 PM
Is GTK lighter on battery than WebLaunch or similar? aditya3098 Kindle Developer's Corner 4 12-19-2014 04:45 AM
looking to buy jail-broken Kindle PW running fullscreen web browser spaceyam Kindle Developer's Corner 3 04-14-2013 08:45 AM
Kindle 2 Browser Always Crash and Cause Reboot kurlez Amazon Kindle 0 03-18-2011 02:22 AM
FullScreen on Kindle Browser SunLight Amazon Kindle 7 10-11-2010 04:30 PM


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


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