Makefile: add an "upload" target for uploading the .gcode to my printer

This commit is contained in:
2024-07-16 10:54:49 +00:00
parent 57fbccfc33
commit 350ddbeb8a
2 changed files with 18 additions and 8 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
__pycache__ __pycache__
build/ build/
printer_password

View File

@@ -3,6 +3,12 @@ SHAREDIR=$(PREFIX)/share/models
PRINT_NOZZLE_DIAM=0.2 PRINT_NOZZLE_DIAM=0.2
PRINT_FILA_DIAM=1.75 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 # settings for Bambu p1p 3d printer, TPU
# takeaways: # takeaways:
# - bed-temp: 65C # - 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)" mkdir -p "$(@D)"
./main.py --render-phone --export-png $@ ./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 build/case.stl: main.py src/*.py
mkdir -p "$(@D)" mkdir -p "$(@D)"
./main.py --export-stl $@ ./main.py --export-stl $@
@@ -106,5 +105,15 @@ build/case.stl: main.py src/*.py
mkdir -p $(shell dirname $@) mkdir -p $(shell dirname $@)
slic3r $(SLIC3R_FLAGS) $< -o $@ 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