<p>WiFiManager 라이브러리 사용시, 이유없이 WiFi설정된 공유기에 접속이 끊기고 재접속시 기존 설정된 공유기에 접속하지 못하고</p>
<p>AP_Station 모드로 들어갈 때가 있음.</p>
<p>이에 WiFiManager.cpp 에서 아래 코드를 추가함.</p>
<p>&nbsp;</p>
<p>&nbsp;466 unsigned int con_count = 0;&nbsp; //추가</p>
<p>&nbsp;467</p>
<p>&nbsp;468 boolean WiFiManager::configPortalHasTimeout(){</p>
<p>&nbsp;469</p>
<p>&nbsp;470&nbsp; &nbsp; &nbsp;if(_configPortalTimeout == 0 || (_apClientCheck &amp;&amp; (WiFi_softap_num_stations() &gt; 0))){</p>
<p>&nbsp;471&nbsp; &nbsp; &nbsp; &nbsp;if(millis() - timer &gt; 30000){</p>
<p>&nbsp;472&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;timer = millis();</p>
<p>&nbsp;473&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DEBUG_WM(DEBUG_VERBOSE,"NUM CLIENTS: " + (String)WiFi_softap_num_stations());</p>
<p>&nbsp;474</p>
<p>&nbsp;475&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;con_count++;&nbsp; //추가 ---&gt;</p>
<p>&nbsp;476&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DEBUG_WM(DEBUG_VERBOSE,"con_count: " + (String)con_count);</p>
<p>&nbsp;477</p>
<p>&nbsp;478&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(con_count == 3) {&nbsp; //시간은 적당히 조절</p>
<p>&nbsp;479&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ESP.restart();</p>
<p>&nbsp;480&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; //&lt;---여기까지</p>
<p>&nbsp;481&nbsp; &nbsp; &nbsp; &nbsp;}</p>
<p>&nbsp;482&nbsp; &nbsp; &nbsp; &nbsp;_configPortalStart = millis(); // kludge, bump configportal start time to skew timeouts</p>
<p>&nbsp;----------------------------------------------------------------------------------------------------</p>
<p>*WiFiManager 2.0.16-rc.2</p>
<p>&nbsp;</p>
<p>577 번 줄부터,</p>
<p>unsigned int con_count = 0;&nbsp; //추가</p>
<p><br /></p>
<p>boolean WiFiManager::configPortalHasTimeout(){</p>
<p>&nbsp; &nbsp; if(!configPortalActive) return false;</p>
<p>&nbsp; &nbsp; uint16_t logintvl = 30000; // how often to emit timeing out counter logging&nbsp;</p>
<p><br /></p>
<p>&nbsp; &nbsp; // handle timeout portal client check</p>
<p>&nbsp; &nbsp; if(_configPortalTimeout == 0 || (_apClientCheck &amp;&amp; (WiFi_softap_num_stations() &gt; 0))){&nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; // debug num clients every 30s</p>
<p>&nbsp; &nbsp; &nbsp; if(millis() - timer &gt; logintvl){</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; timer = millis();</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; con_count++;&nbsp; //추가 ---&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; #ifdef WM_DEBUG_LEVEL</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; DEBUG_WM(F("con_count =&gt; "));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; //DEBUG_WM(DEBUG_VERBOSE,F("NUM CLIENTS: "),(String)WiFi_softap_num_stations());</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; #endif&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; if(con_count &gt;= 4) {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ESP.restart();</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; //추가 &lt;--- 여기까지&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; _configPortalStart = millis(); // kludge, bump configportal start time to skew timeouts</p>
<p>&nbsp; &nbsp; &nbsp; return false;</p>
<p>&nbsp; &nbsp; }</p>
<p><br /></p>
<p>&nbsp; &nbsp; // handle timeout webclient check</p>
<p>&nbsp; &nbsp; if(_webClientCheck &amp;&amp; (_webPortalAccessed&gt;_configPortalStart)&gt;0) _configPortalStart = _webPortalAccessed;</p>
<p><br /></p>
<p>&nbsp; &nbsp; // handle timed out</p>
<p>&nbsp; &nbsp; if(millis() &gt; _configPortalStart + _configPortalTimeout){</p>
<p>&nbsp; &nbsp; &nbsp; #ifdef WM_DEBUG_LEVEL</p>
<p>&nbsp; &nbsp; &nbsp; DEBUG_WM(F("config portal has timed out"));</p>
<p>&nbsp; &nbsp; &nbsp; #endif</p>
<p>&nbsp; &nbsp; &nbsp; return true; // timeout bail, else do debug logging</p>
<p>&nbsp; &nbsp; }&nbsp;</p>
<p>&nbsp; &nbsp; else if(_debug &amp;&amp; _debugLevel &gt; 0) {</p>
<p>&nbsp; &nbsp; &nbsp; // log timeout time remaining every 30s</p>
<p>&nbsp; &nbsp; &nbsp; if((millis() - timer) &gt; logintvl){</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; timer = millis();</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; #ifdef WM_DEBUG_LEVEL</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; DEBUG_WM(DEBUG_VERBOSE,F("Portal Timeout In"),(String)((_configPortalStart + _configPortalTimeout-millis())/1000) + (String)F(" seconds"));</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; #endif</p>
<p>&nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; }</p>
<p><br /></p>
<p>&nbsp; &nbsp; return false;</p>
<p>}&nbsp;</p>
<p>&nbsp;----------------------------------------------------------------------------------------------------</p>
<p>*WiFiManager 2.0.16-rc.2</p>
<p>&nbsp;</p>
<p>192.168.4.1 웹 화면 첫째줄 문구 출력 wm_strings_en.h&nbsp; 223번째줄에 정의,</p>
<p>const char S_brand[]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGMEM = "WiFiManager00";</p>
<p>&nbsp;</p>
<p>같은파일 43번째줄에서 웹표출 작성,</p>
<p>const char HTTP_ROOT_MAIN[]&nbsp; &nbsp; &nbsp; &nbsp; PROGMEM = "&lt;h1&gt;&lt;center&gt;{t}&lt;/center&gt;&lt;/h1&gt;&lt;h3&gt;{v}&lt;/h3&gt;";</p>