Hi there,
I'am Marnick Bijlsma and i'am trying to connect my Brother QL-820NWB printer with node-red.
I tried to do this with Esc/P commands via port 9100. I can see that its connected with the 9100 port and its own IP adress. Also i could make a connection with commandline (telnet). But it won't print anything with my flow. In my oppinion the Esc/P commands are right. I dont see whats wrong with it. Can anyone give me tips?
Kind regards!
Marnick Bijlsma
[
{
"id": "b87b6183948ec679",
"type": "inject",
"z": "f62543fa36a37222",
"name": "",
"props": [
{
"p": "address",
"v": "00:13:A2:00:01:02:03:04",
"vt": "str"
},
{
"p": "engineer",
"v": "Morgan",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 550,
"y": 400,
"wires": [
[
"e5dea416fe28b673"
]
]
},
{
"id": "e5dea416fe28b673",
"type": "function",
"z": "f62543fa36a37222",
"name": "",
"func": "var PTOUCH_ESC_P_MODE = Buffer.from([0x1b, 0x69, 0x61, 0x00]);\nvar INITIALIZE = Buffer.from([0x1b,0x40]);\nvar LARGE_QR = Buffer.from([0x1b,0x69,0x51,0x0C,0x02,0x00,0x00,0x00,0x00,0x02,0x00]);\nvar AUTO_LENGTH = Buffer.from([0x1b,0x69,0x6c,0x00,0x00]);\nvar LEFT_MARGIN = Buffer.from([0x1b, 0x24, 0x3C, 0x00]);\nvar FONT = Buffer.from([0x1B, 0x6B, 0x00]);\nvar FONT_SIZE = Buffer.from([0x1B, 0x58, 0x34]);\n\nvar payload = [];\npayload.push(PTOUCH_ESC_P_MODE); //Command to put printer in ESC P command mode\npayload.push(INITIALIZE); //Command to initialize printer for commands\n\n//QR Code Bytes\npayload.push(LARGE_QR); //QR code config bytes 12 dots per per cell, Model 2, auto input\npayload.push(Buffer.from(msg.address+\"\\\\\\\\\\\\\", \"utf-8\")); //Payload to embed in QR Code. Note requires three \\ to end QR payload\n\n//Text bytes\npayload.push(AUTO_LENGTH); //Auto set length of label\npayload.push(LEFT_MARGIN); //1\" left margin to allow for QR code on left side of label\npayload.push(FONT); //Helsinki font\npayload.push(FONT_SIZE); //12pt font size\npayload.push(Buffer.from(msg.address.substring(0,11)+\"\\n\", \"utf-8\")); //print first half of address on top line\npayload.push(LEFT_MARGIN); //1\" left margin to allow for QR code on left side of label\npayload.push(Buffer.from(msg.address.substring(12,23)+\"\\n\", \"utf-8\")); //print second half of address on second line\npayload.push(LEFT_MARGIN); //1\" left margin to allow for QR code on left side of label\npayload.push(Buffer.from(\"QC: \"+msg.engineer, \"utf-8\")); //print quality control engineer on third line\npayload.push(Buffer.from([0x0c])); //execute print command\n\nmsg.payload = Buffer.concat(payload);\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 400,
"wires": [
[
"7f0aa37e96206837",
"ef48ddbd41bc0fe0"
]
]
},
{
"id": "7f0aa37e96206837",
"type": "tcp out",
"z": "f62543fa36a37222",
"name": "",
"host": "192.168.2.15",
"port": "9100",
"beserver": "client",
"base64": false,
"end": true,
"tls": "",
"x": 940,
"y": 400,
"wires": []
},
{
"id": "ef48ddbd41bc0fe0",
"type": "debug",
"z": "f62543fa36a37222",
"name": "debug 32",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 940,
"y": 300,
"wires": []
}
]