Webserver page load fails, except if a breakpoint is set

Technical questions regarding the XTC tools and programming with XMOS.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Webserver page load fails, except if a breakpoint is set

Post by DemoniacMilk »

I have created a website using multiple files (html, css, js, images) to be used with the xmos webserver library.

When accessing the webserver through a browser using the devices IP address, the html and js files are always loaded properly.
webserver_loadFail.PNG
The css file however does not load properly. There is a small chance for the file to be loaded successfully(1 out of 25 times) and it seems to load well whenever the CSS file is requested AFTER the html file finished loading.

When setting a breakpoint in one of the webpage functions, everything is loaded just fine (but loading takes a couple seconds). I assume the first request for the CSS file ist not handled, as the xcore is suspended after hitting the breakpoint, so one of the request-retransmits will trigger the CSS file to be loaded (after the html has finished loading).
webserver_loadSuccessBreakPoint.PNG
Is this known behaviour?

edit: i removed the css file link from my html file. The js file is the second file to be loaded now and shows similar behaviour as the css file did before.
If i randomly add/remove files (that exist or do not exist), it is always the second file (first file to be loaded after the html) that does not load properly.
You do not have the required permissions to view the files attached to this post.
User avatar
Thomas
Experienced Member
Posts: 66
Joined: Fri Feb 05, 2010 12:34 pm

Post by Thomas »

Please check that you are using the latest released version of lib_xtcp and lib_webserver.

Both libraries are public repos now so you can check the commits that have happened since the latest releases on xmos.com
https://github.com/xmos/lib_xtcp
https://github.com/xmos/lib_webserver

Expecially lib_xtcp has seen a lot of updates so I think it is worth a try.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Will do, thank you!
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

The Versions on Git are 2.0.1 (webserver) and 4.0.3 (tcp).

Im using 2.0.1 and 4.0.2 at the moment, with the only update being "Update to support enabling link status notifications", so I dont think this will change anything.

I will give it a shot anyways and try what you suggested in this thread with clean versions of the libraries.
User avatar
Thomas
Experienced Member
Posts: 66
Joined: Fri Feb 05, 2010 12:34 pm

Post by Thomas »

The latest tag of lib_tcp is actually 5.1.0alpha1.
There have been 134 commits since the released version 4.0.2rc1:
https://github.com/xmos/lib_xtcp/tree/v5.1.0alpha1
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Ou wow! Never used git, so I just saw version 4.0.3 and the changelog.

I switched to a clean library, version 4.0.3 and it works like a charm, so its all good now, thank you!