ozayturay wrote:Using ESPlorer v0.1 build 206 on a ESP03 module I'm getting unexpected symbol error. The only modification i made is renaming init.lua file to lhttpd.luaCode: Select allNodeMCU 0.9.5 build 20150118 powered by Lua 5.1.4
> for n,s in pairs(file.list()) do print(n.." size: "..s) end
log.txt size: 17
index.html size: 230
lhttpd.lua size: 3020
index.pht size: 848
> dofile("lhttpd.lua")
lhttpd.lua:1: unexpected symbol near '?'
Any ideas?
to1140 wrote:Any ideas?[/quote]
viewtopic.php?f=19&t=702&start=40#p7860
Here is what I got -- after the MemUsage, there is nothing in the web browser side.
--------------------
> SENT: node.restart()
node.restart()
> ???A??Z.???L2????H?NodeMcu 0.9.5 build 20150105 powered by Lua 5.1.4
lua: cannot open init.lua
> SENT: dofile("lhttpd.lua")
dofile("lhttpd.lua")
> GET:index.html, MemUsage:2200 (5632)
GET:favicon.ico, MemUsage:1896 (5488)
GET:favicon.ico, MemUsage:2104 (5056)
--------------------------
Thanks.
gerardwr wrote:to1140 wrote:Any ideas?
viewtopic.php?f=19&t=702&start=40#p7860[/quote]
I can use client:send(...) only once. For example, the following code only sends out "Test send" to the browser.
---------------
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive", function(client,request)
local buf = "";
--buf = buf.."<h1>Test send</h1><hr>"
--buf = buf.."<p>This is test1.</p>"
--buf = buf.."<p>This is test2.</p>"
--client:send(buf);
client:send("<h1>Test send</h1><hr>");
client:send("<p>This is test1.</p>");
client:send("<p>This is test2.</p>");
conn:on("sent",function(conn) conn:close(); conn = nil; end)
end)
end)
---------------
The firmware version is: NodeMcu 0.9.5 build 20150105 powered by Lua 5.1.4, which is the default of https://github.com/nodemcu/nodemcu-flasher. (Following the "Flash the Firmware" instructions on https://github.com/nodemcu/nodemcu-firmware to the latest firmware version didn't work.)
Thank you.