-->
Page 3 of 53

Re: NodeMcu - A lua based firmware for esp8266

PostPosted: Wed Nov 12, 2014 7:48 pm
by cendev
yup, Same here, no baud rate change, the random stuff at the boot probably the last parts of the bootloader like the at firmware, and the init.lua was the first thing i noticed too. I think the init.lua does not exist after downloading the firmware. it's created with the first file.open("init.lua","w") and then no more errors :)

Re: NodeMcu - A lua based firmware for esp8266

PostPosted: Wed Nov 12, 2014 9:38 pm
by zeroday
mcsa wrote:Can I write lua script, save it in file and then run it at startup?
Can command accept via tcp, like telnet? Or only via uart?

telnet or command via tcp are not supported out of box.
but you can start a tcp server to accept lua and run it like this:
Code: Select all  s=net.createServer(net.TCP)
  s:listen(8888,function(c)
    c:on("receive",function(c,pl)
    print(pl)
    pcall(loadstring(pl))
  end)
end)

then, you may connect to the module and send command via tcp.
you can also put this in init.lua and run it after startup.

I will add some api to re-direct uart input output in the near future :)

Re: NodeMcu - A lua based firmware for esp8266

PostPosted: Wed Nov 12, 2014 10:05 pm
by zeroday
Squonk wrote:Nice!

Is there a chance to get the sources soon?


it's free but not open source for now,
I hope this will happen soon when the api is stable,
and lua script can run over these api without change even on different wifi-soc,
not only esp8266

Re: NodeMcu - A lua based firmware for esp8266

PostPosted: Thu Nov 13, 2014 1:43 am
by Squonk
Ok, I appreciate Lua's portability and readability but I don't care about stability, and I don't care too if the code is ugly or not, but I won't consider installing something on my ESP8266 unless I have the source for it: after all this was the main motivation for hacking this device.