Serial to file?

Does anyone have any suggestions for an application that can log serial inputs to file? For linux or windows, I don't mind.

I've got my arduino reading temperatures and printing them to the serial monitor - now I just want to be able to log these readings to file so I can report on them later.

Check out screen on your linux computer. Usage should be something like: screen /device/.... BAUDRATE

You can use the -X tag to create a hardcopy of the output.

in windows you can use the Hyperterminal app. that comes with all windows versions

I use "minicom" which is a pretty standard linux/unix app.
You'll find that most programs aimed at serial communications will have some sort of log-to-file capability. If you're looking for something that runs invisibly in the background, or generates timestamps, or stuff like that, it might be more difficult. You could look at the things aimed at "console management" (of server farms) like "conserver"...

If you enjoy programming, another approach is to write a simple sketch in Processing that monitors the serial port and writes incoming data to a file. You could add a graph of the most recent readings if you wanted to display something like that.

If you are using linux you can try

tail -f /dev/ttyUSB0 > filename

I tried the tail command, it created the file but never wrote to it. I'm not to deep into unix, so maybe it's something simple.

Just digging up an old thread I started a while ago to see if anyone has any new ideas?

I have a sketch that prints values to serial - I would love to be able to save these to file and then report on them later.

Any tips?

depends on OS /software , what are you using?

mini serial capture in python

import sys, os, serial, threading

def monitor():

    ser = serial.Serial(COMPORT, BAUDRATE, timeout=0)

    while (1):
        line = ser.readline()
        if (line != ""):
            #print line[:-1]         # strip \n
            fields = line[:-1].split('; ');
            // ID = fields[0]
                  // TIME = int(fields[1])
            # print fields
            print "device ID: ", ID
            # write to file
            text_file = open("Pdata.log", "w")
            text_file.write(line)
            text_file.close()

        # do some other things here

    print "Stop Monitoring"


""" -------------------------------------------
MAIN APPLICATION
"""  

print "Start Serial Monitor"
print

COMPORT = 4;
BAUDRATE = 115200

monitor()

If you are using a Windows PC, GoBetwino can log data from Arduino to a txt file. It's even possible to make CSV files that can be imported to databases or spreadsheet programs.

If needed GoBetwino will allow you to send data directly into Excell cells.

The tail suggestion for linux doesn't stop reading and doesn't close the file until you stop it yourself. I program the arduino to send the stuff over and over, and use

cat /dev/ttyUSB0|head -n 5 > fred.txt

It reads 5 lines of output and saves it to a file fred.txt and stops.

You may need to use stty to set the port to the correct baudrate etc beforehand

stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -clocal

If you're using a new fangled arduino /dev/ttyACM0 is the 'standard' port name rather than /dev/ttyUSB0