-- CONFIG --
SSID = "bbox2-1bb0"
PWD = "password"
------------
-- Connect to Wi-Fi network
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID, PWD)
-- Wait for connection
repeat
tmr.delay(1000) -- 1000ms
until wifi.sta.status() == 5 -- STATION_GOT_IP
print("Connected to network " .. SSID)
print("IP: " .. wifi.sta.getip())
OR
-- CONFIG --
SSID = "bbox2-1bb0"
PWD = "password"
------------
-- Connect to Wi-Fi network
wifi.setmode(wifi.STATION)
wifi.sta.config(SSID, PWD)
-- Wait for connection
repeat
tmr.delay(1000) -- 1000ms
until wifi.sta.getip() ~= nil
print("Connected to network " .. SSID)
print("IP: " .. wifi.sta.getip())
What code should I go with and why?