how to save serial monitor in the text file? - Page 1
Forum section: electronics / general

author: NateDuong
author_rank: Contributor
timestamp: September 04, 2015, 08:50:42 pm
content: Dear everyone,I trying to save serial monitor in the text file, but I still do not know how, could you please help on this problem?Here is the codes with random numbers are set up, and I would like you save all data into the text file,Thank you very much,Best regards,Nate Duong,long Channel1a;long Channel1b;long Channel2a;long Channel2b;long Channel3a;long Channel3b;long Channel4a;long Channel4b;int count1 = 0;int count2 = 0;int n1 = 1000 +1; // +1 is missing countint n2 = 2 +1;void setup(){Serial.begin(9600);randomSeed(analogRead(0));}void loop(){while(count2<=n2){//Serial.print("nate1\n");while(count1<=n1){if ((count1==2)|(count1==1)){Serial.print(" Q1 I1 Q2 I2 Q3 I3 Q4 I4 \n"); // print out the channels}Channel1a = random(300); Channel1b = random(300);Channel2a = random(300); Channel2b = random(300);Channel3a = random(300); Channel3b = random(300);Channel4a = random(300); Channel4b = random(300);Serial.print(" "); Serial.print(Channel1a); Serial.print(" ");Serial.print(Channel1b); Serial.print(" ");Serial.print(Channel2a); Serial.print(" ");Serial.print(Channel2b); Serial.print(" ");Serial.print(Channel3a); Serial.print(" ");Serial.print(Channel3b); Serial.print(" ");Serial.print(Channel4a); Serial.print(" ");Serial.print(Channel4b); Serial.print(" \n");count1 = count1 +1;delay(500);}}count2 = count2 +1;Serial.print(" \n");}

author: Unknown
author_rank: Unknown
timestamp: September 04, 2015, 10:47:05 pm
content: I use putty as my serial terminal on the pc and there is an option to log all the data in a text file.

author: westfw
author_rank: Super Contributor
timestamp: September 05, 2015, 12:59:22 am
content: The Arduino Serial Monitor, like the reset of the Arduino IDE, is quite primitive. If your data is too big to Copy and Paste (into a text editor) all at once, then there is no way to use it to do what you want. Fortunately, there is nothing special or proprietary about the Arduino Serial Monitor, and you can simply use another "Terminal Emulator" or Serial Communication Tool.I also use putty on windows, and I use minicom on MacOS and Linux.

author: Morgoroth
author_rank: Regular Contributor
timestamp: September 05, 2015, 03:30:17 am
content: RealTerm and TeraTerm are very good doing that, however, you can easily program your own application for that, search "boost serial port" on google and you will founs a bunch of working examples.

author: Jeroen3
author_rank: Super Contributor
timestamp: September 05, 2015, 06:11:11 pm
content: Yes. It's too easy to write yourself. It just takes a few days of your life.Use mine:https://github.com/Jeroen6/MultiTerminal(it does not actually dump it into a file continuously, plenty of logger tools around for that. It can however split your channels realtime)

author: jimdeane
author_rank: Regular Contributor
timestamp: September 21, 2015, 03:17:27 am
content: On Linux I use the SCREEN program. It allows you to connect to serial devices, create multiple sessions, and take screenshots or run continuous logging.I use it to collect muon detector data for days or weeks at a time. Gigs of data. Works great.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: September 21, 2015, 08:05:25 am
content: On a Unix machine or a Mac OsX, it can be done in a single line of shellnohup cat /dev/cu.usbmodem1d11 > temp.log &replace "/dev/cu.usbmodem1d11" by the port you are sending data toand "temp.log" by the name the file you want to store data in.

author: mauroh
author_rank: Frequent Contributor
timestamp: September 21, 2015, 09:57:07 am
content: If you need to capture all the serial events on a txt file with an Arduino without the PC you can do it on a SD card.Take a look hereOr you can search for Arduino datalogger, it is pretty straight forward.Mauro

author: tszaboo
author_rank: Super Contributor
timestamp: September 21, 2015, 02:19:40 pm
content: Meh. Probably I'm getting old, but I would do it with a batch file. Or just type it to cmd.exemode COM1 BAUD=115200 PARITY=n DATA=8TYPE COM1 data.txt

author: NateDuong
author_rank: Contributor
timestamp: September 23, 2015, 12:24:17 pm
content: Dear all,Thank you so much for your recommendations,But the best way I tried with Batch file,It really worked.Thanks again.Best regards,Nate Duong.

author: Rick Law
author_rank: Super Contributor
timestamp: September 27, 2015, 04:29:16 am
content: For generic text capturing, Teraterm works rather nicely.If data parsing or other feature is needed, a quick Java program is a good choice too since the Arduino IDE environment already have all the Java classes needed to talk to the Arduino.

author: dentaku
author_rank: Frequent Contributor
timestamp: September 27, 2015, 12:03:06 pm
content: Quote from: NANDBlog on September 21, 2015, 02:19:40 pmThat might come in handy some day.