Serial monitor output to text file [solved]

How does one output the serial monitor's output (com5) to a text file? I read some where you type at the DOS prompt:
copy com5 file.txt
and that you have to end it with Ctrl+Z.
I've tried this without success, so how is it done correctly?

Use a serial terminal program that has logging? Select the text in the Serial Monitor and use the clipboard to copy and paste into a text editor?

One of the problems you are likely having with the DOS method (I'm not sure about the syntax so that could also be an issue), is when the Serial Monitor (or any other serial terminal program) is listening to your COM5, it blocks anything else from listening on it. Only one program can have a COM port open at a time (normally).

The Serial Monitor is a very simple serial terminal, not designed for much more than quick troubleshooting. Check out PuTTY and/or RealTerm for a more powerful serial terminal program. If you have hyperterminal installed on your Windows machine, I would suggest ignoring it and never running that steaming pile of bovine excrement. Sorry, I may be a bit opinionated about it. :wink:

Sembazuru:
The Serial Monitor is a very simple serial terminal, not designed for much more than quick troubleshooting. Check out PuTTY and/or RealTerm for a more powerful serial terminal program. If you have hyperterminal installed on your Windows machine, I would suggest ignoring it and never running that steaming pile of bovine excrement. Sorry, I may be a bit opinionated about it. :wink:

If I download RealTerm and install it, how do I tell Arduino's IDE to use it?

If I download RealTerm and install it, how do I tell Arduino's IDE to use it?

You don't. There are just some things you have to do for yourself.

Run RealTerm and set it to use the COM port after you have compiled and uploaded your program in the normal way.

UKHeliBob:
Run RealTerm and set it to use the COM port after you have compiled and uploaded your program in the normal way.

Thank you, I'll give this a try - thanks again

BTW, after I typed "copy com5 textfile.txt" at the DOS prompt my Arduino's serial monitor screen will not change size (can't be resized). Does anyone know how to fix this?

Does anyone know how to fix this?

Buy a new computer.

PaulS:

Does anyone know how to fix this?

Buy a new computer.

So does that mean you are the kind of guy that buys a new car because the ash tray got full. ...with the way Windoze works, I'd be buying a new computer every day

BTW, after I typed "copy com5 textfile.txt" at the DOS prompt my Arduino's serial monitor screen will not change size (can't be resized). Does anyone know how to fix this?

A basic fact is that only one application can be using a single com port at a time. If you have the serial monitor open using com5, there is no way the command prompt can send anything to com5.

sparkfuntoday:
BTW, after I typed "copy com5 textfile.txt" at the DOS prompt my Arduino's serial monitor screen will not change size (can't be resized). Does anyone know how to fix this?

You could write a better terminal program using the Processing language that the Arduino IDE is derived from. You will need to use the Serial library which is in the Very Helpful Examples.

GoForSmoke:

sparkfuntoday:
BTW, after I typed "copy com5 textfile.txt" at the DOS prompt my Arduino's serial monitor screen will not change size (can't be resized). Does anyone know how to fix this?

You could write a better terminal program using the Processing language that the Arduino IDE is derived from. You will need to use the Serial library which is in the Very Helpful Examples.

www.processing.org

Thank you GoForSmoke. I found the serial library( Serial / Libraries / Processing.org ) and like you said "Helpful Examples". However, is it a big learning curve? I just started learning Arduino late Feb of this year (about 6 or 7 weeks now) and at times it's been somewhat of a struggle.

It's less of a learning curve if you already know code, files and what you need to do.

Never mind anyway, I just went to the File IO examples and wouldn't you know, the directory list example doesn't even compile. I won't send a newbie into that mess.

Using DOS Command Line isn't going to work on all Winblows versions but for you and me, it does. XP here.
I have done that kind of thing not long ago but the results were not so good. One thing to know is that you may need to use the DOS MODE command to set up the serial protocol (rate, parity, bits) before communicating. Of course there's a default so you don't always have to set MODE.

See if Hyper Terminal doesn't have save to file options. I've used that instead of Serial Monitor when I wanted to cut&paste Arduino output.
.........
Yup. Just checked. You can receive and send files through Hyper Terminal, look in the Transfer menu.

You can copy from the Serial monitor window easily enough. No need to use yet another program. Select what you want to copy using the mouse and Control/C will do the copy for you.

UKHeliBob:
You can copy from the Serial monitor window easily enough. No need to use yet another program. Select what you want to copy using the mouse and Control/C will do the copy for you.

Running XP here and I was never able to do that which is why I tried Hyper Terminal for the first time in over 15 years.

Running Win 7 here and IDE 1.0.4 but I am surprised that it does not work when running XP. Which part fails, the selection or the copy ?

Actually it was the trying to rt-click and get a menu. Ctrl-C does work but I never tried that till now.

And Serial Monitor does allow scrolling too. But Hyper Terminal allows saving incoming data to file and sending file data out. And what I can do with my own code goes beyond either.

Thank you both GoForSmoke and UKHeliBob, I got HyperTerminal working and it works great - thanks again

Hi,i am relatively new to this domain,i bought a arduino duemilanove with atmega 328 from my friend and i compiled and uploaded my program but then the serial monitor shows a output which is actually the output of friend program.pls help i have tried everything

pls help i have tried everything

No, you haven’t. Clearly, you haven’t even successfully uploaded a new sketch to the Arduino.