scargill wrote:I'm struggling here.
I also know how to set the thing into WIFI mode... and os I wrote this startup file - sadly it shows 0.0.0.0 BEFORE and 0,0,0,0 AFTER. I can think of no way to use this stand-alone - if you can't set up the wifi on powerup ???
I use this function, i think it is (very) identical you yours.
-- connect as station to a Wifi Access Point
-- Use as : connecttoap("yourSSID","yourpassword")
connecttoap = function (ssid,pw)
print(wifi.sta.getip())
wifi.setmode(wifi.STATION)
wifi.sta.config(ssid,pw)
print("Connected to ",ssid," as ",wifi.sta.getip())
end
It takes a few seconds for the ESP to obtain the IP, so the print will list the ip as 0.0.0.0.
You could add a tmr.delay() statement after the wifi.sta.config statement.
Hope this helps, so far the environment works for me.