Skip to content
Snippets Groups Projects
Commit fe8ecd49 authored by Cyril Danilevski's avatar Cyril Danilevski
Browse files

Wait in setup until ethernet available

parent a38dc779
No related branches found
No related tags found
No related merge requests found
Pipeline #130837 passed
......@@ -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)
{
......
......@@ -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();
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment