-->
Page 1 of 6

Lightning-Fast File Uploads

PostPosted: Thu Dec 25, 2014 3:37 pm
by Markus Gritsch
Hi,

I wrote a Python script (attached below) whitch uploads a file to the ESP board in the shortest time possible.

For comparison, I took a larger Lua test-file I found in this forum (lhttp.lua) which has 128 Lines and 3500 Bytes. Uploading this with LuaLoader takes about 61 seconds, which is a long turn-around cycle when developing something. I already posted a previous version of my script here viewtopic.php?f=22&t=677&start=30#p5345. Using this script the upload only takes 11.2 seconds. But it is not optimized, and sends the file line by line.

The updated version of my script (which you can find attached below) needs just 2.2 seconds to transfer the whole test-file.

I am editing the Lua files with Sublime Text (which allows uploading and executing the Lua file with F7 and, in case of an error allows jumping to the corresponding line with F4) and therefore integrated the uploader.py script using the included myNodeMcu.sublime-build file. But uploader.py can of course also be used without Sublime Text.

Have fun,
Markus

Re: Lightning-Fast File Uploads

PostPosted: Sat Dec 27, 2014 5:08 pm
by Markus Gritsch
Just for reference: Here viewtopic.php?f=22&t=913#p5755 is a version of the uploader script, which can be used to transfer binary data. However, it is not recommended for text files as it's three times slower than the script posted above.

Re: Lightning-Fast File Uploads

PostPosted: Sat Dec 27, 2014 5:18 pm
by alonewolfx2
It looks like very good. I will try asap.

Re: Lightning-Fast File Uploads

PostPosted: Sat Dec 27, 2014 5:25 pm
by alonewolfx2
How can I upload from command line?what is syntax? ( uploader.py init.lua init.lua ) ?