As the title says... Chat on...

User avatar
By flagtrax
#55699 Using NodeMCU/lua, I've encountered several issues trying to connect in AP mode.
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:
Code: Select allwifi.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:
Code: Select allwifi.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:
Code: Select allwifi.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)
User avatar
By marcelstoer
#55786
flagtrax wrote:
Code: Select allwifi.setmode(wifi.SOFTAP)
wifi.setphymode(wifi.PHYMODE_B)
wifi.ap.config({ssid="ESP-12#3"})



That's an invalid SSID I think, try 'ESP-12-3' or 'ESP123'.

flagtrax wrote:NodeMCU 0.9.6 build 20150704 stdin:1: bad argument #-1 to 'config' (number expected, got string)


Those old 0.9.x binaries are hopelessly outdated and no longer supported. Build and flash a recent version first.
User avatar
By flagtrax
#55814
marcelstoer wrote:
flagtrax wrote:
Code: Select allwifi.setmode(wifi.SOFTAP)
wifi.setphymode(wifi.PHYMODE_B)
wifi.ap.config({ssid="ESP-12#3"})



That's an invalid SSID I think, try 'ESP-12-3' or 'ESP123'.

Those old 0.9.x binaries are hopelessly outdated and no longer supported. Build and flash a recent version first.

Thanks for the reply, geesh, I feel hopeless sometimes :? as soon as I learn something it's obsolete :lol: ...maybe if I had more time to keep up...I thought I'd gone to the proper place for the latest update, which steered me to the documentation. I'll try to muddle through a new build, and change the ssid, and post results so other "slow movers" might glean something from it. Thanks again.
User avatar
By marcelstoer
#55825
flagtrax wrote:I thought I'd gone to the proper place for the latest update, which steered me to the documentation.


What place would that be?

http://nodemcu.com/ points you either to the GitHub repo or the docs. Both of those resources make it clear on their respective entry pages how to get hold of a firmware binary (I think). Of course we're always eager to learn how we could improve. Bring forth those suggestions...