ESP8266 Smart Config – ESP TOUCH with Arduino IDE

ESP8266 chips have a handy little feature that allows you to configure WiFi credentials that they use without actually connecting to them.
One of the protocols it supports is called ESP Touch and to get it working under the Arduino IDE you can use the code below as a starting point.

WiFi.beginSmartConfig() is the key. I have tested it from an Android phone using an app from the play store called ESP8266 SmartConfig

#include <ESP8266WiFi.h>;

void setup() {
  Serial.begin(115200);
  delay(10);

  WiFi.mode(WIFI_AP_STA);
  delay(500);

  WiFi.beginSmartConfig();

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    Serial.println(WiFi.smartConfigDone());
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

int value = 0;

void loop() {

}

/later: I was unable in some situations to configure the ESP8266 at all, like with an iPhone on an Airport Extreme, unless 1m or less from the router.

This feature seems to be updated quite fast in the newer SDK’s and the documentation together with library support code are waaaaay behind. For now it looks like i’ll still have to use my very own WiFiManager

Category: blog

Tags: ,

- October 16, 2015