sstaub / Ethernet3

Ethernet library for Arduino and Ethernetshield2 / WIZ550io / WIZ850io / USR-ES1 with Wiznet W5500 chip
Other
76 stars 34 forks source link

Link Down / Link Up Issue #4

Closed jHetzer closed 7 years ago

jHetzer commented 7 years ago

Ethernet3 or W5500 seems to have issues when the network link goes down and up. phyState() cannot be used as it will change to correct value if link goes up again. After occurrence my Arduino Nano cannot use the "EthernetClient client = server.available();" function or "client" gets not created. Currently I solve the issue with a counter and recalling "server.begin();" function after 1000 loops when no new connection occurs.

sstaub commented 7 years ago

The phyState() is only a wrapper for the original function of the driver: w5500.getPHYCFGR(). The best way is to check the phyState() every second. The internal delay of pay register is by system. For problems with EthernetClient have a look to the Arduino forum, there are no changes of the library from my side. Sometimes it helps to set the w5500.setRetransmissionCount() to a value of 2.