For WPS to work on the ESP8266 and using the non-OS SDK, be sure to call wifi_wps_enable()
before setting the callback function with wifi_set_wps_cb()
.
For example:
void wps_start()
{
wifi_wps_enable(WPS_TYPE_PBC);
wifi_set_wps_cb(wps_callback);
wifi_wps_start();
}
In the callback itself, call wifi_wps_disable()
before wifi_station_connect()
.
For example:
void wps_callback(int status)
{
wifi_wps_disable();
wifi_station_connect();
}