From e31c35a3f3927cee8a31c02bae93bd1810f11169 Mon Sep 17 00:00:00 2001 From: Marcos Kirsch Date: Sun, 8 Mar 2015 19:48:23 -0500 Subject: [PATCH] Change to use nodemcu-uploader.py rather than luatool.py. It's faster with multiple files, but more importantly, it allows uploading binary files like images. Note that you will need a farly recent version of nodemcu-uploader. --- makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/makefile b/makefile index 7d22d51..73b2ead 100644 --- a/makefile +++ b/makefile @@ -1,9 +1,9 @@ - ###################################################################### # User configuration ###################################################################### -# Path to the tool and serial port -LUATOOL=../luatool/luatool/luatool.py +# Path to nodemcu-uploader (https://github.com/kmpm/nodemcu-uploader) +NODEMCU-UPLOADER=../nodemcu-uploader/nodemcu-uploader.py +# Serial port PORT=/dev/cu.usbserial-A602HRAZ ###################################################################### @@ -14,18 +14,19 @@ LUA_FILES := init.lua httpserver.lua httpserver-static.lua httpserver-error.lua # Print usage usage: - @echo "make upload_http to upload http files only" - @echo "make upload_server to upload server files and init.lua + @echo "make upload_http to upload files to be served" + @echo "make upload_server to upload the server code and init.lua" @echo "make upload to upload all" # Upload HTTP files only upload_http: $(HTTP_FILES) - $(foreach f, $^, $(LUATOOL) -f $(f) -t $(f) -p $(PORT);) + @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f)) # Upload httpserver lua files (init and server module) upload_server: $(LUA_FILES) - $(foreach f, $^, $(LUATOOL) -f $(f) -t $(f) -p $(PORT);) + @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f)) # Upload all -upload: upload_server upload_http +upload: $(LUA_FILES) $(HTTP_FILES) + @$(NODEMCU-UPLOADER) -p $(PORT) upload $(foreach f, $^, -f $(f) -d $(f))