[En-Nut-Discussion] Httpd request timeout problems.

Harald Kipp harald.kipp at egnite.de
Tue Dec 5 15:06:19 CET 2006

Hi Erik,

There are several reasons why timeouts may occur. For example,
in company networks there may be many broadcasts and the
controller buffer of the embedded system may easily overflow.
But even on high traffic networks this occurs seldom. And it
is even more unlikely, that the second retry of the browser
will fail again.

I assume, that your application contains loops, which eat up
all the CPU. The best way to avoid this is to have all I/O
interrupt driven.

The Ethernet Controller interrupt is executed fast (unless you
disable interrupts), but the service routine simply posts
an event to the Ethernet driver's receiver thread, which in turn
reads the received packet. If other threads do not release the
CPU in time, the buffer in the Ethernet controller will soon

Also note, that Nut/OS will discard packets, if the number of
available bytes in RAM falls below 4k (if I remember correctly).

Note, that you can also use ping to check packet loss.
Ethereal http://www.ethereal.com/ will be helpful too.
Make sure to connect the monitoring PC and the Ethernut via
a HUB, not a switch.


At 13:37 05.12.2006 +0100, you wrote:
>I have an application where i have an httpd thread to read and set some 
>settings thru a cgi webpage .
>I also have some threads that uses software spi to communicate with 
>external hardware.
> >From time to time i get a timeout when trying to request the webpage but 
> if i wait a while and request the page again i get an answer.
>To test a bit more i wrote an Windows http client that requests the 
>webpage each 100ms and if i activate the thread that communicates
>with the external hardware i get a request timeout in about 1 of 200 
>The timeout can then accur upp to 8 times in a row before i get any answer 
>from the board ( thats about ~1sec before i get any response )
>If i dissable the thread that communicates with external hardware the 
>timeouts accur much less. Say 1 / 5000.
>But i still get them from time to time.
>Can this be because the RX/TX threads are blocked when i run the other 
>threads, will not the interrupt(5) execute the RX/TX thread even
>if another thread is active and running? or will it wait until the current 
>thread is finished?
>If so then i guess this is the reason for the timeouts.

More information about the En-Nut-Discussion mailing list