# Processing - Serial Coms with Arduino - receiving mostly "nulls"

**URL:** <https://discourse.processing.org/t/processing-serial-coms-with-arduino-receiving-mostly-nulls/39816>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [November 21, 2022, 6:32pm UTC](https://discourse.processing.org/t/processing-serial-coms-with-arduino-receiving-mostly-nulls/39816 "2022-11-21T18:32:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Europa81](https://avatars.discourse-cdn.com/v4/letter/e/5f9b8f/32.png) [@Europa81](https://discourse.processing.org/u/Europa81)\
**Post date:** [November 21, 2022, 6:32pm UTC](https://discourse.processing.org/t/processing-serial-coms-with-arduino-receiving-mostly-nulls/39816/1 "2022-11-21T18:32:49Z")

</div>

Trying to get an Arduino report Data to Processing with a sketch which sends a String (“abcd”) every second.  
On Processing side there is:

```auto
import processing.serial.*;

Serial SerPort;
String rx = "";

void setup () {
  size (480, 320);
  println ( Serial.list() );
  SerPort = new Serial(this, "COM2", 9600);
  SerPort.bufferUntil('\n');
}

void draw () {
  if ( SerPort.available () > 0 ) {
    rx = SerPort.readStringUntil ('\n');
  }
  rx = trim(rx);
  println(rx);
}
```

As result there are some 20 “nulls” with the occasional “abcd” hidden in between. The Trim-command didn’t remedy.  
Any hint welcome.  
be well, Thomas

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [November 21, 2022, 11:50pm UTC](https://discourse.processing.org/t/processing-serial-coms-with-arduino-receiving-mostly-nulls/39816/2 "2022-11-21T23:50:29Z")

</div>

Hello @Europa81 ,

This will work and checks for the nulls:

> **[Reference](https://processing.org/reference/libraries/serial/Serial_readStringUntil_.html)**
>
> Combination of readBytesUntil() and readString(). Returns null if it doesn't find what you're looking for.

`:)`
