According to my interpretation of the NodeMCU doc's the config statement for AP mode is in the form wifi.ap.config(cfg) Where:
ssid =SSID chars 1-32
pwd= password chars 8-64
auth =authentication method, one of wifi.OPEN (default), wifi.WPA_PSK, wifi.WPA2_PSK, wifi.WPA_WPA2_PSK
channel= channel number 1-14 default = 6
hidden= 0 = not hidden, 1 = hidden, default 0
max maximal number of connections =1-4 default=4
beacon= beacon interval time in range 100-60000, default = 100
I'm loading via ESPlorer IDE.
If I omit the password parameter as well as auth parameters, all together I can connect (sometimes) but one android phone shows a secure wpa/psk connection no matter how I set the auth parameter. According to what I read (i think) it says (using lua ) the parameter "wifi.OPEN" should set it to unprotected access, so I’m puzzled as to why is doesn’t change. My laptop won’t connect at all (using windows 10) in this configuration, simply stating "cannot connect to this network". Then if I enter the auth parameter (auth=wifi.OPEN) I get an error at compile time that says it was expecting a numeric (not string) entry. So I entered a 0 (zero), and the compiler took it but nothing changed. Similarly If I enter a password parameter, sometimes it will connect, sometime it doesn't.
For those in the NodeMCU community, the documentation on this is very sketchy. I’ve read on some sites that trying to configure AP mode at high uart speed can give issues, but as far as upload speed goes, ESPlorer uart speed is 9600 by default.
This has all been using a generic ESP12E, flashed with NodeMCU, using ESPlorer as an IDE. When configuring the module in station mode, I have had no issues, and I can connect to the module via my router with any device I have with a browser; It is connecting directly in the AP mode (or stationap) that causes issues. I’ve placed some snippets and noted results below. Any explanation of this qwerkyness , would be greatly appreciated. I used 3 different android phones and a Lenovo T500 notebook I've placed some config snippets and their results below:
wifi.setmode(wifi.SOFTAP)
wifi.setphymode(wifi.PHYMODE_B)
wifi.ap.config({ssid="ESP-12#3"})
The LG Lucid II will connect (sometimes). The Samsung core prime will not, the LG G-4 will not, (NOTE it returns a message stating “password was not accepted) (yes, the password was entered correctly, the Lenovo T500 will.
Nothing connected using below:
wifi.setmode(wifi.SOFTAP)
wifi.setphymode(wifi.PHYMODE_B)
wifi.ap.config({ssid="ESP-12#3",pwd="passpass",auth=0})
If I put any of these in:
wifi.ap.config({ssid="ESP-12#3",pwd="passpass",auth="wifi.WPA_WPA2_PSK"})
wifi.ap.config({ssid="ESP-12#3",pwd="passpass",auth="wifi.OPEN"})
wifi.ap.config({ssid="ESP-12#3",pwd="passpass",auth="wifi.WPA_PSK"})
wifi.ap.config({ssid="ESP-12#3",pwd="passpass",auth="wifi.WPA2_PSK"})
When pressing the “save to ESP button”, I get
NodeMCU 0.9.6 build 20150704 stdin:1: bad argument #-1 to 'config' (number expected, got string)