Node Red Serial Com trouble

Hello this is my first post so let me know what info i am missing. I am currently using the node red serial nodes to communicate to a Haas machine to get data out. I am using node red on a RPI3 with a USB serial adapter. I am able to get data out with putty on the GUI of RPI but when in node red it just keeps sending the information over and over without hitting the enter key to clear and retrieve the data. I have tried \n; \r; 0x0D; for starters but no success any suggestions would be great !! Thanks !!

What keeps sending data? The node-red flow or the device at the other end?
If it is the node red flow then it should not send anything unless you send the serial node a message.
If you mean the serial node is not adding the line terminator when sending data have you selected 'add split character to output messages' in the serial node and entered the split character above that as \n (which is the default in fact).

When using the inject node with the command each time I send it the commands stack up. I have added the \n,\r and tried 0x0D with no success.

How have you added the \n?

I have tried adding it in the optionally wait for a start character of ___ ; I have tried Add character to output messages____; and in the split input__ as well as adding it to just the inject node after the command to see if that would do it. No luck?

Often devices need \r rather than \n
Easiest is to add it in the serial config node
image
Or use a function node to add it (You can't easily add it using the inject node as it will send the actual \ and r characters)

msg.payload = msg.payload + "\r";
return msg;

The function worked !! I first tried it in the node and it didn't work but when I created the function the return was successful. THANK YOU !

1 Like