Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not pingable after a while #40

Open
honk79 opened this issue Jun 27, 2022 · 12 comments
Open

not pingable after a while #40

honk79 opened this issue Jun 27, 2022 · 12 comments

Comments

@honk79
Copy link

honk79 commented Jun 27, 2022

Hi,
I use the library with the Nano Ethernet Shield on an ESP32 Dev Kit-C.
I also use the PubSubClient-Library to send MQTT messages.
After some time (varies between some seconds and half an hour) the shield won't answer on pings. The "LinkStatus" is still 1.
For me it looks like some buffer or memory problems. When I have less traffic, the problem takes longer to occure.

Thanks for the help!

@JAndrassy
Copy link
Member

try to add Ethernet.maintain(); into loop()

@honk79
Copy link
Author

honk79 commented Jun 27, 2022

I tried it and placed it as the firts command in the loop(), but still the same problem.

@JAndrassy
Copy link
Member

does it execute at least every 200 milliseconds?

@honk79
Copy link
Author

honk79 commented Jun 28, 2022

yes, actually it is a very short loop.

void loop() {
  Ethernet.maintain();
  if (!client.connected()) {
    mqttReconnect();
  }
  if (millis() - timeSensorLastUpdate >= timeSensorInterval) {
    timeSensorLastUpdate += timeSensorInterval;
    pir.readStatus();
    Serial.print("HardwareStatus: ");
    Serial.println(Ethernet.hardwareStatus());
    Serial.print("LinkStatus: ");
    Serial.println(Ethernet.linkStatus());
  }
  if (millis() - timeMQTTLastUpdate >= timeMQTTInterval) {
    timeMQTTLastUpdate += timeMQTTInterval;
    mqttSendAll();
  }
  client.loop();
}

@JAndrassy
Copy link
Member

and the sketch still runs when the enc28j60 doesn't respond to ping?

@honk79
Copy link
Author

honk79 commented Jun 28, 2022

yes, the rest is running. when the mqtt-client tries to connect everything has to wait round about 5 seconds, and the sensor is reading.
the link-status is still "1".

@bennydiamond
Copy link

I think I have the same issue. After a few days, my Uno with ENC28J60 becomes unresponsive but the sketch still runs.

Arduino UNO R3 with some generic ENC28J60 board.
Sketch runs the following (all lastest versions):
EthernetENC
PubSubClient
DSCKeybusInterface

Unfortunately, with all this code packed in, I cannot crank up the serial prints of EthernetENC to a useful level of verbosity.

@JAndrassy
Copy link
Member

JAndrassy commented Sep 7, 2022

could you try to reset the router? it may help

@bennydiamond
Copy link

It does not. Only resetting the Arduino resolves the issue, temporarily.

@mikeycoding
Copy link

Same problem here. Using EthernetServer on Controllino Mini (identical to Arduino UNO) and the server is not reachable after a certain amount of runtime (after few hours). The rest of the program is running. Only resetting the arduino helps.

@alisyd
Copy link

alisyd commented Jan 22, 2024

I am also facing the same issue, with Arduino 2560 and ENC28j60, Connection goes deaf after a few hours of being active, Arduino works as a client to connect to a remote website and exchange messages every five seconds, so after a few hours of being active it loses connection and is not visible in the list of connected clients in router. I haven't tried building the custom delay function, which I will do shortly and test. I appreciate any help I can get as I am trying to use ENC28j60 in production and I have rest of the parts of this project working, idk if it is a good idea to use it in production, but if not this, I would like to know if there is anything else I should be using, thanks for any help in advance.

@JAndrassy
Copy link
Member

@alisyd do you use the 2.0.4 version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants