An open source .NET API for Bambu Lab printers.
BambuSharp is a comprehensive .NET library for communicating with Bambu Lab 3D printers over the local network. It provides real-time monitoring of printer status, temperatures, print progress, AMS (Automatic Material System) units, and much more through an easy-to-use API with full INotifyPropertyChanged support.
- Real-time Printer Monitoring - Live updates via MQTT connection
- Comprehensive Status Information
- Print progress, current file, layer information
- Bed and nozzle temperatures
- Extruder details with accurate temperature conversion
- Nozzle specifications (diameter, type, wear percentage)
- AMS units with filament information (type, color, remaining length)
- IP camera settings and resolution
- Light status (chamber light, work light, etc.)
- Network interfaces and IP addresses
- AI features (spaghetti detector, first layer inspector, etc.)
- File upload status and progress
- Cloud connectivity status
- Terminal UI - Cross-platform terminal-based monitoring interface with colored filament display
- INotifyPropertyChanged Support - Easy integration with MVVM applications
- Type-Safe API - Strongly-typed properties with units (using Meadow.Units for temperatures)
dotnet add package BambuSharpusing BambuSharp;
// Create a printer instance with IP address and access code
var printer = new LocalPrinter("192.168.1.100", "your-access-code");
// Subscribe to property changes
printer.PropertyChanged += (sender, e) =>
{
Console.WriteLine($"Property changed: {e.PropertyName}");
};
// Connect to the printer
await printer.Connect();
// Access printer status
Console.WriteLine($"State: {printer.State}");
Console.WriteLine($"Progress: {printer.PrintProgress}%");
Console.WriteLine($"Current File: {printer.CurrentFileName}");
Console.WriteLine($"Bed Temperature: {printer.BedTemperature.Celsius:F1}°C");
Console.WriteLine($"Nozzle Temperature: {printer.NozzleTemperature.Celsius:F1}°C");
Console.WriteLine($"Layer: {printer.CurrentLayer}/{printer.TotalLayers}");
// Access AMS information
foreach (var ams in printer.AmsUnits)
{
Console.WriteLine($"AMS Unit {ams.Id}: {ams.Humidity}% humidity");
foreach (var tray in ams.Trays)
{
Console.WriteLine($" Tray {tray.Id}: {tray.FilamentType} - {tray.Color}");
Console.WriteLine($" Remaining: {tray.Remaining}mm of {tray.TotalLength}mm");
}
}
// Disconnect when done
await printer.Disconnect();
printer.Dispose();State- Current printer state (Idle, Printing, Paused, etc.)PrintProgress- Print completion percentage (0-100)CurrentFileName- Name of the currently loaded/printing fileCurrentLayer/TotalLayers- Layer progress informationRemainingMinutes- Estimated time remaining
BedTemperature- Current heated bed temperatureNozzleTemperature- Current nozzle temperatureExtruder- Detailed extruder information including:CurrentTemperature- Current nozzle temperature (device-level)TargetTemperature- Target nozzle temperatureFilamentTemperature- Filament temperatureStatus- Extruder status code
Nozzle- Nozzle specifications:Diameter- Nozzle diameter (e.g., 0.4mm)Type- Nozzle type (e.g., "HX01")WearPercent- Nozzle wear percentage
IpCamera- Camera settings:Resolution- Camera resolutionRecordingSetting- Recording configuration
Lights- List of lights (chamber, work, etc.) with on/off statusNetworks- Network interfaces with IP addresses and subnet masks
AmsUnits- List of AMS units, each containing:- Humidity and temperature
- Trays with filament information (type, color, remaining length, temperature settings)
AI- AI camera features:PrintingMonitor- AI monitoring enabled/disabledFirstLayerInspector- First layer inspectionSpaghettiDetector- Spaghetti failure detectionBuildPlateMarkerDetector- Build plate marker detectionPrintHalt- Automatic print halt on detectionHaltPrintSensitivity- Sensitivity levelAllowSkipParts- Allow skipping detected issues
UploadStatus- File upload progress:Status- Upload statusProgress- Upload percentageSpeed- Upload speedFileSize/FinishSize- File size informationTimeRemaining- Estimated upload time remaining
Files- List of available print files on printer storageCloudStatus- Cloud connectivity:BambuLabCloudConnected- Bambu Lab cloud connection statusExternalCloudConnected- External cloud connection statusVersion- Protocol version
BambuSharp includes a cross-platform terminal-based monitoring interface built with Terminal.Gui:
- Real-time expandable tree view of all printer properties
- Colored filament display for AMS trays with high-contrast backgrounds
- Live updates without page refreshes
- Navigate with keyboard (arrow keys to expand/collapse)
BambuSharp communicates with Bambu Lab printers using MQTT over the local network:
- Real-time status updates (~1 second intervals)
- Automatic JSON deserialization with custom converters
- Reliable connection management
- .NET 8.0 or later
- Network access to Bambu Lab printer
- Printer access code (found in printer settings)
- Built with Meadow.Units for type-safe unit handling
- Terminal UI powered by Terminal.Gui
- MQTT communication via MQTTnet

