Fix printer send + live telemetry; add hardware-in-the-loop tests - #143
Merged
Conversation
Confirmed end-to-end against a real Bambu P2S. send_print: force use_ams:false in the project_file payload. A re-sliced spoolbook .3mf carries no per-filament AMS metadata, so use_ams:true fails at HMS 07FF-8012 "Failed to get AMS mapping table" regardless of ams_mapping. With it false the printer feeds from the threaded filament and the print starts. ams_mapping/ams_mapping2 now always empty. printer_mqtt: - max_packet_size 128KB -> 1MB. A P2S pushall full-status object overflowed 128KB, erroring the eventloop right after ConnAck -> the card flapped "Connected"/"Live" then back to "Not connected / No live job data". - connect / ConnAck / disconnect-with-error / subscribe-fail now log; the reconnect loop was previously silent. - publish_command uses a numeric sequence_id (submission_id()) + empty param, so the P2S actually acts on pause/resume/stop. - connect_and_subscribe_loop + publish_raw made pub for the new tests. printer_telemetry: record_reading no longer .expect()s its queries. It runs on the MQTT eventloop task; a DB error there unwound the whole telemetry+control connection for the printer (pause/resume/stop dead until restart). Split into try_record_reading + a wrapper that logs and drops the one reading. PrinterCard.svelte: drop the inline <img> live feed from the status panel. An <img> streaming the camera is a permanent client and Bambu firmware serves one at a time, so the card starved the printer's own toolhead-camera init mid-print. Camera is popup-only now. reslicing: slice_via_service made pub. tests/printer_live.rs (all #[ignore], local dev only, never CI): - live_connection_comes_up_and_stays_up - ftps_upload_roundtrips - send_a_print_then_cancel_before_it_extrudes - reslice_then_print_then_cancel (unsliced .3mf -> slicer-service -> print) Print tests are triple opt-in (SPOOLBOOK_TEST_ALLOW_REAL_PRINT=1) and cancel in PREPARE before any extrusion. examples/stop_print.rs: standalone MQTT stop command, used as the manual kill switch while developing the print path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmMzHSCTn7fkYGn9rWNnPS
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.
Confirmed end-to-end against a real Bambu P2S.
send_print: force use_ams:false in the project_file payload. A re-sliced spoolbook .3mf carries no per-filament AMS metadata, so use_ams:true fails at HMS 07FF-8012 "Failed to get AMS mapping table" regardless of ams_mapping. With it false the printer feeds from the threaded filament and the print starts. ams_mapping/ams_mapping2 now always empty.
printer_mqtt:
printer_telemetry: record_reading no longer .expect()s its queries. It runs on the MQTT eventloop task; a DB error there unwound the whole telemetry+control connection for the printer (pause/resume/stop dead until restart). Split into try_record_reading + a wrapper that logs and drops the one reading.
PrinterCard.svelte: drop the inline
live feed from the status panel. An
streaming the camera is a permanent client and Bambu firmware serves one at a time, so the card starved the printer's own toolhead-camera init mid-print. Camera is popup-only now.
reslicing: slice_via_service made pub.
tests/printer_live.rs (all #[ignore], local dev only, never CI):
examples/stop_print.rs: standalone MQTT stop command, used as the manual kill switch while developing the print path.
Closes #141 #142