-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvement
Description
Feature request
I'd like to be able to configure the retry delay for WiFi reconnections in WiFiConnectionHandler
.
Currently, the value is hardcoded in CHECK_INTERVAL_TABLE
as 500ms:
Arduino_ConnectionHandler/src/ConnectionHandlerDefinitions.h
Lines 191 to 204 in 432961a
static unsigned int const CHECK_INTERVAL_TABLE[] = | |
{ | |
/* INIT */ 100, | |
#if defined(BOARD_HAS_NOTECARD) || defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) | |
/* CONNECTING */ 4000, | |
#else | |
/* CONNECTING */ 500, | |
#endif | |
/* CONNECTED */ 10000, | |
/* DISCONNECTING */ 100, | |
/* DISCONNECTED */ 1000, | |
/* CLOSED */ 1000, | |
/* ERROR */ 1000 | |
}; |
This causes excessive retry attempts and floods the serial output when the WiFi is unavailable.
Proposed solution
It would be great to:
- Allow user override of
CHECK_INTERVAL_TABLE
, or - Provide a setter method like
setReconnectInterval(NetworkConnectionState state, uint32_t delay_ms)
.
Context
I'm working on an Arduino IoT Cloud project using Opta and want to increase the reconnection interval to 10 seconds to avoid WiFi flooding.
Thanks for your work!
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: enhancementProposed improvementProposed improvement