node-red-nodes icon indicating copy to clipboard operation
node-red-nodes copied to clipboard

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

Open khalilddkhili opened this issue 1 year ago • 2 comments

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)

  • [ ] Node-RED version: 3.1.3
  • [ ] node.js version:v18.12.1
  • [ ] npm version:8.19.2
  • [ ] Platform/OS: windows 10
  • [ ] Browser: Microsoft Edge

khalilddkhili avatar Jun 11 '24 08:06 khalilddkhili

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

hardillb avatar Jun 11 '24 08:06 hardillb

node-red-node-serialpor v2.0.2

khalilddkhili avatar Jun 11 '24 08:06 khalilddkhili

pushed a fix to 2.0.3

dceejay avatar Aug 06 '24 13:08 dceejay