# Serial port node delimiter parser

**URL:** <https://discourse.nodered.org/t/serial-port-node-delimiter-parser/33246>\
**Category:** General\
**Created:** [23 September 2020 19:28 UTC](https://discourse.nodered.org/t/serial-port-node-delimiter-parser/33246 "2020-09-23T19:28:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [23 September 2020 19:28 UTC](https://discourse.nodered.org/t/serial-port-node-delimiter-parser/33246/1 "2020-09-23T19:28:54Z")

</div>

The current serial port node has the option of splitting the input data with a single character such as "0x0A". However, since there could be data with value of "0x0A", the split result could be wrong when there is data of "0x0A". So I am using two bytes "0x55 0x0A" as the input data delimiter.

For example, the input data can be:  
0x12 0x22 0x55 0x0A // 0x12 0x22 are the sensor data, 0x55 and 0x0A is the delimiter  
0x12 0xAA 0x55 0x0A // 0x12 0xAA are the sensor data. In this case, serial-port node will cause error

The input data length is not fixed. It could be:  
0x18 0x32 0x0A 0x78 0x55 0x0A // 0x18 0x32 0x0A 0x78 are the real data in this case  
However, there is no option of using more than one byte delimiter in the serial-port node.  
I have been trying to figure out a way to change delimiter parser to allow more than one character such as "0x55 0xAA" in the past day. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [23 September 2020 22:41 UTC](https://discourse.nodered.org/t/serial-port-node-delimiter-parser/33246/2 "2020-09-23T22:41:54Z")

</div>

OK I ended up modifying the 25-serial.js file that controls the serial port node.  
This is the fastest way that I can think of 😂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 November 2020 22:41 UTC](https://discourse.nodered.org/t/serial-port-node-delimiter-parser/33246/3 "2020-11-22T22:41:59Z")

</div>

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