-->
Page 1 of 4

WiFi WebServer is too slow, maybe?

PostPosted: Tue Oct 25, 2016 2:02 pm
by ChenBH
Hello,
I'm trying to make a little Smart home project.
The problem is I want to display a 7KB .html file written on SPIFFS (cntrlpnl.htm)and it takes 20sec to load the page.
I moved to using SD card for faster writing and debugging the onboard files.
My project is attached, it may be not so intuitive but I'm just prototyping for the time being.
Is there any way to hurry things up a bit?

Thanks,
Chen

Re: WiFi WebServer is too slow, maybe?

PostPosted: Tue Oct 25, 2016 4:12 pm
by martinayotte
You have maybe a problem elsewhere, because I'm able to push 100KB files into the browser in less than 5 secs.

How to read from SPIFFS and write to WebServer.client ?
(I hope you don't do that byte by byte ... :ugeek: )

EDIT : BTW, this could help viewtopic.php?p=57118#p57118

Re: WiFi WebServer is too slow, maybe?

PostPosted: Thu Oct 27, 2016 2:17 pm
by ChenBH
Great, this worked..
Could you explain to me the benefits of using the server.on() and server.send() over server.available() and client.write()/print()?
I'm using the second option for months now and it does the trick.

Re: WiFi WebServer is too slow, maybe?

PostPosted: Thu Oct 27, 2016 7:43 pm
by martinayotte
I think you're confused between ESP82WiFi and ESP82WebServer :
server.on() and server.send() are coming from ESP82WebServer, which is built on top of ESP82WiFi.