title: How to connect to the AP in loop() in ESP8266
body: <p>I have an issue with <code>WiFi.begin()</code> in esp8266-12F.</p>
  <p>I'm going to connect the ESP8266 with the specific Access Point in the <code>loop()</code> not in the <code>setup()</code>.</p>
  <p>I want if a specific AP is available, ESP8266 would connect to it.
  In the below code, I supposed to connect to the &quot;abc&quot; AP and turns on an LED and if there is no connection, it turns the LED off, but <code>WiFi.begin(&quot;abc&quot;, &quot;123456789&quot;);</code> is not working.</p>
  <p>What I have to do in this case?</p>
  <pre><code>setup(){
  
  }
  
  loop(){
  
      if (WiFi.status() != WL_CONNECTED){
          WiFi.disconnect();
          WiFi.mode(WIFI_STA);
          WiFi.begin(&quot;abc&quot;, &quot;123456789&quot;);
          digitalWrite(5, HIGH);
      } else {
          digitalWrite(5, LOW);
      }
  
  }
  </code></pre>