24 lines
542 B
Lua

-- Tell the chip to connect to the access point
print('Welcome')
wifi.setmode(wifi.STATION)
print('set mode=STATION (mode='..wifi.getmode()..')')
print('MAC: ',wifi.sta.getmac())
print('chip: ',node.chipid())
print('heap: ',node.heap())
wifi.sta.config("Internet","")
-- Wait until WiFi connection is established
tmr.alarm(0, 2000, 1, function()
if wifi.sta.getip() == nil then
print("Connecting to AP...")
else
print('IP: ',wifi.sta.getip())
tmr.stop(0)
end
end)
--dofile("garage.lua")