Sensor data are not sent correctly from devboard via bluetooh low energy to pc

I have a sensor (BOSCH BMI160) that is linked to a developer board (ADAFRUIT FEATHER M0 BLUEFRUIT LE), which is Arduino compatible. Among other things, this sensor measures the acceleration as well as the orientation in x,y and z axis. Using an Arduino script, the values ​​are transferred from the sensor to the board (via I²C) and then via Bluetooth Low Energy to the an application that I wrote on the pc. A total of 12 registers are read out from the sensor, one “MSB” and one “LSB” value for each coordinate. In order to be able to know in my application when the next row will be sent, I append a line break in the Arduino script before the data is sent via Bluetooth Low Energy, as can be seen below. The “ble.print” function is from the manufacturer of the developer board and sends the relevant data to the PC.

  for (int i = 0; i < 12; i++) {


    // Separator for further processing
    if (i < 11) {

  // A line break so that my application on the pc knows that the values ​​can be plotted now

For debugging I also displayed these values ​​in the Serial Monitor, that is, before the data is sent via BLE. Most of the time everything worked fine and the results looked like this:

// Data from the Arduino Serial Monitor, before sent over BLE:

19:26:05.988 ->  11,0,69,0,198,255,188,247,197,250,120,193
19:26:06.227 ->  11,0,69,0,194,255,209,247,211,250,96,193
19:26:06.438 -> 14,0,105,0,188,255,216,247,199,250,79,193

//Data from my application, after sent over Bluetooth Low Energy

"19:26:06.034" : "11,0,69,0,198,255,188,247,197,250,120,193\r\n"
"19:26:06.260" : "11,0,69,0,194,255,209,247,211,250,96,193\r\n"
"19:26:06.486" : "14,0,105,0,188,255,216,247,199,250,79,193\r\n"

But sometimes, the data arrives like this:

// Data from the Arduino Serial Monitor, before sent over BLE:
19:26:56.649 -> Second Device: 227,211,48,210,38,234,133,244,60,31,81,46
19:26:56.884 -> Second Device: 250,251,246,1,90,2,201,248,94,39,74,36
19:26:57.120 -> Second Device: 95,233,64,254,225,253,210,0,177,28,47,64

//Data from my application, after sent over Bluetooth Low Energy

"19:26:58.198" : "227,211,48,210,38,234,133,244,60,31,81,46\r\n250,251,24"
"19:26:58.608" : "6,1,90,2,201,248,94,39,74,36\r\n95,233,64,"
"19:26:58.642" : "254,225,253,210,0,177,28,47,64\r\n7,254,27"

As you can see, dates are appended to a line even though there is already a line break at the end of the line. How can that be? And how can I make sure in my application that the values ​​that are too many at the end only appear in the next line?

I am going to venture a guess but realize I have no experience with bluetooth. It appears that you are having RF problems. If they are within a meter or so of each other separate then further. If there more then 4 meters move them closer together. I would expect there should be some error correcting which apparently is not working. You have some more work to do on your coding as well.