-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ping excessive delay or loop halt when target offline #18
Comments
Hi @drakerex, I tried to reproduce this now.
|
I can reproduce the 'halt' issue with the following code. The IP address I'm trying to ping (192.168.0.2 in this case) doesn't belong to anything. The debug trace gets to "calling ping" and then just hangs. ` ///////please enter your sensitive data in the Secret tab/arduino_secrets.h // Specify IP address or hostname void setup() { if (debug) {
} void loop() { TestWiFiConnection(); if (debug) Serial.println("calling ping"); delay(500); void TestWiFiConnection() void WiFiConnect() void printWiFiData() { Serial.print("Subnet mask: "); Serial.print("Gateway IP : "); // print your MAC address: void printCurrentNet() { // print the MAC address of the router you're attached to: // print the encryption type: void printMacAddress(byte mac[]) { |
I changed a bit the spi_drv.cpp in the WiFiNINA library. I added timeout for these two function, and the hang is over, now I able to reconnect to the wifi router, if the connection is drop. void SpiDrv::waitForSlaveSign() void SpiDrv::waitForSlaveReady() This is the request handler function
} |
As requested from https://forum.arduino.cc/index.php?topic=569872.0
When a WiFi.ping is sent to a host (by dns) which is offline, there's an excessive delay. If the WiFi.ping command is sent by IPAddress the loop() halts. See the attached forum for example sketch.
The text was updated successfully, but these errors were encountered: