WiFiManager & setTimeout VS setConfigPortalTimeout

Всім привіт!

Була ситуація. Після подачі напруги в будинку, роутер ще не створив точку доступу, а ESP8266 вже спробувала під’єднатись до мережі WiFi. Так як під’єднатись не зміг, то WiFiManager перейшов у режим налаштування і ESP8266 сама створила точку доступу.
Така ситуація неприпустима для систем IoT. Потрібно повторювати спроби підключення до мережі час від часу.
Ознайомившись з документацією по WiFiManager я додав до коду рядок ‘wifiManager.setTimeout(180);’. І це допомогло. Але додавши замість ‘wifiManager.setTimeout(180);’ рядок ‘wifiManager.setConfigPortalTimeout(180);’ я отримав такий же ж позитивний ефект вирішення проблеми повторного підключення ESP8266 до WiFi мережі.
Будь ласка поясніть в чому різниця між setTimeout та setConfigPortalTimeout? Бо англійську знаю дуже слабко, та й перекладач не помагає. Так що я не можу вловити тонкощі різниці цих двох методів. Буду дуже вдячний.


Hello everybody!

There was a situation. After supplying the home, the router has not yet created an access point, and ESP8266 has already tried to connect to the WiFi network. Since it was not able to connect, then WiFiManager switched to setup mode and ESP8266 itself created an access point.
This situation is unacceptable for IoT systems. You must repeat attempts to connect to the network from time to time.
After reading the documentation on WiFiManager, I added ‘wifiManager.setTimeout (180);’ to the code. And it helped. But adding instead of ‘wifiManager.setTimeout (180);’ line ‘wifiManager.setConfigPortalTimeout (180);’ I received the same positive effect of solving the problem of re-connecting the ESP8266 to the WiFi network.
Please explain what is the difference between setTimeout and setConfigPortalTimeout? Because I know English very poorly, and the interpreter does not help. So I can not catch the subtleties of the difference between these two methods. I will be very grateful.

Можна закрити тему.
Розібрався. Подивився в сирці. Функція setConfigPortalTimeout нова назва функції setTimeout.

    //sets timeout before webserver loop ends and exits even if there has been no setup.
    //useful for devices that failed to connect at some point and got stuck in a webserver loop
    //in seconds setConfigPortalTimeout is a new name for setTimeout
    void          setConfigPortalTimeout(unsigned long seconds);
    void          setTimeout(unsigned long seconds);

В файлі CPP функція setTimeout посилається на функцію setConfigPortalTimeout. Тепер зрозуміло чому вони поводять себе однаково.


You can close the topic.
Function setConfigPortalTimeout new function name setTimeout.

In the CPP file, setTimeout refers to the function setConfigPortalTimeout. Now it’s clear why they behave the same way.

Have you considered the WiFiManager GitHub for your questions?

Yes, of course, this is the first thing I did.
The description for these functions is slightly different.
Although this is one and the same function with different names.
So I got confused.