Statistics: Posted by michelepa — Tue Jan 31, 2023 9:36 pm
Statistics: Posted by peter.hanak — Tue Oct 11, 2022 7:50 pm
Statistics: Posted by st0ff3r — Tue Feb 01, 2022 5:54 am
Statistics: Posted by ChrisO — Tue Feb 01, 2022 3:25 am
Statistics: Posted by st0ff3r — Mon Jan 31, 2022 5:27 am
Statistics: Posted by st0ff3r — Sun Jan 23, 2022 11:48 am
Statistics: Posted by ChrisO — Sat Jan 15, 2022 3:44 am
Statistics: Posted by ChrisO — Tue Jan 11, 2022 6:03 am
Statistics: Posted by st0ff3r — Tue Nov 30, 2021 8:38 am
Code:
static os_timer_t wifi_scan_timer;
static void wifi_scan_timer_func(void *arg);
ICACHE_FLASH_ATTR
void wifi_scan_done_cb(void *arg, STATUS status) {
struct bss_info *info;
if ((arg != NULL) && (status == OK)) {
info = (struct bss_info *)arg;
while (info != NULL) {
os_printf("channel: %d, ssid: %s, bssid %02x:%02x:%02x:%02x:%02x:%02x, rssi: %d, freq_offset: %d, freqcal_val: %d\n\r", info->channel,
info->ssid,
info->bssid[0],
info->bssid[1],
info->bssid[2],
info->bssid[3],
info->bssid[4],
info->bssid[5],
info->rssi,
info->freq_offset,
info->freqcal_val
);
info = info->next.stqe_next;
}
}
}
static void ICACHE_FLASH_ATTR wifi_scan_timer_func(void *arg) {
wifi_station_scan(NULL, wifi_scan_done_cb);
}
ICACHE_FLASH_ATTR void system_init_done(void) {
struct station_config stationConf;
wifi_set_opmode_current(STATIONAP_MODE);
memset(&stationConf, 0, sizeof(struct station_config));
wifi_station_get_config(&stationConf);
os_memcpy(&stationConf.ssid, "Loppen Public", 32);
os_memcpy(&stationConf.password, "", 64);
wifi_station_set_config_current(&stationConf);
wifi_station_connect();
os_timer_disarm(&wifi_scan_timer);
os_timer_setfn(&wifi_scan_timer, (os_timer_func_t *)wifi_scan_timer_func, NULL);
os_timer_arm(&wifi_scan_timer, 5000, 1);
}
ICACHE_FLASH_ATTR void user_init(void) {
system_update_cpu_freq(160);
uart_init(BIT_RATE_115200, BIT_RATE_115200);
wifi_set_opmode_current(NULL_MODE);
wifi_station_disconnect();
system_init_done_cb(&system_init_done);
}
Statistics: Posted by st0ff3r — Sun Nov 28, 2021 9:04 am
Statistics: Posted by yangye — Thu Jul 15, 2021 3:05 pm
Statistics: Posted by Barecatainmb — Mon May 03, 2021 2:56 pm
Statistics: Posted by st0ff3r — Mon Mar 29, 2021 11:55 pm
Statistics: Posted by st0ff3r — Fri Mar 26, 2021 9:59 pm
Statistics: Posted by ESP_Faye — Fri Mar 26, 2021 4:13 pm
Statistics: Posted by st0ff3r — Sat Mar 13, 2021 7:16 am
Statistics: Posted by ESP_Faye — Fri Mar 12, 2021 3:44 pm
Statistics: Posted by GreenLoofa — Fri Mar 05, 2021 5:28 am
Statistics: Posted by st0ff3r — Thu Mar 04, 2021 9:18 pm
Statistics: Posted by ESP_Faye — Thu Mar 04, 2021 10:04 am
Statistics: Posted by st0ff3r — Sun Feb 28, 2021 8:09 am
Statistics: Posted by st0ff3r — Sun Feb 28, 2021 5:50 am
Statistics: Posted by faeton — Fri Feb 19, 2021 1:26 pm
Statistics: Posted by ESP_Faye — Thu Feb 18, 2021 2:24 pm
Statistics: Posted by kuzulis — Tue Jan 12, 2021 9:23 pm
Statistics: Posted by st0ff3r — Tue Jan 05, 2021 9:07 am
Statistics: Posted by ESP_Faye — Tue Dec 29, 2020 11:10 am
Statistics: Posted by st0ff3r — Mon Dec 28, 2020 7:41 am
Statistics: Posted by st0ff3r — Thu Jun 04, 2020 7:42 am
Statistics: Posted by RFZ — Sun Apr 19, 2020 1:58 am
Statistics: Posted by Sharon Nisha — Mon Apr 13, 2020 11:10 pm
Statistics: Posted by Her Mary — Fri Feb 28, 2020 10:19 am
Statistics: Posted by Richard — Sat Feb 01, 2020 12:34 am
Statistics: Posted by Guest — Mon Jan 13, 2020 11:07 pm
Code:
wifi_set_opmode(STATION_MODE);
struct station_config wifi_config;
memset(&wifi_config, 0, sizeof(wifi_config));
strcpy((char*)wifi_config.ssid, ssid);
wifi_station_set_config(&wifi_config);
wifi_station_dhcpc_start();
wifi_station_clear_cert_key();
wifi_station_set_wpa2_enterprise_auth(1);
wifi_station_set_enterprise_identity((uint8*)username, strlen(username));
wifi_station_set_enterprise_username((uint8*)username, strlen(username));
wifi_station_set_enterprise_password((uint8*)password, strlen(password));
wifi_station_set_enterprise_ca_cert((byte*)ca_cert, strlen(ca_cert));
wifi_station_connect();
Code:
Ticker timer;
bool connected = true;
timer.attach(5, [&](){connected = false;});
while (WiFi.status() != WL_CONNECTED) {
delay(10);
}
timer.detach();
bool connect() {
wifi_set_opmode(STATION_MODE);
struct station_config wifi_config;
memset(&wifi_config, 0, sizeof(wifi_config));
strcpy((char*)wifi_config.ssid, ssid);
wifi_station_set_config(&wifi_config);
wifi_station_dhcpc_start();
wifi_station_clear_cert_key();
wifi_station_set_wpa2_enterprise_auth(1);
wifi_station_set_enterprise_identity((uint8*)username, strlen(username));
wifi_station_set_enterprise_username((uint8*)username, strlen(username));
wifi_station_set_enterprise_password((uint8*)password, strlen(password));
wifi_station_set_enterprise_ca_cert((byte*)ca_cert, strlen(ca_cert));
wifi_station_connect();
Ticker timer;
bool connected = true;
timer.attach(5, [&](){connected = false;});
while (WiFi.status() != WL_CONNECTED) {
delay(10);
}
timer.detach();
return connected;
}
void connectBlock(){
while(!connect()){
delay(100);
}
}
Statistics: Posted by Guest — Mon Jan 13, 2020 8:39 pm
Code:
AT version:1.6.2.0(Apr 13 2018 11:10:59)
SDK version:2.2.1(6ab97e9)
compile time:Jun 7 2018 19:34:29
Bin version(Wroom 02):1.6.2
Code:
...
OK
>
Recv 14 bytes
0,CONNECT FAIL
SEND FAIL
Statistics: Posted by Guest — Mon Dec 02, 2019 7:10 pm