nodemcu Lua解释器打破了脚本行

时间:2017-05-26 00:00:14

标签: lua command-line-interface

我试图在nodemcu Lua解释器上运行下面的简短脚本。在读取一定数量的字符后,它似乎已损坏,这由“>>”表示出现在声明中间的字符,例如“wifi.sta.config(stat>> ion_cfg)”。该语句行应为“wifi.sta.config(station_cfg)”

在两个不同的终端应用程序中重复了这个问题,Coolterm和ESPlorer因此似乎不是终端神器。

原始脚本是:

station_cfg={}
station_cfg.ssid="NETGEAR"
station_cfg.pwd="xxxxxx"
wifi.sta.config(station_cfg)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload)
conn:send("  <body>")
conn:send("<h1> Hello, NodeMcu.</h1>")
conn:send("  </body>")
conn:send("</html>")
end )
end )

输出(显示运行之间的重置):

NodeMCU custom build by frightanic.com
.branch: master
.commit: c8ac5cfb912ff206b03dd7c60ffbb2dafb83fe5e
.SSL: false
.modules: file,gpio,net,node,tmr,uart,wifi
 build .built on: 2017-05-24 02:41
 powered by Lua 5.1.4 on SDK 2.1.0(116b762)
> 
> station_cfg={}
> station_cfg.ssid="NETGEAR"
station_cfg.pwd="xxxxxx"
wifi.sta.config(stat>> ion_cfg)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
stdin:2: ')' expected (to close '(' at line 1) near 'ion_cfg'
> conn:on("receive",function(conn,payload)
print(payload)
conn:send("  <body>")
conn:send("<h1> Hello, NodeMcu.</h1>")
conn:send("  </body>")
conn:send("</html>")
end )
end )stdin:1: '<eof>' expected near 'end'
> 

第二个输出带有一些额外的打印行来填充脚本并更改错误的位置现在移动到“stati&gt;&gt; on_cfg.pwd =”xxxxxx“”

NodeMCU custom build by frightanic.com
.branch: master
.commit: c8ac5cfb912ff206b03dd7c60ffbb2dafb83fe5e
.SSL: false
.modules: file,gpio,net,node,tmr,uart,wifi
 build .built on: 2017-05-24 02:41
 powered by Lua 5.1.4 on SDK 2.1.0(116b762)
> 
> print("this is padding")
this is padding
> print("this is further padding")
station_cfg={}
station_cfg.ssid="NETGEAR"
stati>> on_cfg.pwd="xxxxxx"
wifi.sta.config(station_cfg)
srv=net.createSstdin:2: '=' expected near 'on_cfg'
> erver(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload)
>> conn:send("  <body>")
conn:send("<h1> Hello, NodeMcu.</h1>")
conn:send("  </body>")
conn:send("</html>")
end )
end )stdin:1: attempt to c

0 个答案:

没有答案