This project integrates a Bambulab AMS system with Spoolman to synchronize filament spool usage. It listens for MQTT updates from the printer and updates spool data on Spoolman.
This project is based on the script from Diogo Resende posted in this issue Donkie/Spoolman#217
THIS SOLUTION ONLY WORKS WITH ORIGINAL BAMBULAB SPOOLS BECAUSE THEY CAN BE IDENTIFIED WITH THEIR SERIAL NUMBER
- Real-time AMS filament updates
- Synchronizes spool usage with Spoolman
- Lightweight Docker container for easy deployment
- A running instance of Spoolman
- Access to your Bambulab AMS printer with its serial number, access code, and IP address
Simply pulling ghcr.io/rdiger-36/bambulab-ams-spoolman-filamentstatus:latest
should retrieve the correct image for your arch.
The architectures supported by this image are:
Architecture | Spoorted |
---|---|
x86-64 | ✅ |
arm64 | ✅ |
armhf | ✅ |
-
Pull the Docker image:
docker pull ghcr.io/rdiger-36/bambulab-ams-spoolman-filamentstatus
-
Run the container:
docker run -d \ -e PRINTER_ID=<your_printer_serial> \ -e PRINTER_CODE=<your_access_code> \ -e PRINTER_IP=<printer_ip_address> \ -e SPOOLMAN_IP=<spoolman_ip_address> \ -e SPOOLMAN_PORT=<spoolman_port> \ -e UPDATE_INTERVAL=120000 \ --name bambulab-ams-spoolman-filamentstatus \ ghcr.io/rdiger-36/bambulab-ams-spoolman-filamentstatus:latest
Docker Compose
version: '3.8' services: bambulab-ams-spoolman-filamentstatus: image: ghcr.io/rdiger-36/bambulab-ams-spoolman-filamentstatus container_name: bambulab-ams-spoolman-filamentstatus environment: - PRINTER_ID=<your_printer_serial> # Must be in capital letters! - PRINTER_CODE=<your_access_code> - PRINTER_IP=<printer_ip_address> - SPOOLMAN_IP=<spoolman_ip_address> - SPOOLMAN_PORT=<spoolman_port> - UPDATE_INTERVAL=120000 # Time in ms for updating spools in Spoolman (standard 120000 ms -> 2 minutes) min. 1000 restart: unless-stopped
Variable | Description |
---|---|
PRINTER_ID |
Printer serial number (Note: Must be in capital letters!!) |
PRINTER_CODE |
Printer access code |
PRINTER_IP |
Local IP address of the printer |
SPOOLMAN_IP |
IP address of the Spoolman instance |
SPOOLMAN_PORT |
Port of the Spoolman instance |
UPDATE_INTERVAL |
Time in ms for updating spools in Spoolman (standard 120000 ms -> 2 minutes) min. 1000 |
Once the container is running, it will automatically connect to the Bambulab AMS system and Spoolman. Logs can be viewed using:
docker logs -f bambulab-ams-spoolman-filamentstatus
Example Output:
Connected to MQTT broker
AMS [A] (hum: 30, temp: 25ºC)
- [A0] Bambu Basic Black (75%) [[ ABCD1234 ]]
- Not found. Update spool tag!
- [A1] Bambu PLA White (50%) [[ EFGH5678 ]]
- Updated spool 12
Slot in Log | Slot on AMS |
---|---|
A0 |
AMS Slot 1 |
A1 |
AMS Slot 2 |
A2 |
AMS Slot 3 |
A3 |
AMS Slot 4 |
- You have to add an Extra Field to your Spoolman spools:
- Go to Settings > Extra Fileds > Spools
- Add the Extra Fields "tag"
- Go to "Spools" in Spoolman and create or edit a spool
- After entering all your necessary information you have to add the serial number of your spool to the Extra Field called "tag"
- Click on save.
- If the container is running and all parameters are entered correctly, you can read the serial numbers from the conatiner log
- At the first start with an not linked spool the output looks like this:
- [A0] Bambu PETG Black (75%) [[ ABCD1234 ]] - Not found. Update spool tag!
- Now the spool must be linked to an already created spool in Spoolman
- The serial number (located between the double square brackets), in this case ABCD1234, must be entered in Spoolman under the desired spool in the extra field “tag”
- The container must be restarted
- The log output should now look like this:
- [A0] Bambu PETG Black (75%) [[ ABCD1234 ]] - Updated spool 15
- This must be done with every spool that is not yet linked
- simple Web UI with Bambulab MQTT and Spoolman integration
- add new recognized spools to Spoolman incl. mapping filaments or register new filament
- merge new spool with empty, new or not paired spool
- Multiple printer Support