0
Offline
Newbie
Karma: 0
Posts: 9
Arduino rocks
|
 |
« on: November 06, 2008, 04:12:19 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
Newbie
Karma: 0
Posts: 43
Ciao a tutti.
|
 |
« Reply #1 on: November 06, 2008, 04:29:35 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2338
Do it !
|
 |
« Reply #2 on: November 06, 2008, 05:11:12 am » |
in windows you can use the Hyperterminal app. that comes with all windows versions
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5453
Strongly opinionated, but not official!
|
 |
« Reply #3 on: November 06, 2008, 06:30:53 pm » |
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"...
|
|
|
|
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #4 on: November 07, 2008, 03:57:35 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 55
Arduino rocks
|
 |
« Reply #5 on: November 28, 2008, 03:50:39 pm » |
If you are using linux you can try tail -f /dev/ttyUSB0 > filename
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 115
Arduino rocks
|
 |
« Reply #6 on: December 02, 2008, 12:30:22 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 9
Arduino rocks
|
 |
« Reply #7 on: January 03, 2011, 01:47:26 am » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
SE USA
Offline
Faraday Member
Karma: 33
Posts: 3621
@ssh0le
|
 |
« Reply #8 on: January 03, 2011, 01:49:19 am » |
depends on OS /software , what are you using?
|
|
|
|
« Last Edit: January 03, 2011, 01:50:49 am by Osgeld »
|
Logged
|
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #9 on: January 03, 2011, 02:21:09 am » |
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()
|
|
|
|
|
Logged
|
|
|
|
|
Copenhagen / Denmark
Offline
Edison Member
Karma: 5
Posts: 2338
Do it !
|
 |
« Reply #10 on: January 03, 2011, 02:44:54 am » |
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. http://www.mikmo.dk/gobetwino.html
|
|
|
|
|
Logged
|
|
|
|
|
Lancashire, UK
Offline
Edison Member
Karma: 8
Posts: 1988
|
 |
« Reply #11 on: January 03, 2011, 03:16:49 am » |
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
|
|
|
|
« Last Edit: January 03, 2011, 03:17:49 am by stephen_t »
|
Logged
|
|
|
|
|
|