return function (connection, req, args) dofile('httpserver-header.lc')(connection, 200, 'html') connection:send('System Info') connection:send('

Chip ID: '..node.chipid()..'

') connection:send('

Flash ID: '..node.flashid()..'

') connection:send('

Heap: '..node.heap()..'

') connection:send('

Info: '..node.info()..'

') connection:send('

Vdd: '..adc.readvdd33()..' mV

') local address, size = file.fscfg() connection:send('

File System Address: '..address..'

') connection:send('

File System Size: '..size..' bytes

') local tm = rtctime.epoch2cal(rtctime.get()) connection:send('

RTC Time: '..string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])..'

') local remaining, used, total = file.fsinfo() connection:send('

File System Usage: '..used..' / '..total..' bytes

') connection:send('

Wifi STA MAC Address: '..wifi.sta.getmac()..'

') connection:send('

Wifi AP MAC Address: '..wifi.ap.getmac()..'

') connection:send('

WiFi Channel: '..wifi.getchannel()..'

') local wifimode = wifi.getmode() if wifimode == wifi.STATION then connection:send('

WiFi Mode: STATION

') elseif wifimode == wifi.SOFTAP then connection:send('

WiFi Mode: SOFTAP

') elseif wifimode == wifi.STATIONAP then connection:send('

WiFi Mode: STATIONAP

') elseif wifimode == wifi.NULLMODE then connection:send('

WiFi Mode: NULLMODE

') end if (wifimode == wifi.STATIONAP) or (wifimode == wifi.SOFTAP) then local ip, netmask, gateway = wifi.ap.getip() connection:send('

AP IP: '..ip..'

') connection:send('

AP netmask: '..netmask..'

') connection:send('

AP gateway: '..gateway..'

') connection:send('

AP client list: ') local clients = wifi.ap.getclient() for mac, ip in pairs(clients) do connection:send('

'..mac..': '..ip..'

') end connection:send('

') end local wifiphymode = wifi.getphymode() if wifiphymode == wifi.PHYMODE_B then connection:send('

WiFi Physical Mode: B

') elseif wifiphymode == wifi.PHYMODE_G then connection:send('

WiFi Physical Mode: G

') elseif wifiphymode == wifi.PHYMODE_N then connection:send('

WiFi Physical Mode: N

') end local status = wifi.sta.status() if status == wifi.STA_IDLE then connection:send('

wifi.sta.status: STA_IDLE

') elseif status == wifi.STA_CONNECTING then connection:send('

wifi.sta.status: STA_CONNECTING

') elseif status == wifi.STA_WRONGPWD then connection:send('

wifi.sta.status: STA_WRONGPWD

') elseif status == wifi.STA_APNOTFOUND then connection:send('

wifi.sta.status: STA_APNOTFOUND

') elseif status == wifi.STA_FAIL then connection:send('

wifi.sta.status: STA_FAIL

') elseif status == wifi.STA_GOTIP then connection:send('

wifi.sta.status: STA_GOTIP

') connection:send('

Hostname: '..wifi.sta.gethostname()..'

') local ip, netmask, gateway = wifi.sta.getip() connection:send('

STA IP: '..ip..'

') connection:send('

STA netmask: '..netmask..'

') connection:send('

STA gateway: '..gateway..'

') local ssid, password, bssid_set, bssid = wifi.sta.getconfig() connection:send('

SSID: '..ssid..'

') -- connection:send('

password: '..password..'

') -- not sure if it should be shown. connection:send('

BSSID set: '..bssid_set..'

') connection:send('

BSSID: '..bssid..'

') connection:send('

STA Broadcast IP: '..wifi.sta.getbroadcast()..'

') connection:send('

RSSI: '..wifi.sta.getrssi()..' dB

') end connection:send('') end