From 107a24590c72e35e947876ef139acea28d0747b8 Mon Sep 17 00:00:00 2001 From: mroavi Date: Sun, 19 Jun 2016 07:49:27 +0200 Subject: [PATCH] Fixes the Makefile's wifi station hardcoding functionality when starting in SOFTAP_MODE (#150) * Bug fixed * Change to mode STATIONAP_MODE at startup only if STA_SSID and STA_PASS are defined. --- esp-link/cgiwifi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esp-link/cgiwifi.c b/esp-link/cgiwifi.c index 6b88167..9dc694a 100644 --- a/esp-link/cgiwifi.c +++ b/esp-link/cgiwifi.c @@ -851,6 +851,8 @@ void ICACHE_FLASH_ATTR wifiInit() { os_strncpy((char*)stconf.ssid, VERS_STR(STA_SSID), 32); os_strncpy((char*)stconf.password, VERS_STR(STA_PASS), 64); + wifi_set_opmode(3); + DBG("Wifi pre-config trying to connect to AP %s pw %s\n",(char*)stconf.ssid, (char*)stconf.password); // wifi_set_phy_mode(2); // limit to 802.11b/g 'cause n is flaky