Is it "text" data or "binary" data ?
If it is text data, does it have line breaks ?
The simplest way is
Code: Select all
cat /dev/ttyUSB0 >> /home/pi/myfile.txt
But that might only work for certain types of data, and there is no clear way of stopping it.
Is it supposed to run until the Pi is shutdown or disk is full ?
Most likely someone can come up with a 5-line Python script that does it for you.