# Lose data from serial port

**URL:** <https://discourse.processing.org/t/lose-data-from-serial-port/17697>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [February 10, 2020, 6:20pm UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697 "2020-02-10T18:20:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lzwang26](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lzwang26](https://discourse.processing.org/u/lzwang26)\
**Post date:** [February 10, 2020, 6:20pm UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697/1 "2020-02-10T18:20:38Z")

</div>

I’m trying to send data from Arduino to Processing. Three data are sent by Arduino which separated by comma (like 616, 224, 1200), and is split and stored. The data can be read and printed by Arduino Serial monitor properly. But in processing, sometimes the running is interrupted by the error "Error, disabling serialEvent() for COM15. null ". The screen capture is below:  
 ![processing_Error](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/ff8b95150367ad7bae164ee40f51a1884bf98682.png)  
We can see the latest data lose commas and some digits.

The code for processing is below:

```auto
import processing.serial.*;

Serial myPort; // The serial port

void setup () {
   
   println(Serial.list());
   myPort = new Serial(this, Serial.list()[2], 115200);
   myPort.bufferUntil('\n');
}

void draw () {
}

void serialEvent (Serial myPort) {

   String inString = myPort.readString();

   if (inString != null) {
     String[] list = split(inString, ',');
     println(inString);
     String IBI = list[2];
   }
}

```

Can anyone help me about this?

Thanks!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 10, 2020, 6:29pm UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697/2 "2020-02-10T18:29:24Z")

</div>

> [@Using two different readStringUntil "characters"](https://discourse.processing.org/t/using-two-different-readstringuntil-characters/10769/6):
>
> The solution I gave on that link expects the Arduino C code to send the multi-data as if they were a row of tab-separated values (TSV): face_with_monocle That is, each value is followed by a \t character; except last 1, which is followed by an \n instead: nerd_face Serial.print(temperature); Serial.write('\t'); Serial.print(masse); Serial.write('\t'); Serial.print(humidite); Serial.write('\t'); Serial.print(comptage); Serial.write('\t'); Serial.println(son); // implies '\n' At the Pro…

---

<div class="post-metadata">

**Author:** ![lzwang26](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lzwang26](https://discourse.processing.org/u/lzwang26)\
**Post date:** [February 11, 2020, 12:45am UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697/3 "2020-02-11T00:45:36Z")

</div>

Thanks so much for your help! But actually I’ve found the reason which is the hardware. Thanks anyway!

---

<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:** [February 11, 2020, 11:25am UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697/4 "2020-02-11T11:25:52Z")

</div>

> [@lzwang26](#):
>
> I’ve found the reason which is the hardware.

Hello,

Hardware issues are always of interest to me.  
Can you share what it was?

’ 🙂 ’

---

<div class="post-metadata">

**Author:** ![lzwang26](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lzwang26](https://discourse.processing.org/u/lzwang26)\
**Post date:** [February 12, 2020, 7:41pm UTC](https://discourse.processing.org/t/lose-data-from-serial-port/17697/5 "2020-02-12T19:41:48Z")

</div>

Sure! I soldered the USB TTL cable to an Arduino Nano, and connect the USB TTL cable to another USB extension cable to PC. I think the problem is from soldering or cable connection, because I’ve tested with the jump wire, there’s no data losing any more.
