Skip to content

Commit

Permalink
Added a minor delay after the begin function to help Static address m…
Browse files Browse the repository at this point in the history
…ode work better.
  • Loading branch information
MartinMueller2003 committed Mar 15, 2024
1 parent cdb2ce4 commit 3025155
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ESPixelStick/src/network/EthernetDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ void c_EthernetDriver::Begin ()
{
logcon(String("Failed IP ") + GetIpAddress().toString());
}
// https://github.com/espressif/arduino-esp32/issues/5733 - add delay
delay(100);
while(!GetIpAddress()) {}
logcon(String("After IP ") + GetIpAddress().toString());
#endif // def testEth
Expand Down Expand Up @@ -113,8 +115,6 @@ void c_EthernetDriver::SetEthHostname ()
if (0 != Hostname.length ())
{
// DEBUG_V (String ("Setting ETH hostname: ") + Hostname);

// ETH.config (INADDR_NONE, INADDR_NONE, INADDR_NONE);
ETH.setHostname (Hostname.c_str ());
}

Expand Down Expand Up @@ -374,8 +374,6 @@ void c_EthernetDriver::SetUpIp ()
if (true == UseDhcp)
{
logcon (F ("Connecting to Ethernet using DHCP"));
// ETH.config (temp, temp, temp, temp);

break;
}

Expand All @@ -400,6 +398,8 @@ void c_EthernetDriver::SetUpIp ()
// DEBUG_V ("gateway: " + gateway.toString ());

// We didn't use DNS, so just set it to our configured gateway
// https://github.com/espressif/arduino-esp32/issues/5733 - add delay
delay(100);
ETH.config (ip, gateway, netmask, gateway);

logcon (F ("Connecting to Ethernet with Static IP"));
Expand All @@ -423,6 +423,8 @@ void c_EthernetDriver::StartEth ()
{
fsm_Eth_state_DeviceInitFailed_imp.Init ();
}
// https://github.com/espressif/arduino-esp32/issues/5733 - Add delay
delay(100);

// DEBUG_END;
} // StartEth
Expand Down

0 comments on commit 3025155

Please sign in to comment.