feat(homelab): 3D プリンタの操作盤 (Bambuddy) を建てる - #548
Merged
Merged
Conversation
Bambu の Authorization Control で、サードパーティのスライサーから印刷を開始する 経路が塞がれている。プリンタを LAN Only + Developer Mode にすればローカルからの 制御は戻るが、代償に Bambu Handy が死ぬ (クラウド前提のアプリなので、同じ Wi-Fi にいても繋がらない)。Handy が持っていた「外から様子を見る」「ファイルを選んで 刷る」の行き先を用意する。 Home Assistant の ha-bambulab は既に入っているが役割が違うので両方置く。あちらは 監視とオートメーション側で、公開サービスが send_command 一つだけ、pybambu に FTP が無いので SD のファイル一覧が取れない。置く・選ぶ・消すはこちらが持つ。 LAN-only 向けのファームウェア更新ヘルパーも入っているので、月一で新版を見に行く 先もここになる。 bridge で動かす。上流の compose は host networking を既定にしているが、それは SSDP でプリンタを見つけるためで、この箱では 8000 も 3000 も既に埋まっている。プリンタは IP で足せるので discovery は捨てた。仮想プリンタ機能も使わないので、開けるのは UI の 8010 だけ。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なにを
bambu.gapul.netに Bambuddy を建てる。ブラウザから 3D プリンタのファイル管理と印刷開始ができる操作盤。なぜ
プリンタを LAN Only + Developer Mode にしたことで、ローカルからの制御 (FTPS 転送 / MQTT の印刷開始) は通るようになったが、引き換えに Bambu Handy が使えなくなった。Handy はクラウド前提のアプリなので、同じ Wi-Fi にいても繋がらない。外から様子を見る先と、スマホからファイルを選んで刷る先が要る。
実機で確認した切り分けはこう:
project_fileはエコーだけ返って無視される (gcode_stateはFINISHのまま)result: successが返り、print_type: localで印刷が始まるha-bambulab と重ならないのか
重ならない。既に
/var/lib/hass/custom_components/bambu_lab(v2.2.22) が入っているが、あちらは監視とオートメーション側で、公開サービスはsend_command一つだけ。pybambuに FTP のコードが無く、SD カードのファイル一覧が取れないので「選ぶ」ができない。置く・選ぶ・消すは Bambuddy が持つ。構成の判断
上流の compose は
network_mode: hostを既定にしているが、bridge にした。host が要るのは SSDP でプリンタを発見するためで、この箱では 8000 (conmon) も 3000 (homepage) も既に埋まっている。プリンタは IP (192.168.116.97) で手動追加できるので、discovery を捨てて衝突を避けるほうが得。仮想プリンタ機能 (990 / 8883 / 322 / 50000-50029) も使わないため、開けるのは UI の 8010 だけ。PUID=0 / PGID=0は bind mount 元が root 所有のため。既定の 1000:1000 だと entrypoint の chown 後に書けない。秘密は無い。プリンタのアクセスコードは UI から入れてデータディレクトリに入る。rebuild 前に手で置くファイルは無い。
確認したこと
nix eval .#nixosConfigurations.homeserver.config.system.build.toplevel.drvPathが通るjust fmt/ pre-commit (deadnix, gitleaks, nixfmt, shellcheck) 通過rebuild 後にやること
UI からプリンタを追加する (IP 192.168.116.97、シリアルとアクセスコードは本体の LAN Only Mode 画面)。
sitesに載せたので gatus の監視 vhost も自動で生える。おまけ
LAN-only 向けのファームウェア更新ヘルパーが入っていて、公開済みの全バージョンに Usable / Unavailable / Installed のバッジが付く。月一で新版を見に行く先はここでよくなったので、ntfy に流す timer を自作する話は要らなくなった。更新作業自体は LAN Only の間 OTA が来ないので microSD 経由の手作業のまま。