From 0686ce4415eaf138b883576b8a5dc278483a010e Mon Sep 17 00:00:00 2001 From: ohmdelta <64962148+ohmdelta@users.noreply.github.com> Date: Sun, 20 Apr 2025 18:12:50 +0100 Subject: [PATCH 1/3] update readme with new bambutools url --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b400f94..01f0be0 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ If you've found this package useful, help us support more printers with the link ## Status -[![flake8](https://github.com/mchrisgm/bambulabs_api/actions/workflows/flake8.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/flake8.yml) -[![pytest-unit-tests](https://github.com/mchrisgm/bambulabs_api/actions/workflows/pytest-unit-tests.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/pytest-unit-tests.yml) -[![GitHub Pages](https://github.com/mchrisgm/bambulabs_api/actions/workflows/static.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/static.yml) +[![flake8](https://github.com/BambuTools/bambulabs_api/actions/workflows/flake8.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/flake8.yml) +[![pytest-unit-tests](https://github.com/BambuTools/bambulabs_api/actions/workflows/pytest-unit-tests.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/pytest-unit-tests.yml) +[![GitHub Pages](https://github.com/BambuTools/bambulabs_api/actions/workflows/static.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/static.yml) ## Documentation @@ -92,7 +92,7 @@ If you want to contribute to the development of this API or run it in a developm 1. Clone the repository: ```bash - git clone https://github.com/mchrisgm/bambulabs_api.git + git clone https://github.com/BambuTools/bambulabs_api.git ``` 2. Change directory: @@ -145,7 +145,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file ## Support -If you encounter any issues or have questions, feel free to open an issue on the [GitHub repository](https://github.com/mchrisgm/bambulabs_api/issues). +If you encounter any issues or have questions, feel free to open an issue on the [GitHub repository](https://github.com/BambuTools/bambulabs_api/issues). ## Acknowledgements From 53a1764f9086e0b62903a28ed81d5dc34a896296 Mon Sep 17 00:00:00 2001 From: ohmdelta <64962148+ohmdelta@users.noreply.github.com> Date: Sun, 20 Apr 2025 18:20:01 +0100 Subject: [PATCH 2/3] add documentation for not using the camera --- docs/examples.rst | 11 ++++++++++ examples/Basic/basic_no_camera.py | 36 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 examples/Basic/basic_no_camera.py diff --git a/docs/examples.rst b/docs/examples.rst index 3124624..cd377ba 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -10,6 +10,17 @@ Make sure that ports 8883, 6000 and 990 are accessible from your machine. .. literalinclude:: ../examples/Basic/basic.py :language: python +Basic No Camera +--------------- + +If using the api without camera connection follow the below example. +Note that camera on X1 machines is not supported on the API for versions less +than 2.7.0 + +.. literalinclude:: ../examples/Basic/basic_no_camera.py + :language: python + + Basic Subscription ------------------ diff --git a/examples/Basic/basic_no_camera.py b/examples/Basic/basic_no_camera.py new file mode 100644 index 0000000..a893890 --- /dev/null +++ b/examples/Basic/basic_no_camera.py @@ -0,0 +1,36 @@ +import time +import bambulabs_api as bl + +IP = '192.168.1.200' +SERIAL = 'AC12309BH109' +ACCESS_CODE = '12347890' + +if __name__ == '__main__': + print('Starting bambulabs_api example') + print('Connecting to Bambulabs 3D printer') + print(f'IP: {IP}') + print(f'Serial: {SERIAL}') + print(f'Access Code: {ACCESS_CODE}') + + # Create a new instance of the API + printer = bl.Printer(IP, ACCESS_CODE, SERIAL) + + # Connect to the Bambulabs 3D printer without connecting to the camera + printer.mqtt_start() + + time.sleep(2) + + # Get the printer status + status = printer.get_state() + print(f'Printer status: {status}') + + # Turn the light off + printer.turn_light_off() + + time.sleep(2) + + # Turn the light on + printer.turn_light_on() + + # Disconnect the mqtt client + printer.mqtt_stop() From d49d6407b0e548eaf3170ab66ca7b7f15489d0fd Mon Sep 17 00:00:00 2001 From: ohmdelta <64962148+ohmdelta@users.noreply.github.com> Date: Sun, 20 Apr 2025 18:26:18 +0100 Subject: [PATCH 3/3] add disclaimer about known limitations --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 01f0be0..e40e667 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,12 @@ if __name__ == '__main__': printer.disconnect() ``` +## Known Limitations + +* X1 Printers are not fully supported yet - camera integration is not yet implemented (for api versions < 2.7.0 please see the [No Camera Example](/examples/Basic/basic_no_camera.py)). +* H2D printers have not been tested yet. + + ## Development If you want to contribute to the development of this API or run it in a development environment, follow these steps: