Connection resent when sending large files?
Posted: Mon May 30, 2016 1:10 am
Posting in both General Discussion and ESP8266 Arduino->General Discussion for exposure
All my code can be found at https://www.dropbox.com/sh/neu1nk9hfg0pd64/AABGROLkb7dTM54115x45aK1a?dl=0
I'm currently working on an ESP webserver platform that can serve large mostly-static webpages saved to the ESP's flash memory at compile time. I've been working with the FLASH library and conversion script setup discussed here:http://www.esp8266.com/viewtopic.php?f=32&t=3780
The code I linked in the beginning (with the edited ESP8266WebServer library) works fine for small webpages (the one's I've tested are all under 5kb in size). Then I moved to a larger webpage (the one that is currently in the server/website folder) all my code compiles correctly, however when I try to serve a page that large, while the ESP is sending its response the connection is reset, presumably due to the large size since it did not occur with smaller pages. I figured that this was perahaps due to the fact that the client.write() line within the loadFromFlash() method is limited by the HTTP_DOWNLOAD_UNIT_SIZE buffer length, but all other methods of sending the data such as server.sendContent_P() and server.send() have only given me corrupted data on the clientside.
Any suggestions for improving this code would be greatly appreciated! Thanks in advance.
All my code can be found at https://www.dropbox.com/sh/neu1nk9hfg0pd64/AABGROLkb7dTM54115x45aK1a?dl=0
I'm currently working on an ESP webserver platform that can serve large mostly-static webpages saved to the ESP's flash memory at compile time. I've been working with the FLASH library and conversion script setup discussed here:http://www.esp8266.com/viewtopic.php?f=32&t=3780
The code I linked in the beginning (with the edited ESP8266WebServer library) works fine for small webpages (the one's I've tested are all under 5kb in size). Then I moved to a larger webpage (the one that is currently in the server/website folder) all my code compiles correctly, however when I try to serve a page that large, while the ESP is sending its response the connection is reset, presumably due to the large size since it did not occur with smaller pages. I figured that this was perahaps due to the fact that the client.write() line within the loadFromFlash() method is limited by the HTTP_DOWNLOAD_UNIT_SIZE buffer length, but all other methods of sending the data such as server.sendContent_P() and server.send() have only given me corrupted data on the clientside.
Any suggestions for improving this code would be greatly appreciated! Thanks in advance.