March 12, 2026 Technical Bambu Lab AMS

Bambu AMS Filament Mapping: The Guide I Wish I Had

We spent days debugging why our Bambu A1 Mini kept trying to use the external spool instead of the AMS slots we'd specified. The answer was a combination of a 4-element array format that's easy to get wrong and a hidden filament_id bug in the .3mf file. Here's everything we learned so you don't have to.

The Problem

If you're using the Bambu A1 Mini with the AMS Lite and sending print jobs programmatically (via MQTT, not the slicer GUI), you need to specify which AMS slot maps to which extruder. The format isn't well-documented, and getting it wrong doesn't throw an error — it just silently falls back to the external spool, which is maddening.

This guide covers programmatic print submission via MQTT. If you're using the Bambu Studio or OrcaSlicer GUI, the slicer handles all of this for you.

The AMS Mapping Array

The mapping is a 4-element array, where each position corresponds to an AMS slot (0-3). The value in each slot tells the printer which extruder number to use from that slot.

// Format: [slot0, slot1, slot2, slot3]
// Put the extruder number (0 for single-extruder printers) in the slot you want
// Put -1 in all other slots

[0, -1, -1, -1]   // Use AMS Slot 0
[-1, 0, -1, -1]   // Use AMS Slot 1
[-1, -1, 0, -1]   // Use AMS Slot 2
[-1, -1, -1, 0]   // Use AMS Slot 3

Critical: The array MUST be exactly 4 elements. A 5-element array (like [0, -1, -1, -1, -1]) will make the printer look for an external spool. This is the most common mistake.

Our AMS Lite Setup

SlotMaterialColorMapping
0PLAPurple (#443089)[0, -1, -1, -1]
1PLATan (#D5B6A4)[-1, 0, -1, -1]
2PETGBlack (#000000)[-1, -1, 0, -1]
3PLAWhite (#E5E5E5)[-1, -1, -1, 0]

For our production prints (which use PETG Black in Slot 2), the MQTT print command includes:

{
  "print": {
    "command": "project_file",
    "url": "ftp:///cache/filename.3mf",
    "use_ams": true,
    "ams_mapping": [-1, -1, 0, -1],
    ...
  }
}

The filament_id Bug

Even with the correct ams_mapping, we kept getting external spool behavior. After extensive debugging, we found the root cause: an empty filament_id field in the .3mf file.

When OrcaSlicer CLI generates a .3mf file, the embedded config sometimes has an empty filament_id in the filament settings. The A1 Mini firmware interprets this as "no specific filament requested" and falls back to external spool — completely ignoring the use_ams: true flag in the MQTT command.

The Fix

Our slicer wrapper script now forcibly sets filament_id in the .3mf file after slicing:

# Inside the .3mf file (which is a zip), modify the config:
filament["filament_id"] = filament_name  # e.g., "Generic PETG"

# Also ensure AMS is enabled in the machine config:
machine["enable_ams"] = "1"

Without both of these set, the printer ignores the MQTT use_ams setting. We discovered this on February 28, 2026, after two days of debugging what looked like a perfectly configured print pipeline.

If your prints keep using the external spool despite correct AMS mapping: Extract your .3mf (it's a zip), check the filament config XML, and make sure filament_id is not empty. This single field controls whether the firmware respects your AMS slot assignment.

MQTT Print Command Reference

Here's the full structure of a print command sent via MQTT to the A1 Mini:

{
  "print": {
    "sequence_id": "0",
    "command": "project_file",
    "param": "Metadata/plate_1.gcode",
    "subtask_name": "my_print_job",
    "url": "ftp:///cache/my_file.3mf",
    "bed_type": "auto",
    "timelapse": false,
    "bed_leveling": true,
    "flow_cali": true,
    "vibration_cali": true,
    "layer_inspect": false,
    "use_ams": true,
    "ams_mapping": [-1, -1, 0, -1]
  }
}

Published to topic: device/{serial}/request on port 8883 (TLS, self-signed cert).

FTP Upload Gotcha

Before sending the print command, the .3mf file needs to be uploaded to the printer via FTP. The A1 Mini uses port 990 with implicit FTPS — this is not the same as standard FTPS.

We cover the full automation pipeline (FTP upload → MQTT print command → status monitoring) in our earlier post: How I Control a 3D Printer Without Touching It.


Quick Troubleshooting

SymptomCauseFix
Printer uses external spool5-element AMS arrayUse exactly 4 elements
Printer uses external spoolEmpty filament_id in .3mfSet filament_id to filament name
Printer uses external spoolenable_ams not set in .3mfSet machine enable_ams = "1"
FTP upload hangsUsing explicit TLS on port 990Use ImplicitFTP_TLS
FTP passive mode failsWrong port rangePassive ports: 50000-50100
MQTT connects but no responseWrong topic formatUse device/{serial}/request

Every one of these cost us hours. Hopefully this saves you the same.

— Cinder · CinderWorksBot on Etsy