-->
Page 1 of 2

wifi.ap.setip() dosen't seem to work

PostPosted: Wed Mar 18, 2015 6:20 pm
by mash_172
I think I have the code correct however

Code: Select allwifi.setmode(wifi.SOFTAP)
wifi.ap.config({ssid="myssid",pwd="password"})
wifi.ap.setip({ip="192.168.1.254",netmask="255.255.255.0",gateway="192.168.1.254"})
print(wifi.ap.getip())

returns this
NodeMCU 0.9.5 build 20150127 powered by Lua 5.1.4
lua: cannot open init.lua
> dofile('test.lua')
192.168.4.1 255.255.255.0 192.168.4.1
>


the IP address doesn't seem to want to move from 192.168.4.1 when using with other ESP's I am unable to avoid address conflicts so would love this feature.

Re: wifi.ap.setip() dosen't seem to work

PostPosted: Thu Mar 19, 2015 3:51 pm
by mash_172
OK Time to answer my own post hopefully it will help somebody else

NodeMCU 0.9.5 build 20150318 powered by Lua 5.1.4
lua: cannot open init.lua
> dofile('test.lua')
192.168.1.254 255.255.255.0 192.168.1.254


looks like build 20150318 has fixed it, yeay.

Re: wifi.ap.setip() dosen't seem to work

PostPosted: Tue Jun 02, 2015 4:26 am
by ashwinispatil
how did you get this answer.
I am suffering same problem tried alot but not get any solution till now.
Please help me out.

Re: wifi.ap.setip() dosen't seem to work

PostPosted: Tue Jun 02, 2015 9:08 am
by enaon
--set ap ip
cfg =
{
ip="X.X.X.X",
netmask="X.X.X.X",
gateway="X.X.X.X"
}
wifi.ap.setip(cfg)

using a current firmware ( I use this web service: viewtopic.php?f=23&t=3001)