I would like to stop or capture the serial monitor output. Disabling the serial monitor or holding the board in reset clobbers the output. Is there a way to change the behavior? Or a way to capture a bit of the output?
Thanks.
I was going to suggest the following
turn off Autoscroll in the Serial monitor
manually scroll the Serial monitor to the output that you want capture
select the required Serial monitor output with the mouse
use Ctrl+C to copy the selected data to the clipboard
use the copied data as required
This works in the classic IDE
However, for me at least, using Windows and
Version: 2.0.0-rc3-nightly.20211223
Date: 2021-12-23T03:03:39.572Z
CLI Version: 0.20.2 [13783819]
Copyright © 2022 Arduino SA
the linefeeds seem not to be copied, which makes the resulting data layout useless
@pert this presumably is a known problem
Should be fixed in the latest versions:
opened 03:46AM - 05 Jun 21 UTC
closed 01:10PM - 23 Dec 21 UTC
type: enhancement
conclusion: resolved
topic: code
topic: serial monitor
**Is your feature request related to a problem? Please describe.**
When removin… g a board that had its output displayed on the serial monitor, the serial monitor will clear and begin trying to repeatedly reconnect. For example, a user may want to analyse the output of an board without being bombarded with now messages, or where a board is a shared resource and serial output is used to get debug information that can be worked on while someone else uses the board.
**Describe the solution you'd like**
The serial monitor should not clear after the board is disconnected and instead. Also there should be an option to enable auto-reconnect to stop messages potentially blocking the serial monitor (similar to arduino/arduino-ide#314), and instead show a single message giving the user the option to begin the auto-reconnect process.
**Describe alternatives you've considered**
- Turning off auto-scroll allows the messages to be viewed but not highlighted or copied (#247, arduino/arduino-ide#167).
- Also, as this could be done in the original Arduino IDE, a user could have both installed and use 2.x for development and 1.x for the serial monitor though that would be extremely inconvenient.
It is:
opened 07:40AM - 31 Dec 21 UTC
closed 12:14AM - 22 Jun 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
It is sometimes useful to copy the text that was printed … by an Arduino board to Serial Monitor. For example, I sometimes copy CSV-style data into a spreadsheet program when I want to do further manipulation and analysis.
:bug: This is currently not possible to do with any multi-line text because the copied content has missing (or perhaps non-standard) line endings.
## To Reproduce
1. Upload a sketch that prints multiple lines of text to serial:
```cpp
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("hello");
delay(1000);
}
```
1. Open the Serial Monitor view in the Arduino IDE (**Tools > Serial Monitor**).
1. Select multiple lines of the text that was printed in the Serial Monitor view.
1. Paste it into a text editor or spreadsheet program.
:bug: The line endings are not present:
```
hellohellohello
```
## Expected behavior
Text copied from Serial Monitor has standard line endings.
## Arduino IDE version
2.0.0-rc3
## Operating system
Windows, Linux
## Operating system version
Windows 10, Ubuntu 20.04
## Additional context
After copying the following Serial Monitor output:
```text
a
a
a
```
This command reveals that there are no line endings:
```text
$ xclip -selection clipboard -out | xxd -p
616161
```
---
I'm not sure why, but I do get line breaks when I paste the text to the Arduino Forum (Discourse) composer field. In that case, the problem is opposite because I get double spaced text.
But when pasting to VS Code, Notepad++, LibreOffice Calc, GitHub comment field, etc., even a fenced code block on the forum, I get no line breaks.
---
Related:
- https://github.com/arduino/arduino-ide/issues/105
---
Originally reported at:
- https://forum.arduino.cc/t/serial-monitor/698844
- https://forum.arduino.cc/t/serial-monitor-text-copying-not-quite-right/938730
- https://forum.arduino.cc/t/each-day-a-new-problem/937997/3
- https://github.com/arduino/arduino-ide/issues/427#issuecomment-885018751
- https://forum.arduino.cc/t/text-selection-serial-monitor/1005262
Unless there is some special procedure, incantation, or ritual that I do not know about what I am seeing with IDE 2.0 is that it rolls up the carpet and goes home. No artifacts left for little Jackie to view.
Hey, I missed that at first, sorry. You are on to something there, thanks. However when I paste it into Notepad++ it is all one line, but works OK with Word/LibreOffice. I need to get the EOL setups aligned...
Many thanks.
I don't think the EOL choice works either.
captainaubrey:
the EOL choice
By "EOL choice", do you mean this menu?:
This only controls the addition of line endings to the data sent through the serial port by the user via the "Message " field of Serial Monitor. It does not have any effect on the line endings of the data that was received from the serial port and printed on Serial Monitor.
Thanks for the note as I was unaware of that. I also do not remember anything about it in tutorial but I am older than dirt so I forget stuff.
system
Closed
July 6, 2022, 3:50am
10
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.