• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Esp8266 web upload speed and memory

dr pepper

Well-Known Member
Most Helpful Member
I have a esp8266 operatimg as a webserver.
The esp also is a datalogger, and uses 32k of the heap for that purpose.
One of the files served, a javascript file is 225kb, this slows down the page load speed to around 10 seconds.
The esp is sposed to be very quick at serving from spiffs, megabits per second.
Would I be correct assuming my system is slow because I've cleared off with a big chunk of its memory for other parts of the program, or should I start looking into whats making it so slow.
I can live with 10 seconds to open a page if thats the best it'll do, I guess the next stage would be to use a sd card.
 

BobW

Active Member
225k isn't all that big as far as downloads go, but it seems like a lot of Javascript to me. Is this actual Javascript code? What's does it do?
 

Pommie

Well-Known Member
Most Helpful Member
A word of warning about spiffs. My ESP based server worked fine when first used. It appends a data file on spiffs every 5 minutes which equates to ~3000 writes a month. Gradually, over three months it started to fail on a regular basis. The html file (12k) would always load at first and now fails 99% of the time. The data file (150k) always fails now. Even when I used (never failed at first) FTP it failed 90% of the time. When the FTP managed to download there were obvious errors in the file.

I think I've worn out the flash. Upon further reading I found This Page and noticed in the limitations part "For now, it does not detect or handle bad blocks. " Out of curiosity I tried the code on a new ESP board and the reliability returned.

I'm currently switching over to an SD card and may also try LittleFS.

Mike.
BTW, the 12k html file contains all the javescript to generate all the charts that are shown in This Thread. So, I too think 225k is excessive.
 

dr pepper

Well-Known Member
Most Helpful Member
Its a lib for canvas gauges on one page the Esp serves, and about 9k for google charts on another, but that directs the browser to download it from google anyway.
The reason I'd ike the Esp to serve the 225k gauge file is that I cant find a server online that will serve the file without the pc's at work disallowng it.

I looked at the memory map for the Esp, seems there is 16k of dram, I have to assume the arduino Ide is using some flash as well, as my memeory allocation is higher than 16k.
There is flash within the Esp, but the memory map implies that its only program memory.
So does my datalogger code use the spi flash?, sounds like it, and that would also explain the slow page opening.
I dont actually use the instruction 'spiffs' to save data, I just declare an array and fill it up till it reaches my defined max, the Ide might be using the flash though.
Seems I dont understand the Esp that well.

As I understand it you can read the flash as much as you like, its just writing that wears it out, that being the case I can serve my page fine, but maybe not datalogging.
 

EE World Online Articles

Loading

 
Top