Problem with http server on Esp8266 with response of about 25kByte


Hi all,

AS a http Server, I like to send a (quite long) response back to a http Client by reading it from a file in the spiffs block by block (blocksize is 2048) and sending it towards the client (using ‘mg_send’)
Sometimes it works fine and sometimes is seems to lose some data.
Checking the resulting html-Page in the Browser, I can see missing Code at the end or in the middle.
Is it possible to be too fast sending the blocks, so that data is lost?
If so, is there a possibility to wait for the sender to finish?

Thanks a Lot!


I seem to remember some post somewhere from one of the developers… did you try using the RPC interface instead ?
Anyway, searching for ‘mg_send’ in this forum returns interesting results (and it’s free!):


Thanks a lot for your input, Scaprile.

If I do not close the connection after sending a block of data, I would expect to get a MG_EV_SEND.
But there is none! Do I have to register MG_EV_SEND separately?
I register using ‘mgos_register_http_endpoint’ only. Does this not register the MG_EV_SEND, too?