n8n-nodes-bambulab 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +273 -0
  3. package/dist/credentials/BambuLabApi.credentials.d.ts +10 -0
  4. package/dist/credentials/BambuLabApi.credentials.d.ts.map +1 -0
  5. package/dist/credentials/BambuLabApi.credentials.js +73 -0
  6. package/dist/credentials/BambuLabApi.credentials.js.map +1 -0
  7. package/dist/nodes/BambuLab/BambuLab.node.d.ts +6 -0
  8. package/dist/nodes/BambuLab/BambuLab.node.d.ts.map +1 -0
  9. package/dist/nodes/BambuLab/BambuLab.node.js +647 -0
  10. package/dist/nodes/BambuLab/BambuLab.node.js.map +1 -0
  11. package/dist/nodes/BambuLab/bambulab.svg +29 -0
  12. package/dist/nodes/BambuLab/helpers/FtpHelper.d.ts +60 -0
  13. package/dist/nodes/BambuLab/helpers/FtpHelper.d.ts.map +1 -0
  14. package/dist/nodes/BambuLab/helpers/FtpHelper.js +238 -0
  15. package/dist/nodes/BambuLab/helpers/FtpHelper.js.map +1 -0
  16. package/dist/nodes/BambuLab/helpers/MqttHelper.d.ts +52 -0
  17. package/dist/nodes/BambuLab/helpers/MqttHelper.d.ts.map +1 -0
  18. package/dist/nodes/BambuLab/helpers/MqttHelper.js +314 -0
  19. package/dist/nodes/BambuLab/helpers/MqttHelper.js.map +1 -0
  20. package/dist/nodes/BambuLab/helpers/commands.d.ts +116 -0
  21. package/dist/nodes/BambuLab/helpers/commands.d.ts.map +1 -0
  22. package/dist/nodes/BambuLab/helpers/commands.js +242 -0
  23. package/dist/nodes/BambuLab/helpers/commands.js.map +1 -0
  24. package/dist/nodes/BambuLab/helpers/types.d.ts +277 -0
  25. package/dist/nodes/BambuLab/helpers/types.d.ts.map +1 -0
  26. package/dist/nodes/BambuLab/helpers/types.js +7 -0
  27. package/dist/nodes/BambuLab/helpers/types.js.map +1 -0
  28. package/examples/README.md +140 -0
  29. package/examples/monitor-print-progress.json +123 -0
  30. package/examples/upload-and-print.json +108 -0
  31. package/package.json +72 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 n8n-nodes-bambulab Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,273 @@
