I would like to share my problem and ask if anybody has idea what can cause it.
I am using an arduino uno with ethernet shield to make a web server in order to be able to switch on-off a relay through the web page.
Normally the solution works well, but the web page looks so small on mobile device browser, so I wanted to make style to the html using css. The same thing works well if I save this page into html file and open on PC.
However when I insert the CSS code into the arduino sketch (sketch attached), it will not work any more. Even the arduino will not respond to a a ping at all. It seems the execution "dies" after Serial.begin(9600);
Another interesting point:
If I remove these 2 lines from the sketch:
client.println("<form method="get">");
client.println("");
Then it will already answer for ping, but webserver does not start at all. Probabaly it will die after this command: Ethernet.begin(mac, ip);
Do you have any idea what can cause this?
Maybe some memory problem?
The sketch size itself is round 16k.
Also if you use CSS in the page the browser is likely to come back with a GET for the .css
file concurrent with the page fetch (browsers are multi-threaded these days), which is
going to complicate things.
If your page body is small enough to fit in one TCP packet and you use "Connection: close"
that will probably help keep things saner.
Can you tell how to set up the WebServer.h ?
There is no WebServer.cpp attached.. and also during compile I have error:
WebServer.h: No such file or directory
Actually I put the WebServer.h into wrong place.
It should be under the Libraries folder in sketch folder, default: C:\Users\user\Documents\Arduino\libraries