IoTaaP not connecting to WiFi

Yes, it can happen sometimes. The reason is sometimes unknown, it might be due to your WiFi router caching or some other cause.

If applicable, you can use the following approach:

  wifiConnectionInfo conInfo = iotaap.wifi.connect("SSID", "PASSWORD");

  if (conInfo.status == -1)
  {
    ESP.restart();
  }

This snippet will try to connect to the WiFi AP and it will keep restarting device (SW Restart) until connection is successful.