As the title says... Chat on...

User avatar
By Nikolay
#14887 I picked up a cross-compiler elua to compile lua files in byte-code on Windows XP.
Works fine.
Embed it in SCITE.
As a result, it is not necessary to download the source files lua,
and you can immediately ship the byte code in the ESP.
User avatar
By TerryE
#14978 In my framework, I have the ESP8266 listening on port 8266 for commands of the form:
  • line 1 is a tab separated command + params, param 1 is always the size of
  • an optional binary chunk following
my host script in Lua talks to the ESP 8266, and one option, -C, compiles the given lua file on the host to check for syntax errors and then executes the compile command on the ESP 8266 passing the lua file to it. This function then writes the file to the SPIF file system and does a node.compile() on it to convert it into a .lc file and deletes the .lua one. This typically takes less than a second for most modules.

Same idea though, but not that Lua compiled bytecode files are guaranteed to be cross platform compatible. :) Terry
Code: Select all>  esp-cmd -h
usage: esp-cmd [options] [filenames]

example:
  >esp-cmd -i -c fred.lua -i -l

options with no parameters:
  -i                  prints memory and version information for the ESP8266
  -h                  prints this usage information
  -l                  print file listing for ESP8266
  -b                  reformat ESP8266 and restore minimum bootstap files
  -r                  restart ESP8266 after 2s delay
 
options with file parameter
  -c <file>           download and compile the specified file on the ESP8266
  -d <file>           download the specified file name to the ESP8266
  -u <file>           upload the specified file name from the ESP8266

options with two file parameters
  -m <from> <to>      move the specified file within the ESP8266 file system

  Note that the specified file name may include an optional path.  This is applied
  to the local file naming but is ignored for the ESP8266 filename.  So the
  following example downloads /tmp/mytable.txt to mytable.txt on the ESP8266:
 
  >esp-cmd -d /tmp/mytable.txt
 
 options with csv parameters
 
   -x cmd,params      Execute command "cmd" with parameters "params"
   -X cmd,params <file>  Execute command "cmd" with parameters "params" and
                      attach blob given in file.
User avatar
By TerryE
#15169 Mike, I am not sure whether you are asking me or Nikolay, but it's trivial to download to the chip either with a tiny bootstrap over TCP or via the UART. My concern is more that the lua spec doesn't guarantee that lc files are transportable across platforms, and it's pretty trivial to do the compiling on the chip anyway, so i don't see what this approach saves or simplifies.