return function (connection, req, args) local staConfig = {ssid="", pwd=""} -- Check for a wifi config file if file.open("wificonfig.lua") then file.close() print('Found config.') local res = pcall(dofile("wificonfig.lua")) if (res) then staConfig = dofile("wificonfig.lua")() end end connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n") connection:send('
') connection:send("SSID: "..staConfig.ssid) connection:send("\nPassword: "..staConfig.pwd) connection:send("\nSTA IP: "..wifi.sta.getip()) connection:send("\nMAC: "..wifi.sta.getmac()) connection:send("\nstatus: "..wifi.sta.status()) connection:send([===[ Statuses: 0: IDLE 1: CONNECTING 2: WRONG_PASSWORD 3: NO AP FOUND 4: CONNECT FAIL 5: GOT IP/CONNECTED ]===]) connection:send('