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

User avatar
By Arlin
#42075 I'm a novice programmer and completely new to the ESP8266. I'm trying to run some basic examples from the docs using a Feather Huzzah ESP8266 module from Adafruit.

I get this error when I call the wifi.sta.getap() function: > PANIC: unprotected error in call to Lua API (stdin:2: bad argument #1 to 'pairs' (table or rotable expected, got nil))

Similarly when I call '=wifi.sta.getconfig()' I get this error: stdin:1: attempt to call field 'getconfig' (a nil value)

Some commands work fine. For instance '=wifi.sta.status()' gives a result of '5'.

Here's the version information that shows at start up:NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4
Is this an earlier build that doesn't support these commands?

Any help will be really appreciated!
User avatar
By dnc40085
#42138 Hello, as in the example
First of all, welcome to the esp8266.com forum you should start out by getting the latest build of NodeMCU from http://www.nodemcu-build.com, the dev branch is the most current but not as stable as the master branch.

A few bugs have been fixed since 0.9.5, but I'm pretty sure both wifi.sta.getconfig and wifi.sta.getap should be there and should work with the examples.
With wifi.sta.getap() it seems that you executed "listap()" rather than "wifi.sta.getap(listap)"