Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -92,7 +98,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:
Expand Down Expand Up @@ -145,7 +151,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

Expand Down
11 changes: 11 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------

Expand Down
36 changes: 36 additions & 0 deletions examples/Basic/basic_no_camera.py
Original file line number Diff line number Diff line change
@@ -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()