An open souce alternative for connecting Bambu Lab pritners
  • C++ 98.1%
  • CMake 1.9%
Find a file
2026-03-22 20:23:45 +01:00
src Initial commit 2026-03-22 20:23:45 +01:00
tests Initial commit 2026-03-22 20:23:45 +01:00
.gitignore Initial commit 2026-03-22 20:23:45 +01:00
CMakeLists.txt Initial commit 2026-03-22 20:23:45 +01:00
CPPLINT.cfg Initial commit 2026-03-22 20:23:45 +01:00
LICENSE Initial commit 2026-03-22 20:23:45 +01:00
README.md Initial commit 2026-03-22 20:23:45 +01:00

bambu_replacement_lib

A drop-in replacement library for Bambu Studio's and OrcaSlicer's bambu_networking.so.

Status: WORK IN PROGRESS

Current State

This library provides a C++ implementation that mirrors the exported API of bambu_networking.so.

Key Features Implemented:

  • MQTT Connectivity: Uses mosquittopp to handle MQTT connections to printers.
  • SSL/TLS Support: Integrated OpenSSL for secure connections.
  • JSON Parsing: Uses nlohmann/json for handling data structures.
  • Network Agent: Partial implementation of the Agent class for managing printer state and discovery.
  • Exported Symbols: All exported functions needed to print match original ABI.

Source Files:

  • src/bambu_network.cpp - Implementation of exported functions (mix of active logic and stubs).
  • src/Agent.cpp - Core logic for network management, MQTT, and SSDP.
  • src/MqttHandler.cpp - Wrapper around Mosquitto for MQTT communication.

Built Output:

  • libbambu_networking_oss.so - Shared library.

Prerequisites & Dependencies

To build this project, you need a C++17 compliant compiler and the following development libraries:

  • CMake (3.16 or newer)
  • C++ Compiler (GCC 15.2.1 tested, Clang should work)
  • OpenSSL (libssl-dev)
  • libcurl (libcurl4-openssl-dev)
  • Mosquitto (libmosquitto-dev, libmosquittopp-dev)
  • nlohmann_json (nlohmann-json3-dev)
  • GTest (libgtest-dev, for running tests)

On Ubuntu/Debian, you can install these with:

sudo apt-get update
sudo apt-get install cmake build-essential libssl-dev libcurl4-openssl-dev \
    libmosquitto-dev libmosquittopp-dev nlohmann-json3-dev libgtest-dev

Building

# Clone the repository
git clone https://git.contentnation.net/grumpydevelop/bambu_network_oss.git
cd bambu_replacement_lib

# Create build directory
mkdir build && cd build

# Configure and Build
cmake ..
make

# (Optional) Run Tests
ctest

Usage with OrcaSlicer

Important: Patched OrcaSlicer Required

To use this library, you currently need a patched version of OrcaSlicer.

The standard release of OrcaSlicer (and Bambu Studio) performs integrity checks and signature verification on the loaded bambu_networking.so module. To load this open-source replacement:

  1. You must use a build of OrcaSlicer where these verification checks have been disabled or modified to accept the OSS library.
  2. Replace the original bambu_networking.so in the OrcaSlicer directory with the compiled libbambu_networking_oss.so (rename it to bambu_networking.so).

Note: Instructions for patching OrcaSlicer are outside the scope of this document.

Current state

  • "It works on my machine/printer"
  • It does compile and run with the current git version of OrcaSlicer in a Ubunt 24.04 LTS and my P1S on Firmware 1.08.02.

Contributions

Contributions, Bugs reports and also Success reports are welcome. Either here or via Matrix #chat@grumpydevelop:contentnation.net