-->
Page 2 of 10

Re: ESP8266WebServer to send larger amounts of data

PostPosted: Mon Apr 20, 2015 10:35 am
by martinayotte
I saw this latency is with any WifiClient.print(), println() or write().
So, personally, I'm concatenating as much as I can into a single String object, and then send the whole thing using client.print(str) ...

Re: ESP8266WebServer to send larger amounts of data

PostPosted: Tue Apr 21, 2015 6:08 am
by draco
Patriko wrote:Any idea how to send long data without dividing it into smaller pices, like about 1200 bytes?


1200 bytes should work with the standard client.write() or client.print() calls with no trickery required.

Re: ESP8266WebServer to send larger amounts of data

PostPosted: Tue Apr 21, 2015 6:12 am
by draco
martinayotte wrote:I saw this latency is with any WifiClient.print(), println() or write().
So, personally, I'm concatenating as much as I can into a single String object, and then send the whole thing using client.print(str) ...



Yes. In fact, according to some further tests I did, it appears to be TWICE as bad with .println(); my tests show a 125ms latency with .print() and .write(), but a 250ms latency with .println().

So, it's TWICE as fast to do client.print(myString + "\n") as it is to do client.println(myString). Yuck!
I haven't looked into the code, but I imagine that .println() is simply calling a .print() on the original input string, then a second .print("\n").

Re: ESP8266WebServer to send larger amounts of data

PostPosted: Tue Apr 21, 2015 8:44 am
by martinayotte
Indeed, Yurk !
I've seen this ugly latency in IPAddress.printTo() where it needs 7 print() to send IP address string. (it takes more than 1 sec)
I decided to add a IPAddress.toCharArray() function and send the whole thing in a single print().
I hope we get a fix soon for this latency ... :?