title: ESP8266 SDK 1.5.2 Smart Config 2.5.3 with ESP-Touch Android app
body: <p>I'm using the <a href="http://bbs.espressif.com/viewtopic.php?f=46&amp;t=1702" rel="nofollow">ESP8266 SDK 1.5.2</a> and trying to get smart config working with an android app. With smart config I can transmit the SSID and password for the access point which that the ESP8266 should connect.</p>
  
  <p>I'm using the example code from the <a href="http://bbs.espressif.com/download/file.php?id=1106" rel="nofollow">SDK 1.5.2 documentation page 108/109</a>.</p>
  
  <pre><code>void ICACHE_FLASH_ATTR smartconfig_done(sc_status status, void *pdata)
  {
      switch (status) {
      case SC_STATUS_WAIT:
          os_printf("SC_STATUS_WAIT\n");
          break;
      case SC_STATUS_FIND_CHANNEL:
          os_printf("SC_STATUS_FIND_CHANNEL\n");
          break;
      case SC_STATUS_GETTING_SSID_PSWD:
          os_printf("SC_STATUS_GETTING_SSID_PSWD\n");
          sc_type *type = pdata;
          if (*type == SC_TYPE_ESPTOUCH) {
              os_printf("SC_TYPE:SC_TYPE_ESPTOUCH\n");
          }
          else {
              os_printf("SC_TYPE:SC_TYPE_AIRKISS\n");
          }
          break;
      case SC_STATUS_LINK:
          os_printf("SC_STATUS_LINK\n");
          struct station_config *sta_conf = pdata;
          wifi_station_set_config(sta_conf);
          wifi_station_disconnect();
          wifi_station_connect();
          break;
      case SC_STATUS_LINK_OVER:
          os_printf("SC_STATUS_LINK_OVER\n");
          if (pdata != NULL) {
              uint8 phone_ip[4] = { 0 };
              memcpy(phone_ip, (uint8*)pdata, 4);
              os_printf("Phone ip: %d.%d.%d.%d\n",phone_ip[0],phone_ip[1],phone_ip[2],phone_ip[3]);
          }
          smartconfig_stop();
          break;
      }
  }
  </code></pre>
  
  <p>Before I call</p>
  
  <pre><code>smartconfig_start(smartconfig_done);
  </code></pre>
  
  <p>I disconnect from station and set the ESP8266 to station mode:</p>
  
  <pre><code>wifi_station_disconnect();
  wifi_set_opmode_current(STATION_MODE);
  </code></pre>
  
  <p>When smart config is started my callback will be called with status SC_STATUS_FIND_CHANNEL. Then I try to connect via the following androig apps:</p>
  
  <p><a href="https://play.google.com/store/apps/details?id=com.qwavesys.smartconfig&amp;hl=de" rel="nofollow">ESP Smart Config</a> </p>
  
  <p><a href="https://play.google.com/store/apps/details?id=com.cmmakerclub.iot.esptouch&amp;hl=de" rel="nofollow">ESP8266 SmartConfig</a></p>
  
  <p><a href="https://play.google.com/store/apps/details?id=com.espressif.iot&amp;hl=de" rel="nofollow">IOT_Espressif</a></p>
  
  <p>With ESP Smart Config and ESP8266 SmartConfig nothing will happen. My smartconfig_done callback will never called again.</p>
  
  <p>With IOT_Espressif I get called with status SC_STATUS_GETTING_SSID_PSWD and the log tells me that the ESP-Touch protocol is used and which phone MAC and which access point MAC will be used. But then I will not be called with status SC_STATUS_LINK and SC_STATUS_LINK_OVER.</p>
  
  <p>Has anyboby got SmartConfig 2.5.3 which is used in SDK 1.5.2 working with an android app?</p>
  
  <p>Or is the ESP-Touch protocol that should be used for SmartConfig 2.5.3 somewhere described?</p>
  
  <p>The source code for IOT_Espressif can be found <a href="https://github.com/EspressifApp/IOT-Espressif-Android" rel="nofollow">here</a>. And the source code for a demo ESP-Touch android app is found <a href="https://github.com/EspressifApp/EsptouchForAndroid" rel="nofollow">here</a>. In the demo app it's written that it will only work with SmartConfig 2.4.</p>
  
  <p>Maybe something has changed between SmartConfig 2.4 and 2.5.3. But what is changed?</p>