diff --git a/esp32_ethernet.cpp b/esp32_ethernet.cpp index d82c4a752fde981ce66452950725db29d04ed17f..396de400f528e7e6ee6bf99089f699431d910f25 100644 --- a/esp32_ethernet.cpp +++ b/esp32_ethernet.cpp @@ -5,6 +5,8 @@ We use Ethernet, but reuse much of the networking utilities. #include "esp32_ethernet.hpp" +bool eth_connected = false; + void EthernetEvent(WiFiEvent_t event) { diff --git a/esp32_ethernet.hpp b/esp32_ethernet.hpp index 1103513d3a67f9224b9488a02309729c690134ac..0f87c8aaed712c5e3385a47b8da6a558c224576f 100644 --- a/esp32_ethernet.hpp +++ b/esp32_ethernet.hpp @@ -16,7 +16,7 @@ We use Ethernet, but reuse much of the networking utilities. #define ETH_TYPE ETH_PHY_IP101 #define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN -static bool eth_connected = false; +extern bool eth_connected; void EthernetEvent(WiFiEvent_t event); void connectNetwork(); diff --git a/icbm.ino b/icbm.ino index 994f17bb2a8ccf118230255a3274b062792b76bf..18805c1b76b6b00e4149d94c65239fff8b1a7e05 100644 --- a/icbm.ino +++ b/icbm.ino @@ -228,6 +228,7 @@ void onMessage(const SNMP::Message *message, const IPAddress remote, const uint1 } unsigned long start; +extern bool eth_connected; void setup() { Serial.begin(115200); @@ -236,6 +237,11 @@ void setup() { snmp.begin(&udp); snmp.onMessage(onMessage); // Start + while (!eth_connected) { + Serial.print("-"); + delay(100); + } + start = millis(); // MPOD SNMP::Message *message = mpod.setup();