# Node-red-node-serialport flush serial buffer

**URL:** https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590
**Category:** General
**Created:** [31 May 2020 22:10 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590 "2020-05-31T22:10:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Starscream83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/starscream83/32/23079_2.png) [@Starscream83](https://discourse.nodered.org/u/Starscream83)
#### Post date: [31 May 2020 22:10 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/1 "2020-05-31T22:10:42Z")

</div>

Hi,

I'm using the serial-in node and i want to make sure the serial buffer is flushed after the received message has been handled in a function node.

How can this be realized?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 June 2020 10:10 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/2 "2020-06-01T10:10:37Z")

</div>

Show us how you have configured the serial port please.

---

<div class="post-metadata">

### Author: ![Starscream83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/starscream83/32/23079_2.png) [@Starscream83](https://discourse.nodered.org/u/Starscream83)
#### Post date: [1 June 2020 10:32 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/3 "2020-06-01T10:32:44Z")

</div>

Here is the Port configuration

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1cd161020dca2818dfdd61386230f862891e6384.png)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [1 June 2020 10:47 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/4 "2020-06-01T10:47:04Z")

</div>

Whenever data arrives the whole buffer is read and data sent on as per the configuration of when to send - either character split, timeout etc... in the case of timeout there would be nothing left in the buffer... - in the other cases data may accrue waiting for further input.

---

<div class="post-metadata">

### Author: ![Starscream83](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/starscream83/32/23079_2.png) [@Starscream83](https://discourse.nodered.org/u/Starscream83)
#### Post date: [2 June 2020 12:17 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/5 "2020-06-02T12:17:56Z")

</div>

Ok thanks for clarifiction.  
I just thought there must be a command to manually flush the buffer, something like port.flush();  
Reducing the timeout already helped that the buffer is flushed more frequently.

Thanks

---

<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: [16 June 2020 12:18 UTC](https://discourse.nodered.org/t/node-red-node-serialport-flush-serial-buffer/27590/6 "2020-06-16T12:18:00Z")

</div>

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