i think i was able to hack a workaround using TeensyThreads - basically you can put Ethernet.begin() in a different thread and put a timeout in your main thread (or vice versa) for things to keep moving if Ethernet.begin() can't connect. Seems to be working fine- any potential issues I should be aware of? Looks something like this:
Code:
#include <NativeEthernet.h> //use for teensy
#include <NativeEthernetUdp.h> //use for teensy
#include <TeensyThreads.h>
IPAddress ip(192, 168, 1, 177); //IP address of this microcontroller
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; //mac address
volatile boolean connectedToEth = false;
void ethInit(){
Serial.println("searching for connection");
while(1){
Ethernet.begin(mac,ip);
connectedToEth = true;
}
}
void setup() {
threads.addThread(ethInit);
while(!connectedToEth&&millis()<10000){
delay(1000);
Serial.println("still searching...");
}
if(connectedToEth){
Serial.println("connected to ethernet");
}
else{
Serial.println("running without ethernet");
}
}