From 350ddbeb8a6ddf9cf3853ddd488ba4e3f3d4aebd Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 16 Jul 2024 10:54:49 +0000 Subject: [PATCH] Makefile: add an "upload" target for uploading the .gcode to my printer --- .gitignore | 1 + Makefile | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 6ffef30..b116b4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ build/ +printer_password diff --git a/Makefile b/Makefile index 6d7dde9..ae155ba 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ SHAREDIR=$(PREFIX)/share/models PRINT_NOZZLE_DIAM=0.2 PRINT_FILA_DIAM=1.75 +# variables for `make upload` +PRINTER_HOST=10.78.79.180 +PRINTER_USER=bblp +PRINTER_PASS=$(shell cat ./printer_password) +PRINTER_AUTH=${PRINTER_USER}:${PRINTER_PASS} + # settings for Bambu p1p 3d printer, TPU # takeaways: # - bed-temp: 65C @@ -91,13 +97,6 @@ build/web-viewer/index.html: doc.in/index.html build/web-viewer/vtk.js build/web mkdir -p "$(@D)" ./main.py --render-phone --export-png $@ -readme: readme_files/pinephone_front_case_with_phone.png readme_files/pinephone_back_case_with_phone.png readme_files/pinephone_side_case_with_phone.png - -doc: readme build/web-viewer/index.html - -clean: - rm -rf build - build/case.stl: main.py src/*.py mkdir -p "$(@D)" ./main.py --export-stl $@ @@ -106,5 +105,15 @@ build/case.stl: main.py src/*.py mkdir -p $(shell dirname $@) slic3r $(SLIC3R_FLAGS) $< -o $@ -.PHONY: all install readme doc clean +readme: readme_files/pinephone_front_case_with_phone.png readme_files/pinephone_back_case_with_phone.png readme_files/pinephone_side_case_with_phone.png + +doc: readme build/web-viewer/index.html + +clean: + rm -rf build + +upload: build/case.gcode + lftp -e "set ssl:verify-certificate false; put $<" -u ${PRINTER_AUTH} ftps://${PRINTER_HOST} + +.PHONY: all install readme doc clean upload