Skip to content

Javascript tools to interact with Bambu Lab printers.

License

Notifications You must be signed in to change notification settings

AndrewLemons/bambu-js

Repository files navigation

Bambu JS

Tools to interact with Bambu Lab printers over MQTT and FTP.

Example

import { BambuPrinter } from "bambu-js";

(async () => {
	// Create the printer
	const printer = new BambuPrinter("192.168.68.1", "01P0XX1XX2XX", "12345678");

	// Connect to the printer
	await printer.connect();

	// Manipulate files on the SD card
	await printer.manipulateFiles((context) => {
		let dir = await context.readDir("models");
		console.log(dir);
	});

	// Start a print job
	printer.printProjectFile(
		"models/project.3mf",
		"plate_1.gcode",
		"Plate 1",
		"66b1ea1d91b15ace6f74ea1456ba1456",
		{
			timelapse: false,
		},
	);

	// Log the printer state
	console.log(printer.state);
})();