I am using 2.3.2 and I cannot copy the entire text of the serial monitor into the buffer. I did a search and found this issue has been around for a long time now. Why won't they address this?
Hi @gquiring. Arduino IDE is a free open source software product. You are welcome to contribute the changes to the codebase that are required to add the missing functionality.
You can learn how to do that from this guide:
https://github.com/arduino/arduino-ide/blob/main/docs/contributor-guide/pull-requests.md
Install a free Serial Monitor program like PuTTY (windows, Linux, mac) or minicom (Linux). You will close the IDE Serial Monitor and use the new app as the IDE serial monitor which will make available; logging, saving to file and select/copy.
minicom can be installed using Linux package manager.
If you have windows, you can stream the serial input directly to a text file:
copy com1: somefile.log
type com1: >> data.log
echo hello > COM1
The echo command is typically used to display a string in the console. Here however, its output is redirected (using the “>” character) to the special filename “COM1”, which is actually a serial port rather than a file on disk. So the string “hello” gets sent to the serial port rather than to the screen.
There are a couple of potential snags though:
You need to know the number of the COM port you want to send to. If you’re using a USB-to-serial converter, this number may change over time, especially if you plug the device into different USB sockets. (SerialSend provides an easy alternative method of sending strings to whatever the highest numbered available COM port is, which can be very useful.)
The string that gets sent in the above example is actually 8 bytes long because it includes the trailing space character after the word “hello” as well as carriage return and line feed characters. I tested this myself by capturing the transmitted bytes using a microcontroller and then echoing their numerical values back to the screen – the values were: “104 101 108 108 111 32 13 10”. The first five byte values in the sequence are just the letters of the word “hello”, but the last three are the space, carriage return and line feed characters. An alternative method of sending the string without these trailing characters using the set command is shown below.
The serial port you’re using may not already be set to the baudrate you desire. In this case, an additional mode command can be used to configure the baudrate (and/or other serial parameters).
Higher numbered COM ports may not be recognised when written this way, but a workaround is shown below.
The following example is a more robust version of the command shown above:
set /p x="hello" <nul >\\.\COM22
This probably looks a bit confusing, so let’s break it down.
The set command is normally used to set the value of an environment variable. For example, the following command could be used to set an environment variable called x equal to the string “sunshine”:
set x="sunshine"
When used with the “/p” switch, the set command prompts the user to enter a value for the environment variable. The prompt displayed on screen is the string provided in the command. For example,
set /p x="Enter a value for x: "
Of course, we’re actually not interested in setting the value of x at all – it’s just a means to a different end. All we really want is a way of outputting the string “hello” without any carriage return and line feed characters, and the set command just happens to provide a convenient way of doing it.
We don’t want the set command to sit around waiting for the user to enter a value for x, so the input to the set command is redirected from “nul” (i.e. no input at all, rather than input from the console which would normally be the case). This means that the command finishes immediately rather than waiting for something to be typed in. Input redirection is performed using the “<" character.
set /p x="Enter a value for x: " <nul
Now that we’re outputting the correct characters (and only the correct characters), we need to redirect the output to COM22. To ensure that the COM port name is recognised when redirecting the output, its special filename is written in its full form, "\\.\COM22".
set /p x="hello" <nul >\\.\COM22
It's not missing functionality, it's broken functionality. This did work in the past.
Arduino IDE 2.x is a complete rewrite in a different programming language (TypeScript), which does not use any of the code from the Arduino IDE 1.x Java codebase. So even though you are correct that this functionality was present in Arduino IDE 1.x, it was not a matter of a regression in the codebase, but rather that the functionality was never implemented when the new IDE was written from scratch.
Formatting...
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.