Statistics: Posted by dalbert — Sat Jul 22, 2017 8:58 pm
Statistics: Posted by russus — Tue Nov 29, 2016 2:23 pm
Statistics: Posted by gjump — Tue Nov 29, 2016 1:56 am
Statistics: Posted by russus — Tue Nov 29, 2016 1:45 am
Code:
single_key = key_init_single(WPS_KEY_IO_NUM, WPS_KEY_IO_MUX, WPS_KEY_IO_FUNC,
NULL, user_wps_key_short_press);
Code:
LOCAL void ICACHE_FLASH_ATTR
user_wps_key_short_press(void)
{
wifi_wps_disable();
wifi_wps_enable(WPS_TYPE_PBC);
wifi_set_wps_cb(user_wps_status_cb);
wifi_wps_start();
}
Code:
static void ICACHE_FLASH_ATTR ledtimer_func(void *arg)
{
os_timer_disarm(&ledtimer);
console_printf("LEDtimer %d\n\r",ledout++);
if(ledout<2) // If seconds passed < 2, reload the timer
{
os_timer_setfn(&ledtimer, (os_timer_func_t *)ledtimer_func, NULL);
os_timer_arm(&ledtimer, 1000, 0);
}
else user_wps_key_short_press(); // Else, call the WPS functions
}
void ICACHE_FLASH_ATTR
user_init(void)
{
UARTInit(BIT_RATE_115200);
console_printf("Hello world!\r\n");
wifi_set_opmode(STATION_MODE);
wifi_station_set_reconnect_policy(0); // To avoid using the previous saved credentials
wifi_station_set_auto_connect(0); // To avoid using the previous saved credentials
os_timer_disarm(&ledtimer);
os_timer_setfn(&ledtimer, (os_timer_func_t *)ledtimer_func, NULL);
os_timer_arm(&ledtimer, 1000, 0);
}
Statistics: Posted by gjump — Tue Nov 29, 2016 12:58 am
Maybe you can give a shot using another router
Code:
LOCAL void ICACHE_FLASH_ATTR
user_wps_status_cb(int status)
{
os_printf("\n\rwps_status_cb\n\r");
switch (status) {
case WPS_CB_ST_SUCCESS:
wifi_wps_disable();
wifi_station_connect();
break;
case WPS_CB_ST_FAILED:
case WPS_CB_ST_TIMEOUT:
wifi_wps_start();
break;
}
}
Code:
LOCAL void ICACHE_FLASH_ATTR
user_wps_key_short_press(void)
{
os_printf("\n\rkey_short_press\n\r");
wifi_wps_disable();
wifi_wps_enable(WPS_TYPE_PBC);
wifi_set_wps_cb(user_wps_status_cb);
wifi_wps_start();
}
I'm just calling the function via timer(~3s after boot), cause I don't have any buttons attached to my ESP
Statistics: Posted by russus — Mon Nov 28, 2016 10:01 pm
11:04:12.384> wifi_wps_enable
11:04:12.384> wps scan
11:04:12.384> build public key start
11:04:16.440> build public key finish
11:04:17.937> wps discover [Teste]
11:04:17.937> scandone
11:04:17.937> WPS: neg start
11:04:18.065> scandone
11:04:18.936> state: 0 -> 2 (b0)
11:04:18.936> state: 2 -> 3 (0)
11:04:19.027> state: 3 -> 5 (10)
11:04:19.027> add 0
11:04:19.027> aid 1
11:04:19.027> cnt
11:04:20.496> process pubkey start
11:04:25.366> process pubkey finish
11:04:25.426> WPS: key[senhateste]
11:04:25.426> wps finished
11:04:25.426> state: 5 -> 2 (1a0)
11:04:25.426> rm 0
11:04:26.425> >>WPS OK!!<<wifi_wps_disable
11:04:26.425> state: 2 -> 0 (0)
11:04:26.524> scandone
11:04:27.548> state: 0 -> 2 (b0)
11:04:27.548> state: 2 -> 3 (0)
11:04:27.548> state: 3 -> 5 (10)
11:04:27.548> add 0
11:04:27.548> aid 1
11:04:27.548> cnt
11:04:27.781>
11:04:27.781> connected with Teste, channel 11
Statistics: Posted by gjump — Mon Nov 28, 2016 9:12 pm
Code:
load 0x40100000, len 29052, room 16
tail 12
chksum 0xcb
ho 0 tail 12 room 4
load 0x3ffe8000, len 1932, room 12
tail 0
chksum 0x64
load 0x3ffe8790, len 1816, room 8
tail 0
chksum 0x91
csum 0x91
rf cal sector: 123
rf[112] : 00
rf[113] : 00
rf[114] : 01
SDK ver: 2.0.0(656edbf) compiled @ Jul 19 2016 17:58:40
phy ver: 1055, pp ver: 10.2
mode : sta(18:fe:34:a3:25:31)
add if0
Statistics: Posted by russus — Mon Nov 28, 2016 2:28 pm
Statistics: Posted by gjump — Sun Nov 27, 2016 9:13 am
Hello world!
SDK version: 1.5.0
wifi_wps_enable
mode : sta(18:fe:34:d2:df:a2)
add if0
Statistics: Posted by gjump — Thu Nov 24, 2016 6:29 am
Code:
#include "osapi.h"
#include "user_interface.h"
#include "driver/key.h"
#define WPS_KEY_NUM 1
#define WPS_KEY_IO_MUX PERIPHS_IO_MUX_MTCK_U
#define WPS_KEY_IO_NUM 13
#define WPS_KEY_IO_FUNC FUNC_GPIO13
LOCAL struct keys_param keys;
LOCAL struct single_key_param *single_key;
LOCAL void ICACHE_FLASH_ATTR
user_wps_status_cb(int status)
{
switch (status) {
case WPS_CB_ST_SUCCESS:
wifi_wps_disable();
wifi_station_connect();
break;
case WPS_CB_ST_FAILED:
case WPS_CB_ST_TIMEOUT:
wifi_wps_start();
break;
}
}
LOCAL void ICACHE_FLASH_ATTR
user_wps_key_short_press(void)
{
wifi_wps_disable();
wifi_wps_enable(WPS_TYPE_PBC);
wifi_set_wps_cb(user_wps_status_cb);
wifi_wps_start();
}
void ICACHE_FLASH_ATTR
user_rf_pre_init(void)
{
}
void ICACHE_FLASH_ATTR
user_init(void)
{
single_key = key_init_single(WPS_KEY_IO_NUM, WPS_KEY_IO_MUX, WPS_KEY_IO_FUNC,
NULL, user_wps_key_short_press);
keys.key_num = WPS_KEY_NUM;
keys.single_key = &single_key;
key_init(&keys);
wifi_set_opmode(STATION_MODE);
}
Statistics: Posted by russus — Wed Nov 23, 2016 7:07 pm