user58808: So, I am trying to transmit float data, over UART, from my Arduino to another machine. The log of this data is really large, so I am forced to put it on an SD card, and read it into the Arduino line-by-line, then transmit that single line.
The issue is that my code seems to be "grabbing" ~65 lines (or more) at a time, transmitting them over UART, then stopping (or crashing) the Arduino.
My log looks like this (a small snippet of the several thousands of lines):
14.71927
14.71795
14.71787
14.71787
14.71787
14.71799
14.7175
14.71836
14.71746
14.71787
14.71923
14.71878
14.7184
14.71791
14.71893
14.7184
14.71746
14.71799
14.71746
14.71795
14.71874
14.71795
14.71878
14.71836
14.71881
14.72235
14.72781
14.72872
14.72917
14.72826
14.73188
14.73278
14.73595
14.73783
14.74227
14.74231
14.74363
14.74683
14.7495
14.75492
14.75899
14.76396
14.76807
14.77033
14.77161
14.77262
14.77978
14.78524
14.7884
14.78746
14.79695
14.80238
14.80652
14.80648
14.81055
14.81191
14.81865
14.82234
14.82095
14.81733
14.8286
14.82908
14.82999
14.82682
14.83673

And my code looks like this (I know it says 4Hz, but is at 1Hz, but that was to help "see" the "batch" grabbing and printing):

// Define our LED pins
#define greenLED    6
#define redLED      5

// Define our serial BAUD rate
#define BAUDrate    9600

// To read data from the SD card
#include <SD.h>

// To print data to an LCD panel
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd( 0x3F, 16, 2 );

void setup(){
    // Set LED pins as outputs
    pinMode( greenLED, OUTPUT );
    pinMode( redLED, OUTPUT );

    // LED output at start: GREEN = ON, RED = OFF
    digitalWrite( greenLED, HIGH );
    digitalWrite( redLED, LOW );

    // Begin wired comms with MSP board
    Serial.begin( BAUDrate );

    // Begin reading data from SD card
    SD.begin( 4 );                      // Need pin #4 for SD card bit-shifting
    File dataLog;                       // Store our data from the SD card
    dataLog = SD.open( "DATA.TXT", FILE_READ );
    String data = dataLog.readStringUntil( "\n" ); // Prime our data

    int i = 0;

    while( data != "" ){
        i++;
        Serial.print( i );
        Serial.print( "\t" );

        Serial.println( data );         // Send our data to MSP board
        lcdUpdate( data );              // Print our sent data to the LCD screen

        delay( 1000 );                   // Wait 1/4 of a second (4 Hz)

        data = dataLog.readStringUntil( "\n" );    // Reprime our data
    }

    // Close our data log to avoid corrupting SD card contents upon restart
    dataLog.close();

    // Switch our LEDs since we're finished streaming our data
    digitalWrite( greenLED, LOW );
    digitalWrite( redLED, HIGH );
}

void loop(){
}

// Prints the current data being sent over UART to an LCD screen
void lcdUpdate( String ourData ){
    lcd.setCursor( 0, 0 );
    lcd.print( " Sending data:  " );
    lcd.setCursor( 0, 1 );
    lcd.print( "    " );
    lcd.print( ourData );
    lcd.print( "    " );
}

Again, I want it to grab a single line, print it to the serial terminal, print it to the LCD, then grab a second line and repeat.  I'm not able to test the LCD (since I don't have one with me at the moment), but the serial terminal is giving me problems, so I'm assuming the LCD won't work, either.
I'm getting something, as a Serial Terminal output, along the lines of:
1       14.71927
14.71795
14.71787
14.71787
14.71787
14.71799
14.7175
14.71836
14.71746
14.71787
14.71923
14.71878
14.7184
14.71791
14.71893
14.7184
14.71746
14.71799
14.71746
14.71795
14.71874
14.71795
14.71878
14.71836
14.71881
14.72235
14.72781
14.72872
14.72917
14.72826
14.73188
14.73278
14.73595
14.73783
14.74227
14.74231
14.74363
14.74683
14.7495
14.75492
14.75899
14.76396
14.76807
14.77033
14.77161
14.77262
14.77978
14.78524
14.7884
14.78746
14.79695
14.80238
14.80652
14.80648
14.81055
14.81191
14.81865
14.82234
14.82095
14.81733
14.8286
14.82908
14.82999
14.82682
14.83

It seems to want to stop somewhere between the 65th and 69th element, randomly.  I'm assuming that it's running out of buffer space, since it's grabbing everything from the SD card, instead of a single line, one at a time.
This has become more evident with my i = 0 line, and that it isn't iterating for every line, just the once for the ~65 lines.
Am I reading the data in incorrectly, or am I parsing things incorrectly, or is what I'm trying to do simply not possible?

user54083: Arduino's reference doesn't help with your readStringUntil call (see SD's documentation), but assuming it's the same as Stream's, it needs a character, not a string as a terminator.
Your output shows that your Arduino tried to read a line, but there were no line endings found - probably because of the '' vs. "". That's why your output starts with a 1 (i's value), and there no other line numbers after that, even though in your output clearly shows newlines.

58808: <p>So, I am trying to transmit float data, over UART, from my Arduino to another machine. The log of this data is really large, so I am forced to put it on an SD card, and read it into the Arduino line-by-line, then transmit that single line.</p>

