Hello to all.
First sorry because I don’t have good access to the Internet.
I’ve connected ENC28j60 to uno r3.Everything is OK just this problem.
When I want to create delay between HTTP request and HTTP response , and When I send one request to uno r3 by ‘GET’ mothod,I get more than one request in uno.
I just need one request in my code.If somebody could solve my problem,Thank you.
I have attached My code and Picture of my problem in below.
Thanks again.
void loop() {
word len = ether.packetReceive();
word pos = ether.packetLoop(len);
if(pos) {
Serial.println((char *)Ethernet::buffer + pos);
if(strstr((char *)Ethernet::buffer + pos, "GET /?status=ON") != 0) {
}
if(strstr((char *)Ethernet::buffer + pos, "GET /?status=OFF") != 0) {
}
delay(1000);
BufferFiller bfill = ether.tcpOffset();
bfill.emit_p(PSTR("HTTP/1.0 200 OK\r\n"
"Content-Type: text/html\r\nPragma: no-cache\r\n\r\n"
"<html><head><title>WebLed</title></head></html>"));
ether.httpServerReply(bfill.position());
}
}
Attachs.zip (190 KB)