Good afternoon.
In his project, he decided to replace 5100 with 5500.
I use the Ethernet library v2.0.0 from the Arduino repository.
I do not use the Ethernet2 library, because its support has been discontinued.
It connects to the DHCP much more slowly than the 5100.
The connection is constantly breaking.
What could be the problem?
byte my_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //MAC
IPAddress my_ip(MY_IP); //IP
IPAddress my_gateway(MY_GATEWAY); //Gateway
IPAddress my_subnet(MY_SUBNET); //Subnet
IPAddress my_dns(MY_DNS); //DNS
EthernetServer my_srv(80);
EthernetClient my_ethClient; //log
void my_eth_init(void)
{
String text;
my_print("Ethernet DHCP...");
Ethernet.init(MY_PIN_ETH); //Wrote for W5500! W5500 did not work without it!
if (Ethernet.begin(my_mac) == 0) { //, MY_ETH_TIME_CONNECT - did not work with this parameter either!
my_print("Failed Ethernet using DHCP"); my_print_cr();
// Check for Ethernet hardware present
switch (Ethernet.hardwareStatus())
{
EthernetNoHardware: my_print("Ethernet shield was not found."); my_print_cr(); break;
EthernetW5100: my_print("W5100 Ethernet controller detected."); my_print_cr(); break;
EthernetW5200: my_print("W5200 Ethernet controller detected."); my_print_cr(); break;
EthernetW5500: my_print("W5500 Ethernet controller detected."); my_print_cr(); break;
default: break;
}
if (Ethernet.linkStatus() == LinkOFF) { my_print("Ethernet cable is not connected."); my_print_cr(); }
// try to congifure using IP address instead of DHCP:
//Ethernet.begin(my_mac, my_ip, my_dns);
//my_print("Ethernet start IP/DNS."); my_print_cr();}// start the Ethernet connection and the server:
Ethernet.begin(my_mac, my_ip, my_dns, my_gateway, my_subnet);
my_print("Ethernet start Full."); my_print_cr();
}
else {
text = "DHCP IP: ";
text += IpAddress2String(Ethernet.localIP());
my_print(text); my_print_cr();
}
//my_srv.begin();
my_print("Ethernet Init OK"); my_print_cr();
}