Im trying to send a Buffer over the Serial Node.
When injecting said buffer my debug window says folowing:
TypeError [ERR_INVALID_ARG_TYPE]: The "list[1]" argument must be one of type Array, Buffer, or Uint8Array. Received type string
Now that error message is very strange to me cause im sending a Buffer via Inject node. So its kinda Node Red made. Also when Debugging the Buffer it shows correctly:
[249,163,19,5,8,0,142,249,249,163,19,5,8, ... ,249]
If tried to scan the variable of the buffer in a function with "typeof msg.payload" it brings me back "object" wich isnt a Buffer. After that i tried to convert the object to an array cause the serial node would understand that two right. Nope, well it sends the array but when you look at the Terminal on the other side it looks like this:
[249,163,19,5,8,0,142,249,249,163,19,5,8, ... ,249]false
and it should only send the actual bytes, but here it sends everything from the Array.
! TLDR !: i need a way to send a buffer to serial node.
This is what i used:
[{"id":"521ff28a.a08cac","type":"serial out","z":"91c3f483.866738","name":"Serial_OUT","serial":"4d588bfc.a481f4","x":648,"y":587,"wires":[]},{"id":"a4001877.167a78","type":"inject","z":"91c3f483.866738","name":"Buffer","topic":"","payload":"[\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x00\",\"0x8E\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x01\",\"0x1F\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x02\",\"0x6D\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x03\",\"0xFC\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x04\",\"0x89\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x05\",\"0x18\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x06\",\"0x6A\",\"0xF9\",\"0xF9\",\"0xA3\",\"0x13\",\"0x05\",\"0x08\",\"0x07\",\"0xFB\",\"0xF9\"]","payloadType":"bin","repeat":"","crontab":"","once":false,"onceDelay":"","x":261,"y":587,"wires":[["521ff28a.a08cac","232b0fab.4611d"]]},{"id":"232b0fab.4611d","type":"debug","z":"91c3f483.866738","name":"Show Buffer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":650,"y":639,"wires":[]},{"id":"4d588bfc.a481f4","type":"serial-port","z":"","serialport":"/dev/ttyUSB2","serialbaud":"115200","databits":"8","parity":"none","stopbits":"1","waitfor":"","newline":"200","bin":"bin","out":"time","addchar":"false","responsetimeout":""}]