As it stands, with the existing code, users may experience WDT timer resets with ESP8266 if using WiFi along with RF24Ethernet. I haven't been able to test fully with ESP32 yet.
I was able to work around the issue by removing all the delay() calls in RF24Network, and replacing with millis() based functions. This is because the RF24Network write() function is called from within lwIP callbacks, and yield() should not be called within the callbacks, but the delay() function calls yield so it causes issues. This is only an issue when using WiFi, since it uses lwIP as well.
The problem with the workaround is that it negatively affects nRF52 & 54 based devices, which then end up hanging on network.write() eventually.
Essentially, we need two types of delays, one millis() based for ESP8266 and possibly ESP32, and another delay() based for devices that don't use WiFi like the nRF52 & 54.
I was thinking of defining an internal RF24Network delay function:
void RF24NetworkDelay(uin32_t delay){
uint32_t timer = millis();
while(millis() < timer + delay){}
}
Then do some trickery, something like
#if defined ESP8266
#define RF24NETWORK_DELAY(x) RF24NetworkDelay(x)
#else
#define RF24NETWORK_DELAY(x) delay(x)
#endif
As it stands, with the existing code, users may experience WDT timer resets with ESP8266 if using WiFi along with RF24Ethernet. I haven't been able to test fully with ESP32 yet.
I was able to work around the issue by removing all the
delay()calls in RF24Network, and replacing with millis() based functions. This is because the RF24Networkwrite()function is called from within lwIP callbacks, and yield() should not be called within the callbacks, but thedelay()function callsyieldso it causes issues. This is only an issue when using WiFi, since it uses lwIP as well.The problem with the workaround is that it negatively affects nRF52 & 54 based devices, which then end up hanging on
network.write()eventually.Essentially, we need two types of delays, one
millis()based for ESP8266 and possibly ESP32, and anotherdelay()based for devices that don't use WiFi like the nRF52 & 54.I was thinking of defining an internal RF24Network delay function:
Then do some trickery, something like