<p>The issue is that my code seems to be "grabbing" ~65 lines (or more) at a time, transmitting them over UART, then stopping (or crashing) the Arduino.</p>

<p>My log looks like this (a small snippet of the several thousands of lines):</p>

<pre><code>14.71927
14.71795
14.71787
14.71787
14.71787
14.71799
14.7175
14.71836
14.71746
14.71787
14.71923
14.71878
14.7184
14.71791
14.71893
14.7184
14.71746
14.71799
14.71746
14.71795
14.71874
14.71795
14.71878
14.71836
14.71881
14.72235
14.72781
14.72872
14.72917
14.72826
14.73188
14.73278
14.73595
14.73783
14.74227
14.74231
14.74363
14.74683
14.7495
14.75492
14.75899
14.76396
14.76807
14.77033
14.77161
14.77262
14.77978
14.78524
14.7884
14.78746
14.79695
14.80238
14.80652
14.80648
14.81055
14.81191
14.81865
14.82234
14.82095
14.81733
14.8286
14.82908
14.82999
14.82682
14.83673
</code></pre>

<p>And my code looks like this (I know it says 4Hz, but is at 1Hz, but that was to help "see" the "batch" grabbing and printing):
</p>

<pre class="lang-cpp prettyprint-override"><code>// Define our LED pins
#define greenLED    6
#define redLED      5

// Define our serial BAUD rate
#define BAUDrate    9600

// To read data from the SD card
#include &lt;SD.h&gt;

// To print data to an LCD panel
#include &lt;LiquidCrystal_I2C.h&gt;
LiquidCrystal_I2C lcd( 0x3F, 16, 2 );

void setup(){
    // Set LED pins as outputs
    pinMode( greenLED, OUTPUT );
    pinMode( redLED, OUTPUT );

    // LED output at start: GREEN = ON, RED = OFF
    digitalWrite( greenLED, HIGH );
    digitalWrite( redLED, LOW );

    // Begin wired comms with MSP board
    Serial.begin( BAUDrate );

    // Begin reading data from SD card
    SD.begin( 4 );                      // Need pin #4 for SD card bit-shifting
    File dataLog;                       // Store our data from the SD card
    dataLog = SD.open( "DATA.TXT", FILE_READ );
    String data = dataLog.readStringUntil( "\n" ); // Prime our data

    int i = 0;

    while( data != "" ){
        i++;
        Serial.print( i );
        Serial.print( "\t" );

        Serial.println( data );         // Send our data to MSP board
        lcdUpdate( data );              // Print our sent data to the LCD screen

        delay( 1000 );                   // Wait 1/4 of a second (4 Hz)

        data = dataLog.readStringUntil( "\n" );    // Reprime our data
    }

    // Close our data log to avoid corrupting SD card contents upon restart
    dataLog.close();

    // Switch our LEDs since we're finished streaming our data
    digitalWrite( greenLED, LOW );
    digitalWrite( redLED, HIGH );
}

void loop(){
}

// Prints the current data being sent over UART to an LCD screen
void lcdUpdate( String ourData ){
    lcd.setCursor( 0, 0 );
    lcd.print( " Sending data:  " );
    lcd.setCursor( 0, 1 );
    lcd.print( "    " );
    lcd.print( ourData );
    lcd.print( "    " );
}
</code></pre>

<p>Again, I want it to grab a single line, print it to the serial terminal, print it to the LCD, then grab a second line and repeat.  I'm not able to test the LCD (since I don't have one with me at the moment), but the serial terminal is giving me problems, so I'm assuming the LCD won't work, either.</p>

<p>I'm getting something, as a Serial Terminal output, along the lines of:</p>

<pre class="lang-cpp prettyprint-override"><code>1       14.71927
14.71795
14.71787
14.71787
14.71787
14.71799
14.7175
14.71836
14.71746
14.71787
14.71923
14.71878
14.7184
14.71791
14.71893
14.7184
14.71746
14.71799
14.71746
14.71795
14.71874
14.71795
14.71878
14.71836
14.71881
14.72235
14.72781
14.72872
14.72917
14.72826
14.73188
14.73278
14.73595
14.73783
14.74227
14.74231
14.74363
14.74683
14.7495
14.75492
14.75899
14.76396
14.76807
14.77033
14.77161
14.77262
14.77978
14.78524
14.7884
14.78746
14.79695
14.80238
14.80652
14.80648
14.81055
14.81191
14.81865
14.82234
14.82095
14.81733
14.8286
14.82908
14.82999
14.82682
14.83
</code></pre>

<p>It seems to want to stop somewhere between the 65th and 69th element, randomly.  I'm assuming that it's running out of buffer space, since it's grabbing everything from the SD card, instead of a single line, one at a time.</p>

<p>This has become more evident with my <code>i = 0</code> line, and that it isn't iterating for every line, just the once for the ~65 lines.</p>

<p>Am I reading the data in incorrectly, or am I parsing things incorrectly, or is what I'm trying to do simply not possible?</p>
 54083: <p>Arduino's reference doesn't help with your readStringUntil call (<a href="https://www.arduino.cc/en/Reference/SD" rel="nofollow noreferrer">see SD's documentation</a>), but assuming it's the same as Stream's, it needs a character, not a string as a terminator.</p>

<p>Your output shows that your Arduino tried to read a line, but there were no line endings found - probably because of the '' vs. "". That's why your output starts with a 1 (i's value), and there no other line numbers after that, even though in your output clearly shows newlines.</p>
