Hi there,
using the following piece of code written changing just few lines from what's been written by the user AlphaBeta (here)
int input;
int numberOfCharactersRead = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available()) {
// Read next character ...
input = Serial.read();
Serial.print("DEBUG: numberOfCharactersRead ==");
Serial.println(++numberOfCharactersRead);
// Print just-read character ...
Serial.print("DEBUG: Serial.println((char)input) ==");
Serial.println((char)input);
}
}
and typing from the command-line (using Bash)
$ cat theLog > /dev/ttyACM0 # theLog: ASCII text ; /dev/ttyACM0: serial port Arduino is listening to.
via the Serial Monitor (in the Arduino IDE) I see that only ~70 bytes are read -- doesn't matter how many bytes the file is filled with.
As for my understanding, the serial port gives up listening if it takes too long to read the file ... (?) Indeed, if one uses redirection to pass an infinite flow of bytes like
$ od /dev/urandom > /dev/ttyACM0
then problems disappear.
Any suggestion on how to fix that?
Thank you folks