Chat freely about anything...

User avatar
By donnib
#39384
martinayotte wrote:ESP8266WiFi (in ESP8266WiFiSTA.h)


So i need to include ESP8266WiFiSTA.h but that uses another way of connecting wifi ? I can't find an example.
User avatar
By donnib
#39387 I have changed my method into this :

Code: Select allvoid LaunchWifi()
{
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  WiFi.config(ip,gateway,subnet);
  int i = 0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    ESP.wdtFeed();
    if(i>40)
      ESP.reset();
    i++;
    WiFi.begin(ssid, password);
    WiFi.config(ip,gateway,subnet);
    }


This is because idk what else to do when i don't connect, 99% the connection it works after reset.

donnib