srv:close(); srv:close(); srv=net.createServer(net.TCP); srv:listen(80,function(conn) conn:on("receive",function(conn,payload) ptop = string.sub(payload, 0, 20); if(string.match(ptop, "ledon")) then gpio.write(0, 0); else gpio.write(0, 1); end print(payload); conn:send("HTTP/1.0 200\r\n"); conn:send("content-type: text/html\r\n"); conn:send("\r\n"); conn:send("\n

leds

\n"); conn:send("
"); conn:send("LED on


\r\n"); conn:send("LED off
\r\n"); conn:send("
\r\n"); conn:close(); end) end); l = file.list(); for k,v in pairs(l) do print("name:"..k..", size:"..v) end gpio.mode(0, gpio.OUTPUT);