arduino ethernet work slowlly and stuck the network

Hello
I have a arduino ethernet that work as a server-
when someone connect to him he see a simple page with 4 HTML lines.
my problem is that when I ping to the Arduino while connecting to him on the browser I get very long ping ~3500mSec and more
any reason why? maybe something in the code is killing him?
I do refresh once every 1 seconds - maybe this is the problem?

Thanks ,

server.ino (12.5 KB)

I do refresh once every 1 seconds - maybe this is the problem?

Yes, this probably is the problem. The way you have programmed your sketch every character is sent in a separate packet, so you have several hundred packets to be sent for one page. You can make your sketch much faster if you don't use the print()/println() methods but only the multi-byte write() method.

can you show me what you mean? I don't understand
even for one or two lines - so I will see and try for my own

if the problem is all the serial output - I can remove most of them

Thanks ,

          client.print(F("Today is -  "));
          printDate();
          HttpPrintDate(client);

Why does the web page need to display this?

          client.println(F("LOG count is - "));
          client.print(t);
          client.println("       ");

Log count is t? I'd of guessed that eventually. After 14 bazillion attempts.

void BlinkLed ()
{
  digitalWrite(MoveLED,HIGH);
  delay(700);
  digitalWrite(MoveLED,LOW); 
}

And, how many times do you call this function while sending data to the client?

It's no wonder your page takes a long time to load - full of useless stuff and delay() on top of that.

  1. I wanted to see the date in the HTML page
    so I will know when was the last event (if you have another better idea how to do this I will love to hear and learn ).
    but if you think this is one of the reason it work slow and "kill" the network , I will remove it.
    2.I have change this part (and the name )
    3.so how can I make the LED to be blink for amount of time while the client is seeing the page?
    I want to see LED and also massage on screen

I'm now trying to write it from start and remove all the unnecessary serial print and massages , I will upload it when I'm done , so if you can help me with with at least question 3 it will be great !

Thanks ,

3.so how can I make the LED to be blink for amount of time while the client is seeing the page?

Why do think this is necessary or desirable?

I will explain
let say the Arduino is in my kitchen with the sensors that look at the garden
now there is 2 options:

  1. I'm sitting near a computer connecting to the Arduino and see the HTML live - so I will see the massage .
  2. I'm not near a computer and then I will see the LED .

3.so how can I make the LED to be blink for amount of time while the client is seeing the page?
I want to see LED and also massage on screen

Take a look at the BlinkWithoutDelay example and change that blinking LED code so, that it doesn't call delay() anymore.