1
+ # n8n-nodes-bambulab
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/n8n-nodes-bambulab)](https://www.npmjs.com/package/n8n-nodes-bambulab)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ This is an n8n community node that lets you control and monitor Bambu Lab 3D printers directly from your n8n workflows.
7
+
8
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
9
+
10
+ [Installation](#installation)
11
+ [Operations](#operations)
12
+ [Credentials](#credentials)
13
+ [Compatibility](#compatibility)
14
+ [Usage](#usage)
15
+ [Resources](#resources)
16
+
17
+ ## Installation
18
+
19
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
20
+
21
+ ### Manual Installation
22
+
23
+ 1. Navigate to your n8n installation directory
24
+ 2. Install the package:
25
+ ```bash
26
+ npm install n8n-nodes-bambulab
27
+ ```
28
+ 3. Restart your n8n instance
29
+
30
+ ### Prerequisites
31
+
32
+ **IMPORTANT:** Before using this node, you MUST enable **Developer Mode** on your Bambu Lab printer. This grants local network access via MQTT and FTP.
33
+
34
+ ⚠️ **Security Warning:** Developer Mode disables authentication and allows full control over your printer. Use only on trusted networks.
35
+
36
+ #### Enabling Developer Mode
37
+
38
+ 1. On your printer, go to **Settings** → **General** → **Developer Mode**
39
+ 2. Enable **Developer Mode**
40
+ 3. Note your **LAN Access Code** from **Settings** → **Network** → **LAN Access Code**
41
+ 4. Note your **Serial Number** from **Settings** → **Device** → **Serial Number**
42
+ 5. Ensure your printer is connected to the same network as your n8n instance
43
+
44
+ 📖 [Official Guide: Enable Developer Mode](https://wiki.bambulab.com/en/knowledge-sharing/enable-developer-mode)
45
+
46
+ ## Operations
47
+
48
+ ### Print Resource
49
+ Control print jobs on your printer.
50
+
51
+ - **Start**: Start a print job from a file on the printer's SD card
52
+ - File name (required)
53
+ - Options: Bed leveling, flow calibration, vibration calibration, layer inspect, use AMS
54
+ - **Pause**: Pause the current print job
55
+ - **Resume**: Resume a paused print job
56
+ - **Stop**: Stop the current print job
57
+
58
+ ### Status Resource
59
+ Monitor printer status and get information.
60
+
61
+ - **Get Current Status**: Retrieve full printer status (temperatures, progress, state, etc.)
62
+ - **Get Print Progress**: Get progress information for the current print job
63
+ - **Get Temperature**: Get current temperature readings (nozzle, bed, chamber)
64
+
65
+ ### File Resource
66
+ Manage files on the printer via FTP.
67
+
68
+ - **Upload**: Upload a G-code or 3MF file to the printer
69
+ - File content (required)
70
+ - File name (required)
71
+ - Remote path (default: `/`)
72
+ - **List**: List files on the printer's SD card
73
+ - Path (default: `/`)
74
+ - **Delete**: Delete a file from the printer
75
+ - File path (required)
76
+
77
+ ### Camera Resource
78
+ Access the printer's camera.
79
+
80
+ - **Get Stream URL**: Get URLs for the camera stream (RTSP and HTTP)
81
+ - **Get Snapshot**: Get URL for capturing a snapshot
82
+
83
+ ⚠️ **Security Note**: The RTSP URL includes your access code for authentication (`rtsp://bblp:YOUR_ACCESS_CODE@PRINTER_IP/...`). Be careful not to expose these URLs in logs or share them publicly.
84
+
85
+ ### Control Resource
86
+ Control printer hardware and settings.
87
+
88
+ - **Set LED**: Control printer LED lights (chamber light, work light, logo LED)
89
+ - LED selection
90
+ - Mode: on, off, flashing
91
+ - **Set Speed**: Set print speed percentage (50-166%)
92
+ - Speed percentage
93
+ - **Home Axes**: Home all printer axes
94
+
95
+ ## Credentials
96
+
97
+ This node requires Bambu Lab API credentials. You need the following information from your printer:
98
+
99
+ 1. **Printer IP Address**: The local network IP address of your printer
100
+ - Find in **Settings** → **Network** → **IP Address**
101
+ 2. **Access Code**: The LAN access code
102
+ - Find in **Settings** → **Network** → **LAN Access Code**
103
+ 3. **Serial Number**: The printer's serial number
104
+ - Find in **Settings** → **Device** → **Serial Number**
105
+ 4. **MQTT Port** (optional): Default is 8883 for secure connection
106
+ 5. **Use TLS** (optional): Default is enabled. Uses self-signed certificates.
107
+ 6. **FTP Port** (optional): Default is 990 for FTPS
108
+
109
+ ## Compatibility
110
+
111
+ - **n8n Version**: 1.0.0+
112
+ - **Node.js Version**: 22.0.0+
113
+ - **Supported Printers**: X1 Series, P1 Series, A1 Series, A1 Mini
114
+
115
+ This node uses:
116
+ - **MQTT** for printer control and status monitoring
117
+ - **FTP/FTPS** for file operations
118
+
119
+ ## Usage
120
+
121
+ ### Example: Upload and Print Workflow
122
+
123
+ This workflow uploads a G-code file and starts printing:
124
+
125
+ ```
126
+ [HTTP Request] Download .gcode file
127
+
128
+ [Bambu Lab - File: Upload] Upload to printer
129
+
130
+ [Bambu Lab - Print: Start] Start printing
131
+ ```
132
+
133
+ ### Example: Print Status Monitor
134
+
135
+ Monitor print progress every 30 seconds:
136
+
137
+ ```
138
+ [Schedule Trigger] Every 30 seconds
139
+
140
+ [Bambu Lab - Status: Get Progress]
141
+
142
+ [IF] Check if progress > 50%
143
+
144
+ [Send Email] Notify when print is halfway done
145
+ ```
146
+
147
+ ### Example: Temperature Monitor
148
+
149
+ Check temperatures and send alert if too high:
150
+
151
+ ```
152
+ [Schedule Trigger] Every minute
153
+
154
+ [Bambu Lab - Status: Get Temperature]
155
+
156
+ [IF] Nozzle temp > 250°C
157
+
158
+ [Slack] Send alert to #printer-alerts
159
+ ```
160
+
161
+ ### Example Workflow JSON
162
+
163
+ See the `/examples` directory for complete workflow JSON files that you can import into n8n.
164
+
165
+ ## Troubleshooting
166
+
167
+ ### Connection Issues
168
+
169
+ **Problem**: "MQTT connection timeout" or "Failed to connect to FTP server"
170
+
171
+ **Solutions**:
172
+ 1. Verify your printer is on the same network as n8n
173
+ 2. Check that Developer Mode is enabled
174
+ 3. Confirm the printer IP address is correct
175
+ 4. Ensure firewall isn't blocking ports 8883 (MQTT) or 990 (FTP)
176
+ 5. Try pinging the printer: `ping <printer-ip>`
177
+
178
+ ### Authentication Errors
179
+
180
+ **Problem**: "MQTT connection error: Not authorized"
181
+
182
+ **Solutions**:
183
+ 1. Verify your Access Code is correct (Settings → Network → LAN Access Code)
184
+ 2. Ensure Developer Mode is enabled
185
+ 3. Try resetting the Access Code on the printer
186
+
187
+ ### File Upload Failures
188
+
189
+ **Problem**: File upload fails or times out
190
+
191
+ **Solutions**:
192
+ 1. Check that the file is a valid .gcode or .3MF file
193
+ 2. Ensure sufficient space on printer's SD card
194
+ 3. Try uploading a smaller file first to test connection
195
+ 4. Check FTP port (default: 990) is accessible
196
+
197
+ ### Print Won't Start
198
+
199
+ **Problem**: Print command succeeds but print doesn't start
200
+
201
+ **Solutions**:
202
+ 1. Verify the file name matches exactly (case-sensitive)
203
+ 2. Check that the file exists on the printer's SD card (use File → List)
204
+ 3. Ensure the printer is in IDLE state (not already printing)
205
+ 4. Check printer display for error messages
206
+
207
+ ## Resources
208
+
209
+ * [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
210
+ * [Bambu Lab Wiki - Developer Mode](https://wiki.bambulab.com/en/knowledge-sharing/enable-developer-mode)
211
+ * [OpenBambuAPI Documentation](https://github.com/Doridian/OpenBambuAPI)
212
+ * [Bambu Lab Official Website](https://bambulab.com/)
213
+
214
+ ## Development
215
+
216
+ ### Building
217
+
218
+ ```bash
219
+ npm run build
220
+ ```
221
+
222
+ ### Testing
223
+
224
+ ```bash
225
+ npm test
226
+ ```
227
+
228
+ ### Linting
229
+
230
+ ```bash
231
+ npm run lint
232
+ npm run lintfix
233
+ ```
234
+
235
+ ### Local Development
236
+
237
+ To test this node locally with n8n:
238
+
239
+ ```bash
240
+ # Build the node
241
+ npm run build
242
+
243
+ # Link globally
244
+ npm link
245
+
246
+ # In your n8n directory
247
+ npm link n8n-nodes-bambulab
248
+
249
+ # Start n8n
250
+ n8n start
251
+ ```
252
+
253
+ ## Contributing
254
+
255
+ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
256
+
257
+ ## License
258
+
259
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
260
+
261
+ ## Disclaimer
262
+
263
+ This is a community-developed node and is not officially supported by Bambu Lab. Use at your own risk. The developers are not responsible for any damage to your printer or failed prints.
264
+
265
+ ## Acknowledgments
266
+
267
+ - Built with [n8n](https://n8n.io/)
268
+ - MQTT API documentation from [OpenBambuAPI](https://github.com/Doridian/OpenBambuAPI)
269
+ - Bambu Lab for creating excellent 3D printers
270
+
271
+ ---
272
+
273
+ **Made with ❤️ for the n8n and 3D printing communities**
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class BambuLabApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
10
+ //# sourceMappingURL=BambuLabApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BambuLabApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/BambuLabApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,WAAY,YAAW,eAAe;IAClD,IAAI,SAAiB;IAErB,WAAW,SAAmB;IAE9B,gBAAgB,SACwD;IAExE,UAAU,EAAE,eAAe,EAAE,CAsD3B;IAGF,YAAY,EAAE,oBAAoB,CAGhC;IAEF,IAAI,EAAE,sBAAsB,CAK1B;CACF"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BambuLabApi = void 0;
4
+ class BambuLabApi {
5
+ name = 'bambuLabApi';
6
+ displayName = 'Bambu Lab API';
7
+ documentationUrl = 'https://wiki.bambulab.com/en/knowledge-sharing/enable-developer-mode';
8
+ properties = [
9
+ {
10
+ displayName: 'Printer IP Address',
11
+ name: 'printerIp',
12
+ type: 'string',
13
+ default: '',
14
+ required: true,
15
+ placeholder: '192.168.1.100',
16
+ description: 'The IP address of your Bambu Lab printer on your local network',
17
+ },
18
+ {
19
+ displayName: 'Access Code',
20
+ name: 'accessCode',
21
+ type: 'string',
22
+ typeOptions: {
23
+ password: true,
24
+ },
25
+ default: '',
26
+ required: true,
27
+ description: 'LAN access code from printer settings (Settings > Network > LAN Access Code)',
28
+ },
29
+ {
30
+ displayName: 'Serial Number',
31
+ name: 'serialNumber',
32
+ type: 'string',
33
+ default: '',
34
+ required: true,
35
+ placeholder: '01S00A123456789',
36
+ description: 'Printer serial number (found in Settings > Device > Serial Number). Required for MQTT communication.',
37
+ },
38
+ {
39
+ displayName: 'MQTT Port',
40
+ name: 'mqttPort',
41
+ type: 'number',
42
+ default: 8883,
43
+ description: 'MQTT port on the printer (default: 8883 for secure connection)',
44
+ },
45
+ {
46
+ displayName: 'Use TLS',
47
+ name: 'useTls',
48
+ type: 'boolean',
49
+ default: true,
50
+ description: 'Whether to use TLS/SSL for MQTT connection (recommended). Note: Bambu Lab printers use self-signed certificates.',
51
+ },
52
+ {
53
+ displayName: 'FTP Port',
54
+ name: 'ftpPort',
55
+ type: 'number',
56
+ default: 990,
57
+ description: 'FTP port on the printer for file operations (default: 990 for FTPS)',
58
+ },
59
+ ];
60
+ // Test the connection to verify credentials
61
+ authenticate = {
62
+ type: 'generic',
63
+ properties: {},
64
+ };
65
+ test = {
66
+ request: {
67
+ method: 'GET',
68
+ url: '={{$credentials.printerIp}}',
69
+ },
70
+ };
71
+ }
72
+ exports.BambuLabApi = BambuLabApi;
73
+ //# sourceMappingURL=BambuLabApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BambuLabApi.credentials.js","sourceRoot":"","sources":["../../credentials/BambuLabApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,WAAW;IACvB,IAAI,GAAG,aAAa,CAAC;IAErB,WAAW,GAAG,eAAe,CAAC;IAE9B,gBAAgB,GACf,sEAAsE,CAAC;IAExE,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,gEAAgE;SAC7E;QACD;YACC,WAAW,EAAE,aAAa;YAC1B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EACV,8EAA8E;SAC/E;QACD;YACC,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EACV,sGAAsG;SACvG;QACD;YACC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,gEAAgE;SAC7E;QACD;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;YACb,WAAW,EACV,kHAAkH;SACnH;QACD;YACC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,GAAG;YACZ,WAAW,EAAE,qEAAqE;SAClF;KACD,CAAC;IAEF,4CAA4C;IAC5C,YAAY,GAAyB;QACpC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,EAAE;KACd,CAAC;IAEF,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,6BAA6B;SAClC;KACD,CAAC;CACF;AA5ED,kCA4EC"}
@@ -0,0 +1,6 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class BambuLab implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=BambuLab.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BambuLab.node.d.ts","sourceRoot":"","sources":["../../../nodes/BambuLab/BambuLab.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAQtB,qBAAa,QAAS,YAAW,SAAS;IACzC,WAAW,EAAE,oBAAoB,CAuc/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAiOvE"}