# Serial node red raspberry pi/arduino

**URL:** <https://discourse.nodered.org/t/serial-node-red-raspberry-pi-arduino/82858>\
**Category:** General\
**Created:** [14 November 2023 15:59 UTC](https://discourse.nodered.org/t/serial-node-red-raspberry-pi-arduino/82858 "2023-11-14T15:59:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mecatix](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Mecatix](https://discourse.nodered.org/u/Mecatix)\
**Post date:** [14 November 2023 15:59 UTC](https://discourse.nodered.org/t/serial-node-red-raspberry-pi-arduino/82858/1 "2023-11-14T15:59:21Z")

</div>

Hi,  
I'm looking for a solution, I'm serial communicating back and forth between Node Red and an Arduino via a Raspberry Pi based API USB port.  
My Arduino UNO serves as a fast input board for two encoders. Via serial communication, the time in milliseconds and the number of steps taken are sent back to calculate a speed on Node Red which will be used to control and regulate the speed of my DC motors. Everything works, however, I have one problem, which is that I am not reading the latest data sent by the Arduino via serial communication, because the old data remains stored in a buffer at the output of the "Serial in" node in the "node-red-node-serialport" palette.  
How can I flush this buffer or recover the last sent serial message?  
I hope someone can guide me to a solution.  
Best wishes

---

<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:** [13 January 2024 15:59 UTC](https://discourse.nodered.org/t/serial-node-red-raspberry-pi-arduino/82858/2 "2024-01-13T15:59:55Z")

</div>

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