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

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:

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'));
}

Hello,

Replace:

void loop() {
  background(0);
}

With this:

void draw() {
  background(0);
}

:)

1 Like