Ethernet - Ethernet.setRetransmissionTimeout()

Description

Set the Ethernet controller’s timeout. The initial value is 200 ms. A 200 ms timeout times the default of 8 attempts equals a blocking delay of 1600 ms during a communications failure. You might prefer to set a shorter timeout to make your program more responsive in the event something goes wrong with communications. You will need to do some experimentation to determine an appropriate value for your specific application.

Syntax

Ethernet.setRetransmissionTimeout(milliseconds)

Parameters

  • milliseconds: the timeout duration (uint16_t)

Returns

Nothing

Example

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);

void setup() {
  Ethernet.begin(mac, ip);
  Ethernet.setRetransmissionTimeout(50);  // set the Ethernet controller's timeout to 50 ms
}

void loop () {}