Adam K Dean

Notes on software, systems, engineering, and things

1.2 Printing over the LAN

I wanted the agent to slice and print without me at Bambu Studio. That took three parts: a slicing script, a printer MCP server, and network access.

Slicing from a script

Bambu Studio has a command line, but it does not resolve the inherits chains in Bambu's system presets. Version 02.06 crashed. Version 02.08 exits 0 and slices with the wrong settings and no warning: 20% infill instead of 15%, 0 g of filament, the Cool Plate and no time estimate.

The fix is a script (bambu_slice.py, in a Bambu Lab skill I had to put together) that merges each chain into one flat preset first. It gives the same result on both versions: 17 min 36 s and 9.84 g for the first test plate.

The empty-nozzle print

The first agent print ran the whole job with nothing coming out of the nozzle. The printer reported no error.

The cause: Bambu Studio 02.08 keeps the A1's start G-code in separate template files, not in the preset chain. The merged preset fell back to the generic start G-code, which never loads filament from the AMS. The status showed tray_now 255 (no filament in the toolhead) all the way through.

The script now merges the template files too, and it stops if the G-code has no filament load command. A slice whose total time is only seconds above its model time is the warning sign: the real A1 start sequence adds about 6 minutes.

The printer MCP and the network

bambu-printer-mcp talks to the A1 over local MQTT. It reads the access code from a CLI password manager at launch, so no config file holds a secret. The read-only tools run freely; every tool that acts on the printer asks first.

Printing over the LAN needed:

Two more lessons. A stopped job leaves the printer in FAILED, and only a restart clears it. The MCP turns on bed levelling, flow calibration and vibration calibration by default; on a 10-minute gauge they can take as long as the print. I now send prints with flow and vibration calibration off.

The checklist

  1. Slice, then check the time, weight and plate in slice.json.
  2. Check the printer is IDLE or FINISH with no HMS errors.
  3. Agree the AMS slot, then send.
  4. Once printing starts, tray_now must show the slot. 255 means an empty nozzle.
  5. Confirm FINISH with all layers done, and record the result.

The second agent print finished all 10 layers in red. That was the VESA 75 gauge in 3.1.