Hi all,
I'm using an ethernetshield on the arduino, and got the webserver running. Strange thing is if i use firefox/chrome the page appears as aspected. BUT if i open it with internetexplorer 8 (windows 7 machines) the page is blank. It'connects, but blank. First i thought it was a bug in IE, but that was for older versions. I can't find the problem.
here's the code
/*
* A webserver for project DOMEKAN, HAN 2010
* Marcel vd Kamp
*/
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,110 };
Server server(4500);
int PIRpin = 2;
int value = 0;
int ledpin = 13;
void setup()
{
Ethernet.begin(mac, ip);
server.begin();
pinMode (PIRpin, INPUT);
pinMode (ledpin, OUTPUT);
}
void loop()
{
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.print("<head>");
client.print("<HTTP/1.1 200 OK>");
client.print("<Content-Type: text/html>");
client.print("<META HTTP-EQUIV=REFRESH content=5 url='http;//192.168.1.110' >");
client.println();
// webpagina inserten
client.print("<title>Arduino webserver voor PIR</title>");
client.print("</head>");
client.print("<body bgcolor= #0000FF");
client.print("text= #333333");
client.print("<h2><strong>Webserver voor signalen van PIR's Aangesloten op de arduino</strong></h2>");
client.print("<p><marcel van de kamp, 2010></p>");
client.print("<p> </p>");
value = digitalRead(PIRpin);
if (HIGH == value) {
digitalWrite(ledpin, HIGH);
client.print("<h3>koekoek, marcel zit achter zijn PC</h3>");
}
else
{
digitalWrite(ledpin, LOW);
client.print("geen activiteit");
}
client.print("<p align= left >Signaal van PIR 1: </p>");
client.print("<p align= left >Signaal van PIR 2: </p>");
client.print("<p align= left >Signaal van PIR 3: </p>");
client.print("<p align= left > </p>");
client.print("</body>");
client.print("</html>");
// einde
break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_blank = true;
} else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
client.stop();
}
}
Has anybody come across this problem and solved it ??