Hi,
I'm working on a web server that pulls a simple html page off the SD card, about 50 lines.
It takes 1 minute - 12 seconds to load! Is that normal?
code below
webFile = SD.open("index.htm"); // open web page file
if (webFile) {
while(webFile.available()) {
client.write(webFile.read()); // send web page to client
}
webFile.close();
}
Oh, well, the code doesn't work. It resets the app/web server for some reason instead of loading the index.htm.
When I'm done, I guess I'll just put the html file on the arduino itself. I still have plenty of space on the mega.
SurferTim:
Here is what I use. tBuf is a 64 byte array. This gives you a 4x improvement in speed.
You will find the wifi shield transfer rate is much more sluggish than the ethernet shield. The wifi shield also has some nasty one to two second delays every few seconds during a large download. It is one of a few bugs in the shield's firmware.
Are you saying it restarts the Arduino again? Is it running the setup function when using that code? That could be caused by a SRAM problem. The extra 64 bytes used by that array may be enough to overflow the SRAM.
SurferTim:
Are you saying it restarts the Arduino again? Is it running the setup function when using that code? That could be caused by a SRAM problem. The extra 64 bytes used by that array may be enough to overflow the SRAM.
Yup, the Void Setup is called again. I have Serial prints that tells me. I suspected it's a memory issue but I have plenty left on the board like 5200 bytes.
It does make little sense why it's not working properly. I think it is the clone the could be the issue.
There's no reason to post hundreds line of code.
I agree with liudr. It is a circuit board clone, not a processor clone, at least I would hope so. You could be using more SRAM in your code than necessary with static strings, large arrays, etc.
If it is the fact you are running out of SRAM and you don't fix that, you will be running out again soon if you add anything to your code that uses SRAM.