node-red / node-red-nodes

Extra nodes for Node-RED
Other
988 stars 593 forks source link

Issue with node-red-node-serialport and serial control Node: “TypeError: newline.substr is not a function” when Using Fixed Length Split Configuration #1070

Closed khalilddkhili closed 1 month ago

khalilddkhili commented 3 months ago

Which node are you reporting an issue on?

I encountered an error with the node-red-node-serialport module while using the serial control node to open and close communication with a product.

What are the steps to reproduce?

1) Initial Configuration

I configured the COM port as shown in the image above with the following settings: image Split input after a timeout of 200ms Sequence Close COM port (close com - works correctly) Open COM port (open com - works correctly) Send serial commands using the serial request node (send serial commands - works correctly) Close COM port (close com - works correctly) Open COM port (open com - works correctly) 2) Problem with New Configuration When I used the following configuration:

Split input into fixed lengths of 30000 chars image and repeated the same steps, I encountered an error at step 5:

Close COM port (close com - works correctly) Open COM port (open com - works correctly) Send serial commands using the serial request node (send serial commands - works correctly) Close COM port (close com - works correctly) Open COM port (open com - error: "TypeError: newline.substr is not a function")

Lien Node-RED Forum : https://discourse.nodered.org/t/issue-with-node-red-node-serialport-and-serial-control-node-typeerror-newline-substr-is-not-a-function-when-using-fixed-length-split-configuration/88601

What happens?

error: "TypeError: newline.substr is not a function"

What do you expect to happen?

Close COM port (close com - works correctly) Open COM port (open com - works correctly) Send serial commands using the serial request node (send serial commands - works correctly) Close COM port (close com - works correctly) Open COM port (open com - works correctly) Send serial commands using the serial request node (send serial commands - works correctly) Close COM port (close com - works correctly)

hardillb commented 3 months ago

What version of the node-red-node-serialport are you using?

khalilddkhili commented 3 months ago

node-red-node-serialpor v2.0.2

dceejay commented 1 month ago

pushed a fix to 2.0.3