[GH-ISSUE #1501] Any reason why setConnectRetries has a constraint between 1 and 10? #1279

Closed
opened 2026-02-28 01:29:24 +03:00 by kerem · 3 comments
Owner

Originally created by @sommerper on GitHub (Sep 20, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1501

Hi!

I have a device that's on a network that can have a network disconnection for longer periods of time.
Once the network is back I need the device to come back asap.
Retrying 10 times is not enough and ideally I'd like to retry an infinite amount of times.

What is the best way to achieve this without modifying the library directly in this piece of code?

/**
 * [setConnectRetries description]
 * @access public
 * @param {[type]} uint8_t numRetries [description]
 */
void WiFiManager::setConnectRetries(uint8_t numRetries){
  _connectRetries = constrain(numRetries,1,10);
}

Thank you and thanks for a great project!

Originally created by @sommerper on GitHub (Sep 20, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1501 Hi! I have a device that's on a network that can have a network disconnection for longer periods of time. Once the network is back I need the device to come back asap. Retrying 10 times is not enough and ideally I'd like to retry an infinite amount of times. What is the best way to achieve this without modifying the library directly in this piece of code? ``` /** * [setConnectRetries description] * @access public * @param {[type]} uint8_t numRetries [description] */ void WiFiManager::setConnectRetries(uint8_t numRetries){ _connectRetries = constrain(numRetries,1,10); } ``` Thank you and thanks for a great project!
kerem closed this issue 2026-02-28 01:29:24 +03:00
Author
Owner

@tablatronix commented on GitHub (Sep 20, 2022):

That is the connect retry for autoconnect, you do not want your coding sitting stuck in autoconnect like that nor should it be used like that.

You probably want to make your own loop for checking if connected or not, or call autoconnect itself in a loop

<!-- gh-comment-id:1252933249 --> @tablatronix commented on GitHub (Sep 20, 2022): That is the connect retry for autoconnect, you do not want your coding sitting stuck in autoconnect like that nor should it be used like that. You probably want to make your own loop for checking if connected or not, or call autoconnect itself in a loop
Author
Owner

@sommerper commented on GitHub (Sep 22, 2022):

Thanks for the clarification! I didn't know I could call autoconnect multiple times.

<!-- gh-comment-id:1255228846 --> @sommerper commented on GitHub (Sep 22, 2022): Thanks for the clarification! I didn't know I could call autoconnect multiple times.
Author
Owner

@tablatronix commented on GitHub (Sep 22, 2022):

Yeah technically we could do that but it's blocking and probably not what you want. It mostly to fix some aps that always reject the first conx

<!-- gh-comment-id:1255368390 --> @tablatronix commented on GitHub (Sep 22, 2022): Yeah technically we could do that but it's blocking and probably not what you want. It mostly to fix some aps that always reject the first conx
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1279
No description provided.