Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- HTTP/1.1 200 OK
- Content-Type: text/html; charset=utf-8
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Shiny Lights</title>
- <link rel="stylesheet" href="/s.css">
- </head>
- <body>
- <h1>Confiure your shiny lights</h1>
- <form action="/" method="post">
- nil
- Made this far
- forcing connection
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (not enough memory)
- PANIC: unprotected error in call to Lua API (attempt to call a string value)
- c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > file.remove("setup.lua");
- > file.open("setup.lua","w+");
- > w = file.writeline
- > w([[mac, cnt = string.gsub(wifi.ap.getmac(), "-", "")]]);
- > w([[cfg={}]]);
- > w([[cfg.ssid="LEDS:" .. mac]]);
- > w([[cfg.pwd="shinylights"]]);
- > w([[wifi.setmode(wifi.STATIONAP)]]);
- > w([[wifi.ap.config(cfg)]]);
- > w([[]]);
- > w([[currentAPs = {}]]);
- > w([[]]);
- > w([[newssid = ""]]);
- > w([[]]);
- > w([[function listAPs_callback(t)]]);
- > w([[ if(t==nil) then]]);
- > w([[ return]]);
- > w([[ end]]);
- > w([[ currentAPs = t]]);
- > w([[end]]);
- > w([[]]);
- > w([[function listAPs()]]);
- > w([[ print("Getting aps")]]);
- > w([[ wifi.sta.getap(listAPs_callback)]]);
- > w([[end]]);
- > w([[tmr.alarm(0, 15000, 1, listAPs)]]);
- > w([[listAPs()]]);
- > w([[]]);
- > w([[srv=net.createServer(net.TCP)]]);
- > w([[srv:listen(80, function(conn)]]);
- > w([[ conn:on("receive", function(client, payload)]]);
- > w([[ print("New request....")]]);
- > w([[ local req = dofile("http.lua").parse(payload)]]);
- > w([[ print("Req was parsed")]]);
- > w([[ local sent = dofile("setup.router.lua").route(client, req)]]);
- > w([[ if sent == false then]]);
- > w([[ print("yeh bad news bear")]]);
- > w([[ client:send("HTTP/1.1 400 Bad Request\r\n\r\n")]]);
- > w([[ }]]);
- > w([[ end)]]);
- > w([[]]);
- > w([[ conn:on("sent", function(client)]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[end)]]);
- > file.close();
- > dofile("setup.lua");
- setup.lua:36: unexpected symbol near '}'
- > file.remove("setup.lua");
- > file.open("setup.lua","w+");
- > w = file.writeline
- > w([[mac, cnt = string.gsub(wifi.ap.getmac(), "-", "")]]);
- > w([[cfg={}]]);
- > w([[cfg.ssid="LEDS:" .. mac]]);
- > w([[cfg.pwd="shinylights"]]);
- > w([[wifi.setmode(wifi.STATIONAP)]]);
- > w([[wifi.ap.config(cfg)]]);
- > w([[]]);
- > w([[currentAPs = {}]]);
- > w([[]]);
- > w([[newssid = ""]]);
- > w([[]]);
- > w([[function listAPs_callback(t)]]);
- > w([[ if(t==nil) then]]);
- > w([[ return]]);
- > w([[ end]]);
- > w([[ currentAPs = t]]);
- > w([[end]]);
- > w([[]]);
- > w([[function listAPs()]]);
- > w([[ print("Getting aps")]]);
- > w([[ wifi.sta.getap(listAPs_callback)]]);
- > w([[end]]);
- > w([[tmr.alarm(0, 15000, 1, listAPs)]]);
- > w([[listAPs()]]);
- > w([[]]);
- > w([[srv=net.createServer(net.TCP)]]);
- > w([[srv:listen(80, function(conn)]]);
- > w([[ conn:on("receive", function(client, payload)]]);
- > w([[ print("New request....")]]);
- > w([[ local req = dofile("http.lua").parse(payload)]]);
- > w([[ print("Req was parsed")]]);
- > w([[ local sent = dofile("setup.router.lua").route(client, req)]]);w([[ if sent == false then]]);
- > w([[ print("yeh bad news bear")]]);
- > w([[ client:send("HTTP/1.1 400 Bad Request\r\n\r\n")]]);
- > w([[ end]]);
- > w([[ end)]]);
- > w([[]]);
- > w([[ conn:on("sent", function(client)]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[end)]]);
- > file.close();
- > dofile("setup.lua");
- Getting aps
- > Getting aps
- file.remove("setup.index.lua");
- > file.open("setup.index.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (setup.router.lua:16: attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PAWaiting answer from ESP - Timeout reached. Command aborted.NIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a nil value)
- PANIC: unprotected error in call to Lua API (attempt to index a c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > file.remove("setup.index.lua");
- > file.open("setup.index.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- > w([[]]);
- > w([[function M.render(client, req)]]);
- > w([[ file.open("setup.header", "r")]]);
- > w([[ repeat]]);
- > w([[ local line = file.read(1460)]]);
- > w([[ print(line)]]);
- > w([[ if line then client:send(line) end]]);
- > w([[ until not line ]]);
- > w([[ file.close()]]);
- > w([[ mac = wifi.sta.getmac()]]);
- > w([[ client:send("<p>This device's wifi mac is: " .. mac .. "</p>")]]);
- > w([[]]);
- > w([[ for ssid, v in pairs(currentAPs) do]]);
- > w([[ authmode, rssi, bssid, channel = string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)")]]);
- > w([[ sssid = string.gsub(ssid, "\"", """)]]);
- > w([[ client:send(]]);
- > w([[ string.format(]]);
- > w([[ "<div><label><span class=\"%s\">%s</span><input type=\"radio\" name=\"ssid\" value=\"%s\">%s</label></div>",]]);
- > w([[ string.char(97 + tonumber(authmode)),]]);
- > w([[ (tonumber(authmode) < 1 and "d" or "e"),]]);
- > w([[ sssid,]]);
- > w([[ ssid]]);
- > w([[ ) -- rssi no rssi.. wnat rssi (a, b, c are low med high)]]);
- > w([[ )]]);
- > w([[ end]]);
- > w([[ client:send("<input type=\"password\" name=\"password\" placeholder=\"Password\"><br/>")]]);w([[ client:send("<input type=\"submit\" value=\"Save\">")]]);
- > w([[ client:send("</form></body></html>", function()]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[ return true]]);
- > w([[end]]);
- > w([[ ]]);
- > w([[return M]]);
- > file.close();
- > dofile("setup.index.lua");
- > file.remove("setup.lua");
- > file.open("setup.lua","w+");
- > w = file.writeline
- > w([[mac, cnt = string.gsub(wifi.ap.getmac(), "-", "")]]);
- > w([[cfg={}]]);
- > w([[cfg.ssid="LEDS:" .. mac]]);
- > w([[cfg.pwd="shinylights"]]);
- > w([[wifi.setmode(wifi.STATIONAP)]]);
- > w([[wifi.ap.config(cfg)]]);
- > w([[]]);
- > w([[currentAPs = {}]]);
- > w([[]]);
- > w([[newssid = ""]]);
- > w([[]]);
- > w([[function listAPs_callback(t)]]);
- > w([[ if(t==nil) then]]);
- > w([[ return]]);
- > w([[ end]]);
- > w([[ currentAPs = t]]);
- > w([[end]]);
- > w([[]]);
- > w([[function listAPs()]]);
- > w([[ print("Getting aps")]]);
- > w([[ wifi.sta.getap(listAPs_callback)]]);
- > w([[end]]);
- > w([[tmr.alarm(0, 15000, 1, listAPs)]]);
- > w([[listAPs()]]);
- > w([[]]);
- > w([[srv=net.createServer(net.TCP)]]);
- > w([[srv:listen(80, function(conn)]]);
- > w([[ conn:on("receive", function(client, payload)]]);
- > w([[ print("New request....")]]);
- > w([[ local req = dofile("http.lua").parse(payload)]]);
- > w([[ print("Req was parsed")]]);
- > w([[ local sent = dofile("setup.router.lua").route(client, req)]]);
- > w([[ if sent == false then]]);
- > w([[ print("yeh bad news bear")]]);
- > w([[ client:send("HTTP/1.1 400 Bad Request\r\n\r\n")]]);
- > w([[ end]]);
- > w([[ end)]]);
- > w([[]]);
- > w([[ conn:on("sent", function(client)]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[end)]]);
- > file.close();
- > dofile("setup.lua");
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- HTTP/1.1 200 OK
- Content-Type: text/html; charset=utf-8
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Shiny Lights</title>
- <link rel="stylesheet" href="/s.css">
- </head>
- <body>
- <h1>Confiure your shiny lights</h1>
- <form action="/" method="post">
- nil
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (not enough memory)
- PANIC: unprotected error in call to Lua API (attempt to call a string value)
- _ÇÏRSöfJSúfJSüâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.0
- Req was parsed
- HTTP/1.1 200 OK
- Content-Type: text/html; charset=utf-8
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Shiny Lights</title>
- <link rel="stylesheet" href="/s.css">
- </head>
- <body>
- <h1>Confiure your shiny lights</h1>
- <form action="/" method="post">
- nil
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúfJSúâîø
- Communication with MCU..Got answer! AutoDetect firmware...
- Can't autodetect firmware, because proper answer not received.
- U 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > file.remove("setup.index.lua");
- > file.open("setup.index.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- > w([[]]);
- > w([[function M.render(client, req)]]);
- > w([[ file.open("setup.header", "r")]]);
- > w([[ repeat]]);
- > w([[ local line = file.read(1460)]]);
- > w([[ print(line)]]);
- > w([[ if line then client:send(line) end]]);
- > w([[ until not line ]]);
- > w([[ file.close()]]);
- > w([[ mac = wifi.sta.getmac()]]);
- > w([[ client:send("<p>This device's wifi mac is: " .. mac .. "</p>")]]);
- > w([[print("here...")]]);
- > w([[ for ssid, v in pairs(currentAPs) do]]);
- > w([[ print(ssid)]]);
- > w([[ authmode, rssi, bssid, channel = string.match(v, "(%d),(-?%d+),(%x%x:%x%x:%x%x:%x%x:%x%x:%x%x),(%d+)")]]);
- > w([[ sssid = string.gsub(ssid, "\"", """)]]);
- > w([[ client:send(]]);
- > w([[ string.format(]]);
- > w([[ "<div><label><span class=\"%s\">%s</span><input type=\"radio\" name=\"ssid\" value=\"%s\">%s</label></div>",]]);
- > w([[ string.char(97 + tonumber(authmode)),]]);
- > w([[ (tonumber(authmode) < 1 and "d" or "e"),]]);
- > w([[ sssid,]]);
- > w([[ ssid]]);
- > w([[ ) -- rssi no rssi.. wnat rssi (a, b, c are low med high)]]);
- > w([[ )]]);
- > w([[ end]]);
- > w([[ client:send("<input type=\"password\" name=\"password\" placeholder=\"Password\"><br/>")]]);w([[ client:send("<input type=\"submit\" value=\"Save\">")]]);
- > w([[ print("almost done")]]);
- > w([[ client:send("</form></body></html>", function()]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[ return true]]);
- > w([[end]]);
- > w([[ ]]);
- > w([[return M]]);
- > file.close();
- > dofile("setup.index.lua");
- > Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 18976
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.0
- Req was parsed
- HTTP/1.1 200 OK
- Content-Type: text/html; charset=utf-8
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Shiny Lights</title>
- <link rel="stylesheet" href="/s.css">
- </head>
- <body>
- <h1>Confiure your shiny lights</h1>
- <form action="/" method="post">
- nil
- here...
- foobar2.0
- sarahdarren
- linksys
- TP-LINK_2.4GHz_99C47B
- BigPond5EB02B
- Javalink
- OPTUS_2C363E
- almost done
- Getting aps
- Getting aps
- New request....
- GET /s.css HTTP/1.0
- Req was parsed
- Getting aps
- Getting aps
- New request....
- GET /s.js HTTP/1.0
- Req was parsed
- yeh bad news bear
- Closing connection
- Getting aps
- Getting aps
- Getting aps
- New request....
- GET /j.js HTTP/1.0
- Req was parsed
- Getting aps
- Getting aps
- file.remove("setup.router.lua");
- > file.open("setup.router.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- > w([[]]);
- > w([[local route = {]]);
- > w([[ ["GET:/"] = "setup.index.lua",]]);
- > w([[ ["GET:/test"] = "setup.test.lua",]]);
- > w([[ ["POST:/"] = "setup.save.lua",]]);
- > w([[ ["GET:/s.css"] = "setup.css",]]);
- > w([[ ["GET:/j.js"] = "setup.js"]]);
- > w([[}]]);
- > w([[]]);
- > w([[function M.route(client, req)]]);
- > w([[ local r = route[req["method"] .. ":" .. req["uri"]]]]);
- stdin:1: ')' expected near ']'w([[ if r == nil then return false end]]);
- > w([[ local ext = string.match(r, "(\.%w+)$")]]);
- > w([[ if ext == ".lua" or ext == ".lc" then]]);
- > w([[ return dofile(r).render(client, req)]]);
- > w([[ end]]);
- > w([[ return dofile("render.lua").render(r, client, req)]]);
- > w([[end]]);
- > w([[]]);
- > w([[return M]]);
- > file.close();
- > dofile("setup.router.lua");
- > local moduleName = ...
- > local M = {}
- > local route = {
- ["GET:/"] = "setup.index.lua",
- ["GET:/test"] = "setup.test.lua",
- >> ["POST:/"] = "setup.save.lua",
- ["GET:/s.css"] = "setup.css",
- >> ["GET:/j.js"] = "setup.js"
- }
- > function M.route(client, req)
- local r = route[req["method"] .. ":" .. req["uri"]]
- if r == nil then return false end
- local ext = string.match(r, "(\.%w+)$")
- if ext == ".lua" or ext == ".lc" then
- return dofile(r).render(client, req)
- end
- return dofile("render.lua").render(r, client, req)
- end
- stdin:1: attempt to index global 'M' (a nil value)Getting aps
- return M
- nil
- > Uploading to ESP file setup.router.lua...Success
- > Getting aps
- Getting aps
- Getting aps
- file.remove("setup.router.lua");
- > file.open("setup.router.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- > w([[]]);
- > w([[local route = {]]);
- > w([[ ["GET:/"] = "setup.index.lua",]]);
- > w([[ ["GET:/test"] = "setup.test.lua",]]);
- > w([[ ["POST:/"] = "setup.save.lua",]]);
- > w([[ ["GET:/s.css"] = "setup.css",]]);
- > w([[ ["GET:/j.js"] = "setup.js",]]);
- > w([[ ["GET:/h"] = "setup.header"]]);
- > w([[}]]);
- > w([[]]);
- > w([[function M.route(client, req)]]);
- > w([[ local r = route[req["method"] .. ":" .. req["uri"]]]]);
- stdin:1: ')' expected near ']'w([[ if r == nil then return false end]]);
- > w([[ local ext = string.match(r, "(\.%w+)$")]]);
- > w([[ if ext == ".lua" or ext == ".lc" then]]);
- > w([[ return dofile(r).render(client, req)]]);
- > w([[ end]]);
- > w([[ return dofile("render.lua").render(r, client, req)]]);
- > w([[end]]);
- > w([[]]);
- > w([[return M]]);
- > file.close();
- > dofile("setup.router.lua");
- > Uploading to ESP file setup.router.lua...Success
- > Getting aps
- Getting aps
- Getting aps
- New request....
- GET /h HTTP/1.1
- Req was parsed
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- file.remove("setup.lua");
- > file.open("setup.lua","w+");
- > file.remove("setup.lua");
- file.remove("setup.lua");
- > file.open("setup.lua","w+");
- > w = file.writeline
- > w([[apmac, cnt = string.gsub(wifi.ap.getmac(), "-", "")]]);
- > w([[stamac = wifi.sta.getmac()]]);
- > w([[cfg={}]]);
- > w([[cfg.ssid="LEDS:" .. apmac]]);
- > w([[cfg.pwd="shinylights"]]);
- > w([[wifi.setmode(wifi.STATIONAP)]]);
- > w([[wifi.ap.config(cfg)]]);
- > w([[]]);
- > w([[currentAPs = {}]]);
- > w([[]]);
- > w([[newssid = ""]]);
- > w([[]]);
- > w([[function listAPs_callback(t)]]);
- > w([[ if(t==nil) then]]);
- > w([[ return]]);
- > w([[ end]]);
- > w([[ currentAPs = t]]);
- > w([[end]]);
- > w([[]]);
- > w([[function listAPs()]]);
- > w([[ print("Getting aps")]]);
- > w([[ wifi.sta.getap(listAPs_callback)]]);
- > w([[end]]);
- > w([[tmr.alarm(0, 15000, 1, listAPs)]]);
- > w([[listAPs()]]);
- > w([[]]);
- > w([[srv=net.createServer(net.TCP)]]);
- > w([[srv:listen(80, function(conn)]]);
- > w([[ conn:on("receive", function(client, payload)]]);
- > w([[ print("New request....")]]);
- > w([[ local req = dofile("http.lua").parse(payload)]]);
- > w([[ print("Req was parsed")]]);
- > w([[ local sent = dofile("setup.router.lua").route(client, req)]]);
- > w([[ if sent == false then]]);
- > w([[ print("yeh bad news bear")]]);
- > w([[ client:send("HTTP/1.1 400 Bad Request\r\n\r\n")]]);
- > w([[ end]]);
- > w([[ end)]]);
- > w([[]]);
- > w([[ conn:on("sent", function(client)]]);
- > w([[ print("Closing connection")]]);
- > w([[ client:close()]]);
- > w([[ end)]]);
- > w([[end)]]);
- > file.close();
- > dofile("setup.lua");
- Getting aps
- setup.lua:27: only one tcp server allowed
- > Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúfJSúâî
- Communication with MCU...
- Got answer! AutoDetect firmware...
- Can't autodetect firmware, because proper answer not received.
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > Uploading to ESP file setup.index.lua...Success
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- Closing connection
- New request....
- GET /s.css HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/css,*/*;q=0.1
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- New request....
- GET /f.woff HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/s.css
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- yeh bad news bear
- Closing connection
- New request....
- GET /favicon.ico HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- yeh bad news bear
- Closing connection
- Getting aps
- Getting aps
- l = file.list();
- > for k,v in pairs(l) do
- print("name:"..k..", size:"..v)
- end
- name:setup.js, size:1124
- name:render.lua, size:654
- name:setup.header, size:261
- name:setup.router.lua, size:561
- name:http.lua, size:514
- name:setup.index.lua, size:1097
- name:setup.save, size:449
- name:f.woff, size:1320
- name:setup.save.lua, size:644
- name:setup.test.lua, size:363
- name:setup.css, size:355
- name:setup.lua, size:942
- > Getting aps
- Getting aps
- file.remove("setup.router.lua");
- > file.open("setup.router.lua","w+");
- > w = file.writeline
- > w([[local moduleName = ...]]);
- > w([[local M = {}]]);
- > w([[]]);
- > w([[local route = {]]);
- > w([[ ["GET:/"] = "setup.index.lua",]]);
- > w([[ ["GET:/test"] = "setup.test.lua",]]);
- > w([[ ["POST:/"] = "setup.save.lua",]]);
- > w([[ ["GET:/s.css"] = "setup.css",]]);
- > w([[ ["GET:/j.js"] = "setup.js",]]);
- > w([[ ["GET:/f.woff"] = "f.woff"]]);
- > w([[}]]);
- > w([[]]);
- > w([[function M.route(client, req)]]);
- > w([[ local r = route[req["method"] .. ":" .. req["uri"]]]]);
- stdin:1: ')' expected near ']'w([[ if r == nil then return false end]]);
- > w([[ local ext = string.match(r, "(\.%w+)$")]]);
- > w([[ if ext == ".lua" or ext == ".lc" then]]);
- > w([[ return dofile(r).render(client, req)]]);
- > w([[ end]]);
- > w([[ return dofile("render.lua").render(r, client, req)]]);
- > w([[end]]);
- > w([[]]);
- > w([[return M]]);
- > file.close();
- > dofile("setup.router.lua");
- > Getting aps
- Uploading to ESP file setup.router.lua...Success
- > New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (not enough memory)
- PANIC: unprotected error in call to Lua API (attempt to call a string value)
- c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- Closing connection
- New request....
- GET /s.css HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/css,*/*;q=0.1
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- New request....
- GET /f.woff HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/s.css
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- New request....
- GET /favicon.ico HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- yeh bad news bear
- Closing connection
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Uploading to ESP file setup.css...Success
- > New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (not enough memory)
- PANIC: unprotected error in call to Lua API (attempt to call a string value)
- c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- Closing connection
- New request....
- GET /s.css HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/css,*/*;q=0.1
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- New request....
- GET /f.woff HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/s.css
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- New request....
- GET /favicon.ico HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept: */*
- Referer: http://192.168.4.1/
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- yeh bad news bear
- Closing connection
- Getting aps
- =node.heap()
- 10088
- > New request....
- GET / HTTP/1.1
- Host: 192.168.4.1
- Connection: keep-alive
- Cache-Control: max-age=0
- Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
- User-Agent: Mozilla/5.0 (Linux; Android 5.1; Nexus 6 Build/LMY47D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.111 Mobile Safari/537.36
- Accept-Encoding: gzip, deflate, sdch
- Accept-Language: en-AU,en-GB;q=0.8,en-US;q=0.6,en;q=0.4
- Req was parsed
- PANIC: unprotected error in call to Lua API (not enough memory)
- PANIC: unprotected error in call to Lua API (attempt to call a string value)
- c_ÇÏRSöfJSúfJSúâîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > Uploading to ESP file http.lua...Success
- > Uploading to ESP file render.lua...Success
- > Uploading to ESP file setup.header...Success
- > Uploading to ESP file setup.index.lua...Success
- > Uploading to ESP file setup.lua...Success
- > Uploading to ESP file setup.router.lua...Success
- > Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúfJSúâî
- Communication with MCU...
- Got answer! AutoDetect firmware...
- Can't autodetect firmware, because proper answer not received.
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- > =node.heap()
- 19152
- > dofile("setup.lua")
- Getting aps
- > New request....
- Req was parsed
- am routing
- Closing connection
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- yeh bad news bear
- Closing connection
- Getting aps
- Getting aps
- New request....
- Req was parsed
- am routing
- Closing connection
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- New request....
- Req was parsed
- am routing
- PANIC: unprotected error in call to Lua API (not enough memory)
- c_ÇÏRSöfJSúfJSúÒîø
- NodeMCU 0.9.6 build 20150406 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- PORT CLOSED
- PORT OPEN 9600
- Communication with MCU...
- ..........
- ..........
- PORT CLOSED
- PORT OPEN 9600
- Communication with MCU...
- ..........
- ..........
- ...
- PORT CLOSED
- PORT OPEN 9600
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 23520
- >
- PORT CLOSED
- PORT OPEN 9600
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 24336
- > Uploading to ESP file f.woff...Waiting answer from ESP - Timeout reached. Command aborted.c_ÇÏRSöfJSúâFjSöfîø
- NodeMCU 0.9.6 build 20150405 powered by Lua 5.1.4
- lua: cannot open init.lua
- > l = file.list();
- > for k,v in pairs(l) do
- print("name:"..k..", size:"..v)
- end
- > file.format()
- format done.
- > Uploading to ESP file f.woff...Waiting answer from ESP - Timeout reached. Command aborted.c_ÇÏRSöfJSúâFjSöîø
- NodeMCU 0.9.6 build 20150405 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- >
- > file.format()
- format done.
- >
- ----------------------------
- No files found.
- ----------------------------
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- > Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúâFjSöfî
- Communication with MCU...
- Got answer! AutoDetect firmware...
- Can't autodetect firmware, because proper answer not received.
- NodeMCU 0.9.6 build 20150405 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- > Uploading to ESP file http.lua...Waiting answer from ESP - Timeout reached. Command aborted.c_ÇÏRSöfJSúâFjSöfîø
- NodeMCU 0.9.6 build 20150405 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- >
- PORT OPEN 9600
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 24336
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- > file.format()
- format done.
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- >
- ----------------------------
- No files found.
- ----------------------------
- >
- Total : 507 bytes
- Used : 0 bytes
- Remain: 507 bytes
- > l = file.list();
- > for k,v in pairs(l) do
- print("name:"..k..", size:"..v)
- end
- >
- PORT OPEN 9600
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 27808
- >
- ----------------------------
- No files found.
- ----------------------------
- >
- Total : 158381 bytes
- Used : 0 bytes
- Remain: 158381 bytes
- > Uploading to ESP file f.woff...Success
- > Uploading to ESP file http.lua...Success
- > Uploading to ESP file render.lua...Success
- > Uploading to ESP file setup.css...Success
- > Uploading to ESP file setup.index.lua...Success
- > Uploading to ESP file setup.js...Success
- > Uploading to ESP file setup.lua...Success
- > Uploading to ESP file setup.router.lua...Success
- > Uploading to ESP file setup.save...Success
- > Uploading to ESP file setup.save.lua...Success
- > Uploading to ESP file setup.test.lua...Success
- > Soft restart by user command
- node.restart()
- > c_ÇÏRSöfJSúâFjöâêø
- NodeMCU 0.9.5 build 20150405 powered by Lua 5.1.4
- lua: cannot open init.lua
- >
- Communication with MCU...
- Got answer! AutoDetect firmware...
- NodeMCU firmware detected.
- =node.heap()
- 27808
- > dofile("setup.lua")
- Getting aps
- > Getting aps
- Getting aps
- Getting aps
- Getting aps
- 11336
- am routing
- 11952
- Getting aps
- 8800
- am routed
- 9368
- Closing connection
- Closing connection
- 10400
- am routed
- 10992
- yeh bad news bear
- Closing connection
- Closing connection
- 11104
- am routing
- 11768
- Closing connection
- 10416
- am routed
- 11048
- Closing connection
- 10544
- am routed
- 11160
- yeh bad news bear
- Closing connection
- Closing connection
- Getting aps
- 10504
- am routing
- 11168
- Closing connection
- 9976
- am routed
- 10568
- Closing connection
- 10560
- am routed
- 11136
- yeh bad news bear
- Closing connection
- Closing connection
- 11368
- am routing
- 12040
- Closing connection
- 10960
- am routed
- 11576
- Closing connection
- 11408
- am routed
- 12024
- yeh bad news bear
- Closing connection
- Closing connection
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
- Getting aps
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement