jscalls taking too long

Recurrent H/W and software problems
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: jscalls taking too long

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Apr 22, 2024 7:52 am 1.52.7 seems to have reduced the jscall time. Highest recently was 127mS. I just started a 48 hour test to see if my restart problem is solved. I tried to understand the page source but not a chance!

Interestingly, when accessing the system from Firefox and Chrome on the same laptop the config 'menu bar disabled' is obeyed, but accessing at the same time from Firefox on Android, it isn't and I get a menu bar.
Good to know, I'll check why this happens.
Thanks.
Stuart
Posts: 138
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

Re: jscalls taking too long

Post by Stuart »

My test has now been running for 66 hours. There were two unexpected restarts, but both for known causes: a) one when I ran ZAP on the annex url to satisfy curiosity about web sockets. I had expected that to be non destructive, but it wasn't, and I didn't learn much either; b) when I opened a browser on another device (android) - not repeatable. Neither was reported by my error code, it just restarted with no declared reason. Presumably something that websockets didn't like. Good if that could be trapped. The max jscall duration was 549mS and that was reached in the first few hours. The duration is not a practical problem, though the restarts could be. I don't know what 1.52.7 really does, but it seems to do something.
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: jscalls taking too long

Post by cicciocb »

Interesting Stuart, if ZAP caused a crash of the module maybe I could use it to identify the issue. The problem is very probably inside the very powerful asyncwebserver library that, unfortunately, is not really supported
Stuart
Posts: 138
Joined: Fri Feb 19, 2021 7:46 pm
Has thanked: 5 times
Been thanked: 20 times

Re: jscalls taking too long

Post by Stuart »

I could not make much sense of ZAP as it is a new subject for me, but it certainly seemed to get to the heart of the matter.

1.52.7/8/9 seem to have completely fixed the 'random restarts for no apparent reason' problem, which suggests that the new library you upgraded to is helping. I am still getting occasional restarts when accessing a web page from an additional browser. The jscall max time remains around ~500mS, but the average time is very short (18.6mS at the moment) so the long times must be quite rare.

I am wondering if I have the right html for my pages. Given that a lot of html code is generated by Annex even when the menu is turned off, how should I code a page? Currently I program the page as if it is the only source of input to the browser. Are there things that I don't need to/should not/should include? Browsers are very tolerant but maybe there is some effect on Annex.
User avatar
cicciocb
Site Admin
Posts: 2056
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1354 times
Contact:

Re: jscalls taking too long

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 04, 2024 2:32 pm I could not make much sense of ZAP as it is a new subject for me, but it certainly seemed to get to the heart of the matter.

1.52.7/8/9 seem to have completely fixed the 'random restarts for no apparent reason' problem, which suggests that the new library you upgraded to is helping. I am still getting occasional restarts when accessing a web page from an additional browser. The jscall max time remains around ~500mS, but the average time is very short (18.6mS at the moment) so the long times must be quite rare.

I am wondering if I have the right html for my pages. Given that a lot of html code is generated by Annex even when the menu is turned off, how should I code a page? Currently I program the page as if it is the only source of input to the browser. Are there things that I don't need to/should not/should include? Browsers are very tolerant but maybe there is some effect on Annex.
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 04, 2024 2:32 pm I am still getting occasional restarts when accessing a web page from an additional browser.
I found a place where the code crashes with ZAP but I still not identified the real cause and a possible solution.
This is quite complicate as ZAP opens a lot of parallel connections that - could be - the real cause of the crash.
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 04, 2024 2:32 pm I am wondering if I have the right html for my pages. Given that a lot of html code is generated by Annex even when the menu is turned off, how should I code a page? Currently I program the page as if it is the only source of input to the browser. Are there things that I don't need to/should not/should include? Browsers are very tolerant but maybe there is some effect on Annex.
You don't need to include all the "heading stuff" like
<html> <!DOCTYPE html> <head> <body> ...

All of these elements are already included in the 'Output' page generated by annex. Repeating them would only be redundant. Since the page is generated dynamically, certain parts, such as including .js scripts or .css files, will be ignored. To address this, you must utilize the commands JSEXTERNAL and CSSEXTERNAL.

In reality, the output page incorporates HTML, JavaScript, and CSS code that establishes a connection between the page itself and the annex basic interpreter, facilitating the exchange of variables and commands between the two 'worlds.' I've tried to simplify the final user experience to ensure that this process occurs 'magically' in the background."

So, you should just put the items you need without taking care of the other items.

If you have a good understanding of HTML/JavaScript, you can indeed create web pages dynamically by directly writing into one or more HTML files and opening them with a browser.
Alternatively, you could employ a "PHP style" approach to create web pages using the callback of "OnUrlMessage." However, this latter method is probably not suitable for the typical AnnexRDS audience.
Post Reply