Need logging or save to file for the serial monitor

This is a feature request.

Aside, this has been asked a few times going back at least ten years. But the answers have not been adequate. The functionality is needed, and the proposed workarounds, at the east the ones that Ive seen in the forum, do not actually work.

Let's see if we can explain what is going on and why we need this functionality.

The use case:

Bob has written some code and has added numerous print statements to help him debug or analyze his code

The output is several screens worth in the serial monitor in the IDE. Bob needs to save this to a file and print it, so that he can more easily analyze what is going on in his code.

Ideally there would be a button to turn on logging to save output to a file, or to dump the the lines already in the scroll buffer to a file.

Serial Monitor in the IDE seems to not have any of this capability.

In the forum, there have been two answers:

A) Ctrl -A This does not work. Ctrl-A highlights the code window, not the serial monitor.

B) Copy and paste - This does not work. You can select the text in the Serial Monitor, but Ctrl-C does not copy it to any paste buffer.

C) Use a different serial monitor program - This is a non-answer that only reiterates that the functionality is missing in the Serial Monitor in the IDE.

Can we please get this fixed? After ten years of this topic coming up in the forums, we should at least understand that there is a not very unusual use case that is not being addressed.

Thank you

I'm not denying that it could be useful but you might be missing the intended use of the serial monitor: a simple tool for beginners to display data that does not require a beginner to use a third party terminal program that can interfere with uploads.
And that is achieved because the closing / opening of the serial monitor can be controlled from the IDE.

All enhancement requests (for serial monitor): GitHub · Where software is built.

Your request specifically: Add a save output to file option to serial monitor · Issue #549 · arduino/arduino-ide · GitHub.

I do it all the time without any problems. I start at the end of the text I want in the Serial Monitor, hold the left mouse button down, and drag to the start of the section. Then I release the button and press Ctrl+C to copy it to the clipboard. You can then paste it into your editor to print or modify it.

I use Geany and just open another tab, click into the empty page, and press Ctrl+V. From there, I can save it, print it, modify it whatever I need. I'm using Arduino IDE 1.8.13, and this has worked on all versions of the IDE I’ve used so far.

I use linux of course!

It remains a "non-solution". :wink:

I use Linux too. Cinnamon desktop.

Ctrl-c works in all of the other programs that I use, but not in the serial monitor window in the IDE.

Most would likely agree that n IDE needs a serial monitor.

Here the answer seems to be "our ide's serial montitor is different. It is for beginners, therefore we did half a job of it"

Most seem to also agree that that is not a good answer. It sounds more like an excuse.

The scroll functionality is already there. Adding two controls, one to set the depth of the scroll buffer, and another to dump the contents of the scroll buffer to a file should not be so difficult.

BTW. the item you cited #549, on github, was opened October 2021. About 4 years ago.

That sort of underlines the point here.

I just use putty to log data. I realize the IDE has to be disconnected for putty to work.

Personally I use the command prompt screen (for old folks think of DOS).

Open a command screen:

copy com1: somefile.log

or
type com1: >> data.log

where the com is the same as the IDE would use.

We are talking about basic functionality that was left out of the IDE's terminal window.

Talking about the many other programs that do do it, outside of the IDE, just underlines that it is missing in the IDE.

Maybe you should check in which forum category this is posted :rofl: There is a difference in behaviour between IDE 1.x and IDE 2.x.

And please don't tell me that that is a reason not to use IDE 2.x, I know that some people feel like that and I often use both IDE versions for that reason.

I use the current version ide

Select All does not work. Whatever text you do select in the Serial Monitor, the selection will be lost if that portion scrolls off. So you cannot select more than several dozen lines, however high you can make that portion of the window.

But Copy with Ctrl-C does work for what you have selected.

The Output window has Copy All in its right-click menu. Adding it to the Serial Monitor, or to the toolbar (along with Autoscroll, Timestamp, and Clear) would be simpler to implement.