Browse Source

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.

Marcos Kirsch 9 years ago
parent
commit
e31c35a3f3
1 changed files with 9 additions and 8 deletions
  1. 9 8
      makefile

+ 9 - 8
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))