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.
- package/LICENSE +21 -0
- package/README.md +273 -0
- package/dist/credentials/BambuLabApi.credentials.d.ts +10 -0
- package/dist/credentials/BambuLabApi.credentials.d.ts.map +1 -0
- package/dist/credentials/BambuLabApi.credentials.js +73 -0
- package/dist/credentials/BambuLabApi.credentials.js.map +1 -0
- package/dist/nodes/BambuLab/BambuLab.node.d.ts +6 -0
- package/dist/nodes/BambuLab/BambuLab.node.d.ts.map +1 -0
- package/dist/nodes/BambuLab/BambuLab.node.js +647 -0
- package/dist/nodes/BambuLab/BambuLab.node.js.map +1 -0
- package/dist/nodes/BambuLab/bambulab.svg +29 -0
- package/dist/nodes/BambuLab/helpers/FtpHelper.d.ts +60 -0
- package/dist/nodes/BambuLab/helpers/FtpHelper.d.ts.map +1 -0
- package/dist/nodes/BambuLab/helpers/FtpHelper.js +238 -0
- package/dist/nodes/BambuLab/helpers/FtpHelper.js.map +1 -0
- package/dist/nodes/BambuLab/helpers/MqttHelper.d.ts +52 -0
- package/dist/nodes/BambuLab/helpers/MqttHelper.d.ts.map +1 -0
- package/dist/nodes/BambuLab/helpers/MqttHelper.js +314 -0
- package/dist/nodes/BambuLab/helpers/MqttHelper.js.map +1 -0
- package/dist/nodes/BambuLab/helpers/commands.d.ts +116 -0
- package/dist/nodes/BambuLab/helpers/commands.d.ts.map +1 -0
- package/dist/nodes/BambuLab/helpers/commands.js +242 -0
- package/dist/nodes/BambuLab/helpers/commands.js.map +1 -0
- package/dist/nodes/BambuLab/helpers/types.d.ts +277 -0
- package/dist/nodes/BambuLab/helpers/types.d.ts.map +1 -0
- package/dist/nodes/BambuLab/helpers/types.js +7 -0
- package/dist/nodes/BambuLab/helpers/types.js.map +1 -0
- package/examples/README.md +140 -0
- package/examples/monitor-print-progress.json +123 -0
- package/examples/upload-and-print.json +108 -0
- package/package.json +72 -0
|
@@ -0,0 +1,647 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BambuLab = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const MqttHelper_1 = require("./helpers/MqttHelper");
|
|
6
|
+
const FtpHelper_1 = require("./helpers/FtpHelper");
|
|
7
|
+
const commands_1 = require("./helpers/commands");
|
|
8
|
+
class BambuLab {
|
|
9
|
+
description = {
|
|
10
|
+
displayName: 'Bambu Lab',
|
|
11
|
+
name: 'bambuLab',
|
|
12
|
+
icon: 'file:bambulab.svg',
|
|
13
|
+
group: ['transform'],
|
|
14
|
+
version: 1,
|
|
15
|
+
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
16
|
+
description: 'Interact with Bambu Lab 3D Printers via MQTT and FTP',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Bambu Lab',
|
|
19
|
+
},
|
|
20
|
+
inputs: ['main'],
|
|
21
|
+
outputs: ['main'],
|
|
22
|
+
credentials: [
|
|
23
|
+
{
|
|
24
|
+
name: 'bambuLabApi',
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
properties: [
|
|
29
|
+
// ==================== Resource Selection ====================
|
|
30
|
+
{
|
|
31
|
+
displayName: 'Resource',
|
|
32
|
+
name: 'resource',
|
|
33
|
+
type: 'options',
|
|
34
|
+
noDataExpression: true,
|
|
35
|
+
options: [
|
|
36
|
+
{
|
|
37
|
+
name: 'Print',
|
|
38
|
+
value: 'print',
|
|
39
|
+
description: 'Control print jobs',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Status',
|
|
43
|
+
value: 'status',
|
|
44
|
+
description: 'Get printer status and information',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'File',
|
|
48
|
+
value: 'file',
|
|
49
|
+
description: 'Manage files on the printer',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Camera',
|
|
53
|
+
value: 'camera',
|
|
54
|
+
description: 'Access printer camera',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Control',
|
|
58
|
+
value: 'control',
|
|
59
|
+
description: 'Control printer settings and hardware',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
default: 'print',
|
|
63
|
+
},
|
|
64
|
+
// ==================== PRINT OPERATIONS ====================
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Operation',
|
|
67
|
+
name: 'operation',
|
|
68
|
+
type: 'options',
|
|
69
|
+
noDataExpression: true,
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: ['print'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
options: [
|
|
76
|
+
{
|
|
77
|
+
name: 'Start',
|
|
78
|
+
value: 'start',
|
|
79
|
+
action: 'Start a print job',
|
|
80
|
+
description: 'Start printing a file from the SD card',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Pause',
|
|
84
|
+
value: 'pause',
|
|
85
|
+
action: 'Pause current print',
|
|
86
|
+
description: 'Pause the currently running print job',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'Resume',
|
|
90
|
+
value: 'resume',
|
|
91
|
+
action: 'Resume paused print',
|
|
92
|
+
description: 'Resume a paused print job',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'Stop',
|
|
96
|
+
value: 'stop',
|
|
97
|
+
action: 'Stop current print',
|
|
98
|
+
description: 'Stop the currently running print job',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
default: 'start',
|
|
102
|
+
},
|
|
103
|
+
// Print: Start - File Name
|
|
104
|
+
{
|
|
105
|
+
displayName: 'File Name',
|
|
106
|
+
name: 'fileName',
|
|
107
|
+
type: 'string',
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: {
|
|
110
|
+
resource: ['print'],
|
|
111
|
+
operation: ['start'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
default: '',
|
|
115
|
+
required: true,
|
|
116
|
+
placeholder: 'model.gcode',
|
|
117
|
+
description: 'Name of the file on the printer SD card (usually in /mnt/sdcard/)',
|
|
118
|
+
},
|
|
119
|
+
// Print: Start - Options
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Additional Options',
|
|
122
|
+
name: 'printOptions',
|
|
123
|
+
type: 'collection',
|
|
124
|
+
placeholder: 'Add Option',
|
|
125
|
+
displayOptions: {
|
|
126
|
+
show: {
|
|
127
|
+
resource: ['print'],
|
|
128
|
+
operation: ['start'],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
default: {},
|
|
132
|
+
options: [
|
|
133
|
+
{
|
|
134
|
+
displayName: 'Bed Leveling',
|
|
135
|
+
name: 'bedLeveling',
|
|
136
|
+
type: 'boolean',
|
|
137
|
+
default: true,
|
|
138
|
+
description: 'Whether to perform bed leveling before printing',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
displayName: 'Flow Calibration',
|
|
142
|
+
name: 'flowCalibration',
|
|
143
|
+
type: 'boolean',
|
|
144
|
+
default: false,
|
|
145
|
+
description: 'Whether to perform flow calibration before printing',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
displayName: 'Vibration Calibration',
|
|
149
|
+
name: 'vibrationCalibration',
|
|
150
|
+
type: 'boolean',
|
|
151
|
+
default: false,
|
|
152
|
+
description: 'Whether to perform vibration calibration before printing',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Layer Inspect',
|
|
156
|
+
name: 'layerInspect',
|
|
157
|
+
type: 'boolean',
|
|
158
|
+
default: false,
|
|
159
|
+
description: 'Whether to enable layer inspection during printing',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Use AMS',
|
|
163
|
+
name: 'useAMS',
|
|
164
|
+
type: 'boolean',
|
|
165
|
+
default: false,
|
|
166
|
+
description: 'Whether to use the Automatic Material System (AMS)',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
// ==================== STATUS OPERATIONS ====================
|
|
171
|
+
{
|
|
172
|
+
displayName: 'Operation',
|
|
173
|
+
name: 'operation',
|
|
174
|
+
type: 'options',
|
|
175
|
+
noDataExpression: true,
|
|
176
|
+
displayOptions: {
|
|
177
|
+
show: {
|
|
178
|
+
resource: ['status'],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
options: [
|
|
182
|
+
{
|
|
183
|
+
name: 'Get Current Status',
|
|
184
|
+
value: 'getCurrent',
|
|
185
|
+
action: 'Get current printer status',
|
|
186
|
+
description: 'Retrieve the current status of the printer',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'Get Print Progress',
|
|
190
|
+
value: 'getProgress',
|
|
191
|
+
action: 'Get print progress',
|
|
192
|
+
description: 'Get progress information for the current print job',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'Get Temperature',
|
|
196
|
+
value: 'getTemperature',
|
|
197
|
+
action: 'Get temperature readings',
|
|
198
|
+
description: 'Get current temperature readings from the printer',
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
default: 'getCurrent',
|
|
202
|
+
},
|
|
203
|
+
// ==================== FILE OPERATIONS ====================
|
|
204
|
+
{
|
|
205
|
+
displayName: 'Operation',
|
|
206
|
+
name: 'operation',
|
|
207
|
+
type: 'options',
|
|
208
|
+
noDataExpression: true,
|
|
209
|
+
displayOptions: {
|
|
210
|
+
show: {
|
|
211
|
+
resource: ['file'],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
options: [
|
|
215
|
+
{
|
|
216
|
+
name: 'Upload',
|
|
217
|
+
value: 'upload',
|
|
218
|
+
action: 'Upload a file',
|
|
219
|
+
description: 'Upload a file to the printer via FTP',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'List',
|
|
223
|
+
value: 'list',
|
|
224
|
+
action: 'List files',
|
|
225
|
+
description: 'List files on the printer SD card',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: 'Delete',
|
|
229
|
+
value: 'delete',
|
|
230
|
+
action: 'Delete a file',
|
|
231
|
+
description: 'Delete a file from the printer SD card',
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
default: 'upload',
|
|
235
|
+
},
|
|
236
|
+
// File: Upload - File Content
|
|
237
|
+
{
|
|
238
|
+
displayName: 'File Content',
|
|
239
|
+
name: 'fileContent',
|
|
240
|
+
type: 'string',
|
|
241
|
+
displayOptions: {
|
|
242
|
+
show: {
|
|
243
|
+
resource: ['file'],
|
|
244
|
+
operation: ['upload'],
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
default: '',
|
|
248
|
+
required: true,
|
|
249
|
+
description: 'The content of the file to upload (G-code or 3MF)',
|
|
250
|
+
typeOptions: {
|
|
251
|
+
rows: 10,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
// File: Upload - File Name
|
|
255
|
+
{
|
|
256
|
+
displayName: 'File Name',
|
|
257
|
+
name: 'fileName',
|
|
258
|
+
type: 'string',
|
|
259
|
+
displayOptions: {
|
|
260
|
+
show: {
|
|
261
|
+
resource: ['file'],
|
|
262
|
+
operation: ['upload'],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
default: '',
|
|
266
|
+
required: true,
|
|
267
|
+
placeholder: 'model.gcode',
|
|
268
|
+
description: 'Name for the uploaded file',
|
|
269
|
+
},
|
|
270
|
+
// File: Upload - Remote Path
|
|
271
|
+
{
|
|
272
|
+
displayName: 'Remote Path',
|
|
273
|
+
name: 'remotePath',
|
|
274
|
+
type: 'string',
|
|
275
|
+
displayOptions: {
|
|
276
|
+
show: {
|
|
277
|
+
resource: ['file'],
|
|
278
|
+
operation: ['upload'],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
default: '/',
|
|
282
|
+
description: 'Remote path on the printer (default: root directory)',
|
|
283
|
+
},
|
|
284
|
+
// File: List - Path
|
|
285
|
+
{
|
|
286
|
+
displayName: 'Path',
|
|
287
|
+
name: 'path',
|
|
288
|
+
type: 'string',
|
|
289
|
+
displayOptions: {
|
|
290
|
+
show: {
|
|
291
|
+
resource: ['file'],
|
|
292
|
+
operation: ['list'],
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
default: '/',
|
|
296
|
+
description: 'Path to list files from (default: root directory)',
|
|
297
|
+
},
|
|
298
|
+
// File: Delete - File Path
|
|
299
|
+
{
|
|
300
|
+
displayName: 'File Path',
|
|
301
|
+
name: 'filePath',
|
|
302
|
+
type: 'string',
|
|
303
|
+
displayOptions: {
|
|
304
|
+
show: {
|
|
305
|
+
resource: ['file'],
|
|
306
|
+
operation: ['delete'],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
default: '',
|
|
310
|
+
required: true,
|
|
311
|
+
placeholder: '/model.gcode',
|
|
312
|
+
description: 'Full path to the file to delete',
|
|
313
|
+
},
|
|
314
|
+
// ==================== CAMERA OPERATIONS ====================
|
|
315
|
+
{
|
|
316
|
+
displayName: 'Operation',
|
|
317
|
+
name: 'operation',
|
|
318
|
+
type: 'options',
|
|
319
|
+
noDataExpression: true,
|
|
320
|
+
displayOptions: {
|
|
321
|
+
show: {
|
|
322
|
+
resource: ['camera'],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
options: [
|
|
326
|
+
{
|
|
327
|
+
name: 'Get Stream URL',
|
|
328
|
+
value: 'getStreamUrl',
|
|
329
|
+
action: 'Get camera stream URL',
|
|
330
|
+
description: 'Get the URL for the camera stream',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: 'Get Snapshot',
|
|
334
|
+
value: 'getSnapshot',
|
|
335
|
+
action: 'Get camera snapshot',
|
|
336
|
+
description: 'Get a snapshot from the printer camera',
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
default: 'getStreamUrl',
|
|
340
|
+
},
|
|
341
|
+
// ==================== CONTROL OPERATIONS ====================
|
|
342
|
+
{
|
|
343
|
+
displayName: 'Operation',
|
|
344
|
+
name: 'operation',
|
|
345
|
+
type: 'options',
|
|
346
|
+
noDataExpression: true,
|
|
347
|
+
displayOptions: {
|
|
348
|
+
show: {
|
|
349
|
+
resource: ['control'],
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
options: [
|
|
353
|
+
{
|
|
354
|
+
name: 'Set LED',
|
|
355
|
+
value: 'setLED',
|
|
356
|
+
action: 'Control LED lights',
|
|
357
|
+
description: 'Control printer LED lights',
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: 'Set Speed',
|
|
361
|
+
value: 'setSpeed',
|
|
362
|
+
action: 'Set print speed',
|
|
363
|
+
description: 'Set the print speed percentage',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: 'Home Axes',
|
|
367
|
+
value: 'home',
|
|
368
|
+
action: 'Home printer axes',
|
|
369
|
+
description: 'Home all printer axes',
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
default: 'setLED',
|
|
373
|
+
},
|
|
374
|
+
// Control: LED - Node
|
|
375
|
+
{
|
|
376
|
+
displayName: 'LED',
|
|
377
|
+
name: 'ledNode',
|
|
378
|
+
type: 'options',
|
|
379
|
+
displayOptions: {
|
|
380
|
+
show: {
|
|
381
|
+
resource: ['control'],
|
|
382
|
+
operation: ['setLED'],
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
options: [
|
|
386
|
+
{
|
|
387
|
+
name: 'Chamber Light',
|
|
388
|
+
value: 'chamber_light',
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
name: 'Work Light',
|
|
392
|
+
value: 'work_light',
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'Logo LED',
|
|
396
|
+
value: 'logo_led',
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
default: 'chamber_light',
|
|
400
|
+
description: 'Which LED to control',
|
|
401
|
+
},
|
|
402
|
+
// Control: LED - Mode
|
|
403
|
+
{
|
|
404
|
+
displayName: 'Mode',
|
|
405
|
+
name: 'ledMode',
|
|
406
|
+
type: 'options',
|
|
407
|
+
displayOptions: {
|
|
408
|
+
show: {
|
|
409
|
+
resource: ['control'],
|
|
410
|
+
operation: ['setLED'],
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
options: [
|
|
414
|
+
{
|
|
415
|
+
name: 'On',
|
|
416
|
+
value: 'on',
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
name: 'Off',
|
|
420
|
+
value: 'off',
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: 'Flashing',
|
|
424
|
+
value: 'flashing',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
default: 'on',
|
|
428
|
+
description: 'LED mode',
|
|
429
|
+
},
|
|
430
|
+
// Control: Speed - Percentage
|
|
431
|
+
{
|
|
432
|
+
displayName: 'Speed Percentage',
|
|
433
|
+
name: 'speedPercentage',
|
|
434
|
+
type: 'number',
|
|
435
|
+
displayOptions: {
|
|
436
|
+
show: {
|
|
437
|
+
resource: ['control'],
|
|
438
|
+
operation: ['setSpeed'],
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
default: 100,
|
|
442
|
+
typeOptions: {
|
|
443
|
+
minValue: 50,
|
|
444
|
+
maxValue: 166,
|
|
445
|
+
},
|
|
446
|
+
description: 'Print speed percentage (50-166)',
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
};
|
|
450
|
+
async execute() {
|
|
451
|
+
const items = this.getInputData();
|
|
452
|
+
const returnData = [];
|
|
453
|
+
// Get credentials
|
|
454
|
+
const credentials = (await this.getCredentials('bambuLabApi'));
|
|
455
|
+
// Initialize helpers
|
|
456
|
+
const mqttClient = new MqttHelper_1.BambuLabMqttClient(credentials);
|
|
457
|
+
const ftpClient = new FtpHelper_1.BambuLabFtpClient(credentials);
|
|
458
|
+
const commands = new commands_1.BambuLabCommands();
|
|
459
|
+
try {
|
|
460
|
+
// Track if MQTT connection has been established
|
|
461
|
+
let mqttConnected = false;
|
|
462
|
+
for (let i = 0; i < items.length; i++) {
|
|
463
|
+
try {
|
|
464
|
+
const resource = this.getNodeParameter('resource', i);
|
|
465
|
+
const operation = this.getNodeParameter('operation', i);
|
|
466
|
+
let responseData = {};
|
|
467
|
+
// Connect to MQTT once if needed for MQTT-based resources
|
|
468
|
+
if ((resource === 'print' || resource === 'status' || resource === 'control') &&
|
|
469
|
+
!mqttConnected) {
|
|
470
|
+
await mqttClient.connect();
|
|
471
|
+
mqttConnected = true;
|
|
472
|
+
}
|
|
473
|
+
// ==================== PRINT RESOURCE ====================
|
|
474
|
+
if (resource === 'print') {
|
|
475
|
+
if (operation === 'start') {
|
|
476
|
+
const fileName = this.getNodeParameter('fileName', i);
|
|
477
|
+
const options = this.getNodeParameter('printOptions', i, {});
|
|
478
|
+
const command = commands.startPrint(fileName, {
|
|
479
|
+
bedLeveling: options.bedLeveling,
|
|
480
|
+
flowCalibration: options.flowCalibration,
|
|
481
|
+
vibrationCalibration: options.vibrationCalibration,
|
|
482
|
+
layerInspect: options.layerInspect,
|
|
483
|
+
useAMS: options.useAMS,
|
|
484
|
+
});
|
|
485
|
+
await mqttClient.publishCommand(command);
|
|
486
|
+
responseData = {
|
|
487
|
+
success: true,
|
|
488
|
+
message: `Print job started: ${fileName}`,
|
|
489
|
+
fileName,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
else if (operation === 'pause') {
|
|
493
|
+
const command = commands.pausePrint();
|
|
494
|
+
await mqttClient.publishCommand(command);
|
|
495
|
+
responseData = { success: true, message: 'Print paused' };
|
|
496
|
+
}
|
|
497
|
+
else if (operation === 'resume') {
|
|
498
|
+
const command = commands.resumePrint();
|
|
499
|
+
await mqttClient.publishCommand(command);
|
|
500
|
+
responseData = { success: true, message: 'Print resumed' };
|
|
501
|
+
}
|
|
502
|
+
else if (operation === 'stop') {
|
|
503
|
+
const command = commands.stopPrint();
|
|
504
|
+
await mqttClient.publishCommand(command);
|
|
505
|
+
responseData = { success: true, message: 'Print stopped' };
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}" for resource "print"`, { itemIndex: i });
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
// ==================== STATUS RESOURCE ====================
|
|
512
|
+
else if (resource === 'status') {
|
|
513
|
+
if (operation === 'getCurrent') {
|
|
514
|
+
const status = await mqttClient.getStatus();
|
|
515
|
+
responseData = status;
|
|
516
|
+
}
|
|
517
|
+
else if (operation === 'getProgress') {
|
|
518
|
+
const status = await mqttClient.getStatus();
|
|
519
|
+
responseData = {
|
|
520
|
+
progress: status.mc_percent || 0,
|
|
521
|
+
layer: status.layer_num || 0,
|
|
522
|
+
totalLayers: status.total_layer_num || 0,
|
|
523
|
+
remainingTime: status.mc_remaining_time || 0,
|
|
524
|
+
fileName: status.gcode_file || '',
|
|
525
|
+
state: status.gcode_state || 'UNKNOWN',
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
else if (operation === 'getTemperature') {
|
|
529
|
+
const status = await mqttClient.getStatus();
|
|
530
|
+
responseData = {
|
|
531
|
+
nozzle: {
|
|
532
|
+
current: status.nozzle_temper || 0,
|
|
533
|
+
target: status.nozzle_target_temper || 0,
|
|
534
|
+
},
|
|
535
|
+
bed: {
|
|
536
|
+
current: status.bed_temper || 0,
|
|
537
|
+
target: status.bed_target_temper || 0,
|
|
538
|
+
},
|
|
539
|
+
chamber: status.chamber_temper || 0,
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}" for resource "status"`, { itemIndex: i });
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
// ==================== FILE RESOURCE ====================
|
|
547
|
+
else if (resource === 'file') {
|
|
548
|
+
if (operation === 'upload') {
|
|
549
|
+
const fileContent = this.getNodeParameter('fileContent', i);
|
|
550
|
+
const fileName = this.getNodeParameter('fileName', i);
|
|
551
|
+
const remotePath = this.getNodeParameter('remotePath', i, '/');
|
|
552
|
+
const result = await ftpClient.uploadFile({
|
|
553
|
+
fileContent,
|
|
554
|
+
fileName,
|
|
555
|
+
remotePath,
|
|
556
|
+
});
|
|
557
|
+
responseData = result;
|
|
558
|
+
}
|
|
559
|
+
else if (operation === 'list') {
|
|
560
|
+
const path = this.getNodeParameter('path', i, '/');
|
|
561
|
+
const result = await ftpClient.listFiles(path);
|
|
562
|
+
responseData = result;
|
|
563
|
+
}
|
|
564
|
+
else if (operation === 'delete') {
|
|
565
|
+
const filePath = this.getNodeParameter('filePath', i);
|
|
566
|
+
const result = await ftpClient.deleteFile(filePath);
|
|
567
|
+
responseData = result;
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}" for resource "file"`, { itemIndex: i });
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
// ==================== CAMERA RESOURCE ====================
|
|
574
|
+
else if (resource === 'camera') {
|
|
575
|
+
if (operation === 'getStreamUrl') {
|
|
576
|
+
responseData = {
|
|
577
|
+
rtsp: `rtsp://bblp:${credentials.accessCode}@${credentials.printerIp}/streaming/live/1`,
|
|
578
|
+
http: `http://${credentials.printerIp}:6000/stream`,
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
else if (operation === 'getSnapshot') {
|
|
582
|
+
responseData = {
|
|
583
|
+
url: `http://${credentials.printerIp}:6000/snapshot`,
|
|
584
|
+
message: 'Use this URL to fetch a snapshot image',
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}" for resource "camera"`, { itemIndex: i });
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
// ==================== CONTROL RESOURCE ====================
|
|
592
|
+
else if (resource === 'control') {
|
|
593
|
+
if (operation === 'setLED') {
|
|
594
|
+
const ledNode = this.getNodeParameter('ledNode', i);
|
|
595
|
+
const ledMode = this.getNodeParameter('ledMode', i);
|
|
596
|
+
const command = commands.setLED(ledNode, ledMode);
|
|
597
|
+
await mqttClient.publishCommand(command);
|
|
598
|
+
responseData = { success: true, message: `LED ${ledNode} set to ${ledMode}` };
|
|
599
|
+
}
|
|
600
|
+
else if (operation === 'setSpeed') {
|
|
601
|
+
const speedPercentage = this.getNodeParameter('speedPercentage', i);
|
|
602
|
+
const command = commands.setSpeed(speedPercentage);
|
|
603
|
+
await mqttClient.publishCommand(command);
|
|
604
|
+
responseData = { success: true, message: `Speed set to ${speedPercentage}%` };
|
|
605
|
+
}
|
|
606
|
+
else if (operation === 'home') {
|
|
607
|
+
const command = commands.homeAxes();
|
|
608
|
+
await mqttClient.publishCommand(command);
|
|
609
|
+
responseData = { success: true, message: 'Homing axes' };
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}" for resource "control"`, { itemIndex: i });
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
// Unknown resource
|
|
616
|
+
else {
|
|
617
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource "${resource}"`, { itemIndex: i });
|
|
618
|
+
}
|
|
619
|
+
returnData.push({
|
|
620
|
+
json: responseData,
|
|
621
|
+
pairedItem: { item: i },
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
if (this.continueOnFail()) {
|
|
626
|
+
returnData.push({
|
|
627
|
+
json: {
|
|
628
|
+
error: error.message,
|
|
629
|
+
},
|
|
630
|
+
pairedItem: { item: i },
|
|
631
|
+
});
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
634
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return [returnData];
|
|
638
|
+
}
|
|
639
|
+
finally {
|
|
640
|
+
// Clean up connections
|
|
641
|
+
mqttClient.disconnect();
|
|
642
|
+
ftpClient.disconnect();
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
exports.BambuLab = BambuLab;
|
|
647
|
+
//# sourceMappingURL=BambuLab.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BambuLab.node.js","sourceRoot":"","sources":["../../../nodes/BambuLab/BambuLab.node.ts"],"names":[],"mappings":";;;AAOA,+CAAkD;AAElD,qDAA0D;AAC1D,mDAAwD;AACxD,iDAAsD;AAGtD,MAAa,QAAQ;IACpB,WAAW,GAAyB;QACnC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,8DAA8D;QACxE,WAAW,EAAE,sDAAsD;QACnE,QAAQ,EAAE;YACT,IAAI,EAAE,WAAW;SACjB;QACD,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE;YACZ;gBACC,IAAI,EAAE,aAAa;gBACnB,QAAQ,EAAE,IAAI;aACd;SACD;QACD,UAAU,EAAE;YACX,+DAA+D;YAC/D;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,OAAO;wBACd,WAAW,EAAE,oBAAoB;qBACjC;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;wBACf,WAAW,EAAE,oC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