วันอังคารที่ 6 ตุลาคม พ.ศ. 2558

ESP8266 WiFi SmartConfig with Android App.



ESP8266 WiFi SmartConfig with Android App and Arduino IDE.


What is ESP8266 WiFi SmartConfig?

When you use ESP8266 WiFi Module connect your network or Internet. You must fill SSID and password for your network to ESP8266 Code. SmartConfig help you to do that automatically.

System Diagram



smart config APIs

Herein we only introduce smart-config APIs,users can inquire Espressif Systems for smart-config documentation which will contain more details. Please make sure the target AP is enabled before enable smart-config.

1. smartconfig_start

Function: Start smart configuration mode, to connect ESP8266 station to AP, by sniffing for special packets from the air, containing SSID and password of desired AP. You need to broadcast the SSID and password (e.g. from mobile device or computer) with the SSID and password encoded.
Note:
  1. This api can only be called in station mode.
  2. During smart-config,ESP8266 station and soft-AP are disabled.
  3. Can not call smartconfig_start twice before it finish,please call smartconfig_stop first.
  4. Don’t call any other APIs during smart-config, please call smartconfig_stop first.

2. smartconfig_stop

Function: stop smart config, free the buffer taken by smartconfig_start.
Note:
Whether connect to AP succeed or not, this API should be called to free memory taken by smartconfig_start.

Prototype: bool smartconfig_stop(void)
Parameter: null
Return:
true: succeed
false: fail











ESP8266 WiFi SmartConfig Source Code ( Arduino IDE )

https://github.com/sandeepmistry/esp8266-Arduino/blob/master/esp8266com/esp8266/libraries/ESP8266WiFi/examples/WiFiSmartConfig/WiFiSmartConfig.ino













Android App Source Code