Control 3D printers with Klipper firmware via Moonraker using Dart/Flutter
How to Use • Contributing • Credits • License
To use flutter_klipper
, start by installing the package from pub.dev. You can do this by adding the package to your pubspec.yaml
file:
dependencies:
flutter_klipper: ^{latest version}
Once you've installed the package, you can refer to the documentation for details on how to use the client API. Here are the basic steps to get started:
- Import the
flutter_klipper
package in your Dart code:
import 'package:flutter_klipper/flutter_klipper.dart';
- Create a new
Klipper
instance and connect to your printer:
Klipper klipper = Klipper('raspberrypi.local');
If necessary, you can use the port
parameter to specify a custom port. The default port is 7125
. You can also use the token
parameter to specify a custom token.
This instance of Klipper will repeatedly attempt to connect to the printer until it is successful. If Klipper gets disconnected, it will attempt to reconnect automatically. To manually close the connection, use the close()
method:
klipper.close();
- Listen for events from Klipper:
klipper.statusNotifier.ready.addListener(
(ready) => {print("Connected and ready to receive commands!")});
- Send commands to the printer:
klipper.sendCommand(RunGCodeCommand('G28')); // Home the printer
That's it! You can now use the flutter_klipper package to control your Klipper-based 3D printer via Moonraker. For more information, refer to the documentation.
We welcome contributions to flutter_klipper
! If you would like to contribute, please follow these steps:
- Fork the repository and create a new branch for your changes.
- Make your changes, including adding tests where appropriate.
- Run the tests using
flutter test
. - Ensure that your code adheres to the Dart Style Guide, with the exception of using the
lint
style instead of the defaultlints
style. - Submit a pull request.
We will review your changes and provide feedback as needed. Please note that all contributions will be subject to review and approval before being merged into the main repository.
Thank you for your interest in contributing to flutter_klipper
!
flutter_klipper
would not be possible without the amazing work of the following projects:
- Klipper: The 3D printer firmware that
flutter_klipper
communicates with. - Moonraker: The web-based interface that allows remote control of Klipper.
- Flutter: The open-source UI toolkit that
flutter_klipper
is built on. - Dart: The programming language used to develop
flutter_klipper
. - and all contributors who have supported this project.
We would like to express our gratitude to the developers of these projects and the entire open-source community for their contributions to the world of 3D printing and software development.
Permissions | Conditions | Limitations |
Commercial use | Disclose source | Liability |
Modification | Same license | Warranty |
Distribution | State changes | |
Patent use | License and copyright notice | |
Private use |
Flutter Klipper is licensed under the GNU General Public License v3.0. You may obtain a copy of the License at https://www.gnu.org/licenses/gpl-3.0.en.html.
This means that any software using or distributing Flutter Klipper must also be licensed under the GPLv3 or a compatible license. Additionally, any modifications to the code must also be released under the same license.
For more information about open-source licensing and the GPL, please visit the Open Source Initiative.
Note that this license does not apply to any third-party libraries used by Flutter Klipper, which are each distributed under their own respective licenses. Please refer to the documentation of each library for details.
The full license is available in the LICENSE file.