I am using a usb-serial with /dev/ttyUSB0, in RaspberryPi, I can send/receive messages as following python code,
#python-start
command = b'\x01\x04\x00\x00\x00\x02\x71\xcb'
with serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=1.0) as ser:
ser.write(command)
s = ser.read(11)
print(s)
##response example,
b'\x01\x04\x04\x08\xb9\x13\x85\xe4\x92'
###python-end
Now, I want to use Node-red "node-red-node-serialport", failed.
What I am trying,
#nodered function
var b = Buffer.from([1,4,0,0,0,2,113,203]);
msg.payload = b;
I tried "inject" with "buffer" ["0x01","0x04","0x00","0x00","0x00","0x02","0xe4","0x92"].
It doesn't work, why?