# SerialEvent not called (after the first 100-300 times)

**URL:** <https://discourse.processing.org/t/serialevent-not-called-after-the-first-100-300-times/36832>\
**Category:** Libraries\
**Created:** [May 11, 2022, 6:49pm UTC](https://discourse.processing.org/t/serialevent-not-called-after-the-first-100-300-times/36832 "2022-05-11T18:49:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jango\_fx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jango_fx/32/15051_2.png) [@jango\_fx](https://discourse.processing.org/u/jango_fx)\
**Post date:** [May 11, 2022, 6:49pm UTC](https://discourse.processing.org/t/serialevent-not-called-after-the-first-100-300-times/36832/1 "2022-05-11T18:49:23Z")

</div>

is it me? or Processing 4? or macOS 12?

i’m trying to read serial data not in `draw()` but in `serialEvent()` – which worked fine in the past.

but `serialEvent()` is only called about 100-300 times in the very first seconds and then stops.

serial communication in general works fine in different other Serial monitors and also if read in `draw()`.

example code:

```processing
import processing.serial.*;
Serial serial;
int count = 0;

void setup() {
  printArray(Serial.list());
  serial = new Serial(this, Serial.list()[9], 9600);
}

void loop() {
  background(0);
}

void serialEvent(Serial p) {
  count++;
  println(count+": "+p.readStringUntil('\n'));
}

```

---

<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:** [May 11, 2022, 11:09pm UTC](https://discourse.processing.org/t/serialevent-not-called-after-the-first-100-300-times/36832/2 "2022-05-11T23:09:02Z")

</div>

Hello,

Replace:

```auto
void loop() {
  background(0);
}

```

With this:

```auto
void draw() {
  background(0);
}

```

`:)`
