diff --git a/esp32_ethernet.cpp b/esp32_ethernet.cpp
index 251dafea311388b66edbc9c28eae4845af4d9e77..ec384a46f6b5950a858b31c90cc5834c82f19f20 100644
--- a/esp32_ethernet.cpp
+++ b/esp32_ethernet.cpp
@@ -47,6 +47,6 @@ void EthernetEvent(WiFiEvent_t event)
 void initializeNetwork()
 {
   WiFi.onEvent(EthernetEvent);
-  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
+  ETH.begin(ETH_TYPE, ETH_ADDR, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_POWER_PIN, ETH_CLK_MODE);
 }
 
diff --git a/esp32_ethernet.hpp b/esp32_ethernet.hpp
index 5d6e27e5820087837f223cb546209707445effcf..67cda7a7f5634d4bdcd541427012c9135228750d 100644
--- a/esp32_ethernet.hpp
+++ b/esp32_ethernet.hpp
@@ -8,6 +8,7 @@ We use Ethernet, but reuse much of the networking utilities.
 
 #include "Arduino.h"
 #include "ETH.h"
+#include <WiFi.h>
 
 #define ETH_ADDR        1
 #define ETH_POWER_PIN   5