I just tried:
but the output is broken.
# Port setting
stty -F /dev/ttyACM0 raw speed 9600
while [ 1 ]; do
READ=`dd if=/dev/ttyACM0 count=1`
echo $READ >> filename
for clarity, I changed my arduino code to:
$ cat filename
so that I have a stream to read.
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Hello world!"); // prints hello with ending line break
I imagine I could write a server app and have it listen on a socket for the arduino. That strikes me as less easy but something which would work.
The problem with bash script above is its not listening, its just copying, its not waiting for data to get there, which is why I'm missing data.
I assume this is a common task for arduino users so I'm just looking for the best ways to get it done. The end result will be to get sensor data from an areo-flexor Im going to build. But I need to figure out how to store data from that system first.