Web Server well structured - bug?

Hi all,

I have been playing with this code:


And came across a problem whereby whenever a new web page is selected from the browser it seemed to be working........but was resetting the Arduino each time. It's not easy to notice, but once I had put some of my own code in VOID SETUP I notices that code was running again each time a new page was selected from the browser.

I found the problem, and by simply comenting out the following line it all seems to work properly now. As follows:

// strncpy(http_def.vars,vars,STRING_VARS_SIZE);

This is located at the foot of the "Method for read HTTP Header Request from web client" section.

If there's a better fix I'd love to hear.


It is very likely your Sketch needs more memory than you have on your Arduino. Typically, the stack overwrites some of the data area.

This may help…