How to use msg.baudrate to set the baud rate for the serial request in node-red-node-serialport

How to use msg.baudrate to set the baud rate for the serial request in node-red-node-serialport has been tested many times but failed. Please give me your advice,thank you.
1635468660(1)

You can't set serial port settings dynamically via msg

Hi Steve-Mcl it is described in the node-red-node-serialport instructions that msg.baudrate can configure the baud rate. If this node cannot be configured, is there any other method to realize this function.

Does it? My apologies. Have you tried setting it? Does it not work?

I tried to configure it, but a timeout error was reported. I don't know what went wrong. Can you help me?
image
image

Does it work if you set the baudrate in the node?

As I said on the issue that was raised, the timeout error happens after the baud rate would have been set.

I expect that the device connected to the port isn't expecting a boolean true to be sent so is not responding.

If there is no payload serial request, there will be no corresponding. According to what you said, the payload must have data to have a corresponding request?

I configured it but it doesn't work.

Using the serial-request node without a payload doesn't make any sense, the whole point of this node is to send a payload and wait for a response from what ever device is attached to the serial port.

I think we need to take a step back here and you need to explain in detail what you are actually trying to do, not the inject/serial-request/debug testcase you have provided here.

From the now closed issue (to keep all the discussion in the same place):

If I just want to modify the baud rate and use serial input as the data input node, what should I do?

Having looked at the source for the serial-request node if you remove the msg.payload and just include a msg.baudrate in the inject node, it should just change the baud rate for any serial-in and serial-out nodes attached to the same serial port.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.