Here is an updated flow with a helper function that will append a checksum to the command:
[
{
"id": "2380fa94b7c3d5ef",
"type": "tab",
"label": "Flow 5",
"disabled": false,
"info": "",
"env": []
},
{
"id": "843e8e7c515a8234",
"type": "ncd-gateway-node",
"z": "2380fa94b7c3d5ef",
"name": "",
"connection": "982da71980664144",
"unknown_devices": true,
"outputs": 2,
"x": 790,
"y": 520,
"wires": [
[],
[
"50f028d1be0e2510"
]
]
},
{
"id": "7d6bb2d7fd6ceae1",
"type": "inject",
"z": "2380fa94b7c3d5ef",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 230,
"y": 520,
"wires": [
[
"fa2bd0a7cde0dca1"
]
]
},
{
"id": "fa2bd0a7cde0dca1",
"type": "function",
"z": "2380fa94b7c3d5ef",
"name": "",
"func": "msg = {};\nmsg.payload = {};\nmsg.payload.address = \"00:13:a2:00:41:db:79:51\";\n//Command without checksum\nmsg.payload.data = [0xAA,0x07,0xBD,0x01,0xFD,0x01,0x01,0x01,0x00];\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 520,
"wires": [
[
"c860ad92b765a9f2"
]
]
},
{
"id": "50f028d1be0e2510",
"type": "debug",
"z": "2380fa94b7c3d5ef",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1070,
"y": 560,
"wires": []
},
{
"id": "c860ad92b765a9f2",
"type": "function",
"z": "2380fa94b7c3d5ef",
"name": "Add Checksum",
"func": "var command = msg.payload.data;\nvar sum = 0x00;\nfor(i = 0; i < command.length; i++){\n sum+=command[i];\n}\ncommand.push(sum&0xFF);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 580,
"y": 520,
"wires": [
[
"843e8e7c515a8234",
"21f8f5bb56e4aad1"
]
]
},
{
"id": "21f8f5bb56e4aad1",
"type": "debug",
"z": "2380fa94b7c3d5ef",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 440,
"wires": []
},
{
"id": "982da71980664144",
"type": "ncd-gateway-config",
"name": "",
"comm_type": "serial",
"ip_address": "",
"tcp_port": "2101",
"port": "/dev/tty.usbserial-AC3VPU0N",
"baudRate": "115200",
"pan_id": "7fff",
"rssi": false
}
]