Skip to content

Allow configurable reconnection delay for WiFiConnectionHandler #139

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

Open
ClaudioTZ opened this issue May 3, 2025 · 0 comments
Open

Allow configurable reconnection delay for WiFiConnectionHandler #139

ClaudioTZ opened this issue May 3, 2025 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@ClaudioTZ
Copy link

ClaudioTZ commented May 3, 2025

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:

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!

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants