Skip to content

WPS fails with most new (802.11ac) access points #3941

Closed
@dalbert2

Description

@dalbert2

Basic Infos

WPS connection fails with most newer access points but work fine with older b/g/n APs.

UPDATE: the main WPS issue turned out to be lack of free memory. It turns out that a substantial (>16K) amount of free RAM is needed for WPS to succeed. I never got it working with the Belkin .ac router but it seems to work with most .ac access points as long as there's enough free RAM.

Hardware

Hardware: ESP-12F
Core Version: 2.1.0-rc2

Description

The same code works perfectly to connect via WPS with older (802.11b/g/n) access points but fails on newer (ac1900) access points even when the 5GHz radio is disabled. WPS finds the access point SSID but the negotiation to get the PSK fails. 100% failure rate with Belkin AC1900 DB (Model F9K1124V1)

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: nodemcu

Sketch

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();
}

Debug Messages

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions