Code:
extern "C" {
#include "user_interface.h"
}
LOCAL void ICACHE_FLASH_ATTR
wps_status_cb(int status)
{
wifi_wps_disable();
Serial.printf("\n\rwps_status_cb: ");
switch (status) {
case WPS_CB_ST_SUCCESS:
Serial.printf("success!");
wifi_station_connect();
break;
case WPS_CB_ST_FAILED:
Serial.printf("failed.");
break;
case WPS_CB_ST_TIMEOUT:
Serial.printf("timeout.");
break;
case WPS_CB_ST_WEP:
Serial.printf("WEP: not supported.");
break;
case 4:
Serial.printf("scan error.");
break;
default: Serial.printf("%u", status);
}
Serial.println();
}
void setup() {
Serial.begin(115200);
system_set_os_print(1);
Serial.setDebugOutput(true);
wifi_set_opmode(STATION_MODE);
wifi_station_set_auto_connect(0);
delay(5000);
wifi_wps_disable();
wifi_wps_enable(WPS_TYPE_PBC);
wifi_set_wps_cb(wps_status_cb);
wifi_wps_start();
}
void loop() {
yield();
}
wps scan
build public key start
build public key finish
f r0, wifi status: 0 phy_mode: 3
wps discover [belkin.150]
scandone
WPS: neg start
f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
wifi_wps_disable
state: 5 -> 0 (0)
rm 0
wps_status_cb: failed.
Statistics: Posted by dalbert — Sat Dec 09, 2017 10:09 pm
Statistics: Posted by dalbert — Sat Jul 22, 2017 8:06 pm
Statistics: Posted by gjump — Tue Nov 29, 2016 7:09 am
Statistics: Posted by ESP_Faye — Tue Mar 01, 2016 9:21 pm
Statistics: Posted by arborwoods5 — Thu Jan 28, 2016 11:25 am