-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fastupload option #34
Conversation
Use base64 encoding for file upload. Data are decoded using the module "encode". This module must be in the NodeMCU Firmeware for this option to run.
Thanks Mickael! i will check it soon |
Dear Mickael, i've decided to reject your pull request because i prefer a more generic variant which uses base64 encoding by default with a fallback to hex. this wont require any config flags and will always choose the fastest available method - this is especially more suitable for beginners. to achive this, i will replace the -- Regular Version
-- ---------------------
-- Base64 Module available ?
if encoder and encoder.fromBase64 then
-- Use build-in BASE64 Decoder
_G.__nmtwrite = function(s) file.write(encoder.fromBase64(s)) end
print("b")
else
-- Use classic HEX Decoder
_G.__nmtwrite = function(s) for c in s:gmatch('..') do file.write(string.char(tonumber(c, 16))) end end
print("h")
end i hope this is in your intention and it would be great if you like to test/validate the new version. best regards, Andi |
Please try the latest version of the master branch. i've added the base64/hex transfer functions including the uncompressed code |
Hi Andi, You are right, your solution is even better and exactly in my intention. For your information, with 23 files for a total size of 32437 bytes, I observe:
Thanks for NodeMCU-Tool, it is well written (code is clear and simple) and well documented ! Good job ! best regards, Mickaël |
Great! v2.1.0 is out including this feature :) |
I use base64 encoding for uploading files. Then the NodeMCU "encode" module is used for decoding, which is really more efficient.
As the NodeMCU "encode" module is not included by default on the firmware, I have add this as an option, so that the user can choose whether use it or not.