Post your best Lua script examples here

Load binary file - how would you prefer?

2
22%
0
N/A
2
22%
0
N/A
1
11%
1
11%
3
33%
User avatar
By kmpm
#7077 eLua already have an xmodem implementation that perhaps could be used and there is almost no overhead in the protocol.
Many terminal softwares do have xmodem implemented so that would work as well.
It's very uncomplicated to implement if you would like to.

At https://github.com/kmpm/nodemcu-uploader you can find a python + lua script that almost do xmodem transfer.
The biggest difference is that It supports filenames and skip crc checks.
User avatar
By Hoksmur
#7166 So, there is the simplest method. Possible, I repeated Markus's method. In attached archive two files. webload.lua and upload.html. At first, you should correct IP address in both files to your own, then copy text from webload.lua to console and run it (or save this one on embedded filesystem for multiple use).
Then open html and select file and send it. It's easy.
UPD: it works correct only up to 840 byte and depends on browser: length of header can be different, but packet size couldn't be more 1460.
UPD2: I'd recommend use script from this post. Thanks a lot ThomasW for tools and Markus for hint.

(929 Bytes) Downloaded 255 times
Last edited by Hoksmur on Tue Jan 13, 2015 3:09 am, edited 1 time in total.