Send big page of HTML

I'm frustrated!

I can serve tiny web pages from my Uno + Ethernet shield... the "latest" one at 7/11, the one with a microSD socket but no version number...

But if I modify my program, asking my little server just to send a longer, bigger, whatever you want to call it, webpage, things go wrong.

I don't know if I am confusing the Arduino Ethernet Library or the W5100 chip at the heart of my Ethernet interfacer.... but SOMETHING becomes unhappy. And it doesn't grace me with good error messages, either. Buffer overflow?

So...

Is there a simple "you can send pages of up to xx characters" limit? What is xx? Is there any way to send a longer page in response to a browser's access of my server?

("My server" explained in detail at ArduServer.com)

Any advice on better error trapping to catch "too long" pages?

Thanks!

Is there a simple "you can send pages of up to xx characters" limit? What is xx? Is there any way to send a longer page in response to a browser's access of my server?

No, there is no simple rule. The literal strings you want to send are stored in SRAM along with a lot of other stuff, including the stack and heap.

As the program executes, the size of the stack and heap change. When you run out of space for the stack or heap to grow, bad things happen.

Exception handling is not really possible with the Arduino architecture, so you must design the code so that exceptions do not occur. Frustrating, yes.

You can store the page to send on the sd card, and read each line from the card, and send it out. Much less SRAM usage that way, but not as fast.

tkbyd:
I'm frustrated!

I can serve tiny web pages from my Uno + Ethernet shield... the "latest" one at 7/11, the one with a microSD socket but no version number...

But if I modify my program, asking my little server just to send a longer, bigger, whatever you want to call it, webpage, things go wrong.

I don't know if I am confusing the Arduino Ethernet Library or the W5100 chip at the heart of my Ethernet interfacer.... but SOMETHING becomes unhappy. And it doesn't grace me with good error messages, either. Buffer overflow?

So...

Is there a simple "you can send pages of up to xx characters" limit? What is xx? Is there any way to send a longer page in response to a browser's access of my server?

("My server" explained in detail at ArduServer.com)

Any advice on better error trapping to catch "too long" pages?

Thanks!

I don't know how W5100 Ethernet implementation works, but probably you need to split the data in a lot of packets. This way, you can send virtually unlimited data, since you will use only a part of the RAM for each packet and only one packet will be treated per time.
W5100 controller implements TCP in hardware, but if do you use ENC28J60, you can do it using software. I'm working on a library that will do it in the future: GitHub - turicas/Ethernet_ENC28J60: [NOT MAINTAINED, NOT COMPLETED] Implementation of an Arduino-compatible socket layer library that uses Microchip ENC28J60 Ethernet controller.

Hi,

just check out this Tutorial from Ladyada. I´am using it by myself and didn´t get any Error by opening lage Websites.
There is a buffer included, which sends only a specified amount of data per read.
Maybe that´s what you´re searching for.