Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad argument #1 to 'config' (config table not found!) #2143

Closed
kingdevnl opened this issue Oct 19, 2017 · 2 comments
Closed

bad argument #1 to 'config' (config table not found!) #2143

kingdevnl opened this issue Oct 19, 2017 · 2 comments

Comments

@kingdevnl
Copy link

kingdevnl commented Oct 19, 2017

The example code on the Website gives me this error: bad argument #1 to 'config' (config table not found!)

The lua code:

wifi.setmode(wifi.STATION)
wifi.sta.config("SSID","password")
print(wifi.sta.getip())

I download the firmware from the Cloud build site

@marcelstoer
Copy link
Member

@timothyparez
Copy link

The reason people keep stumbling on this one is because the example by @kingdevnl
is the first thing we see on the official website while the updated docs tell a different story.

From the official website:

print(wifi.sta.getip())
--nil
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID","password")
print(wifi.sta.getip())
--192.168.18.110

And from the docs:

station_cfg={}
station_cfg.ssid="NODE-AABBCC"
station_cfg.pwd="password"
station_cfg.save=false
wifi.sta.config(station_cfg)

At some point the API must have changed and the main page was never updated.
I ran into this issue today.
Perhaps we can re-open this issue until the main page is fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants