Hi everyone..
I am working on the ethernet shield project. I want to check some values from the one device and want to check my computer .. Anyway When I run the uno+ ethernet shield it works fine and I can check values on the explorer. After 30 minute - 1 hour I can't reach the ethernet shield ip on explorer(Err_Timed_out) but I can ping the ethernet shield. When I unplug ethernet shield power and plug again it starts work again.
In addition to If I plug uno + ethernet shield to the switch in my office , it works very long time (I tested 2 days). I think problem is wireless antennas but another device working well same place ![]()
My connection diagram is here:
My codes is here :
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x00, 0x90, 0xE8, 0x5C, 0x43, 0x55 }; //physical mac address
IPAddress ip(10, 8, 0, 20);
IPAddress gateway(10, 8, 0, 1);
IPAddress subnet(255, 255, 255, 0);
EthernetServer server(80);
void setup() {
Ethernet.begin(mac, ip, gateway, subnet);
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
}
server.begin();
}
void loop() {
int sensorValue1 = analogRead(A1);
int sensorValue3 = analogRead(A3);
int sensorValue5 = analogRead(A5);
EthernetClient client = server.available();
if (client) {
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println(F("HTTP/1.1 200 OK"));
client.println(F("Content-Type: text/html"));
client.println(F("Connection: close"));
client.println(F("Refresh: 5"));
client.println(F());
client.println(F("<!DOCTYPE HTML>"));
client.println(F("<html>"));
if (sensorValue1 > 260) {
client.print(F("NORMAL"));
client.println(F("
"));
}
if (sensorValue3 > 260) {
client.print(F("WARNING"));
client.println(F("
"));
}
if (sensorValue5 > 260) {
client.print(F("ALARM"));
client.println(F("
"));
}
if ((sensorValue1 < 260) == (sensorValue3 < 260) == (sensorValue5 < 260)) {
client.print(F("UNKNOWN"));
client.println(F("
"));
}
client.println(F("</html>"));
break;
}
if (c == '\n') {
currentLineIsBlank = true;
} else if (c != '\r') {
currentLineIsBlank = false;
}
}
}
delay(150);
client.stop();
}
}
P.s.: I changed uno , ethernet shield , and power adaptor .Problem still Continues.
P.S2 : Sorry my English
P.S.3 : I am usin W5100 ethernet shield and I changed 511 resistor with two 100 ohm resistors.