I have a sketch that responds to serial input on an Arduino Due. When I connect to the programming port using RC5 it programs fine but there are issues when using the serial monitor. Output from the sketch appears on the serial monitor with the addition of an occasional unexpected character but the sketch reacts as if it is periodically receiving bytes of 0 and I can't send any data to the sketch. When I use an external serial program, such as Putty, to communicate with the board over the same USB connection, everything works fine.
Hi @robopixel . Thanks for taking the time to give the Arduino IDE 2.0.0 release candidate a try and for sharing your results!
Some similar problems are being tracked by the Arduino IDE developers, which I will list below. Please take a look at the reports and let me know if you determine that the problem you are experiencing is different. In that case, we will want to do some further investigation and produce a formal report.
It might be this one:
opened 02:10PM - 02 Nov 21 UTC
closed 08:01AM - 13 Dec 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
### Describe the problem
🐛 When Serial Monitor is used to display characters … past the ASCII range printed by a non-native USB board, corruption occurs at various non-fixed positions in the output.
### To reproduce
1. Upload a sketch that prints characters past the ASCII range to serial:
```cpp
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("ASCII: !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
Serial.println("> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ");
delay(200);
}
```
1. Open Serial Monitor.
🐛 Some of the characters are replaced by `�`:
```text
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡��£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»��½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ��ÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´��¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌ��ÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬��¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅ��ÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦��¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿��ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×��ÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸��º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐ��ÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²��´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊ��ÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª��¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃ��ÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤��¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½��¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕ��רÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶��¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎ��ÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯��±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ��ÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨��ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁ��ÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙ��Û
```
### Expected behavior
All characters to be printed correctly by Serial Monitor all the time:
```
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~
> ASCII: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛ
```
### Arduino IDE version
#### Original report
2.0.0-beta.12-nightly.20211028
#### Last verified with
d6a4b0f (with [**serial-monitor** 0.11.0](https://github.com/arduino/serial-monitor/releases/tag/v0.11.0))
### Operating system
Windows
### Operating system version
10
### Additional context
I originally suspected the corruption might be caused by https://github.com/arduino/arduino-ide/issues/375, but this bug persists even though that one has been resolved.
---
The delay duration has an influence on the position of the corruption and the manifestation is different from one board to another (less corruption on Leonardo and MKR, more on Nano Every).
---
The issue does not occur when using the Arduino IDE 1.8.19 Serial Monitor, even when the board is running the binary that produced the corrupted output in Arduino IDE 2.x (i.e., it's not related to the sketch having been compiled in Arduino IDE 2.x).
---
Originally reported at https://forum.arduino.cc/t/serial-monitor-difficulties-with-german-umlauts/870541
---
Additional reports:
- https://github.com/arduino/arduino-ide/issues/1405
- https://forum.arduino.cc/t/serial-monitor-difficulties-with-german-umlauts/870541/7
- https://forum.arduino.cc/t/serial-read-and-serial-available-are-working-not-as-expected-in-the-code/925823
- https://forum.arduino.cc/t/using-v-2-0-serial-monitor-print/1034093
- https://forum.arduino.cc/t/question-marks-in-serial-monitor/1023531
- https://forum.arduino.cc/t/serial-monitor-detect-interferes-with-sketch-on-promicro/1017659
- https://forum.arduino.cc/t/degree-symbol-on-serial-monitor/1015370
- https://forum.arduino.cc/t/serial-monitor-produces-gibberish/950416/1
- https://forum.arduino.cc/t/serial-monitor-produces-gibberish/950416/15
- https://forum.arduino.cc/t/serial-monitor-issues-with-arduino-due/975247
- https://forum.arduino.cc/t/test-ide-2-0-rc2-the-serial-port-is-garbled/935697
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
It sounds like this bug:
opened 04:26AM - 16 May 21 UTC
closed 10:13AM - 01 Dec 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
🐛 Spurious data is sent by the Serial Monitor over the co… nnected serial port.
## To Reproduce
### Equipment
- One of the following Arduino boards:
- Arduino Uno
- Arduino Mega
- Arduino Due
### Steps
1. Paste the following simple serial echo sketch into the Arduino IDE:
```cpp
void setup() {
Serial.begin(115200);
}
void loop() {
if(Serial.available()){
Serial.println(Serial.read());
}
}
```
1. Upload to the Arduino board.
1. Open Serial Monitor
1. Set the baud rate menu to 115200.
🐛 The Serial Monitor's output field shows unexpected data is being received by the Arduino board and echoed back by the sketch. Something like this:
```text
240
240
240
240
240
240
```
... and so on
## Expected behavior
Data is only sent over the serial port by Serial Monitor when the user sends it via the input field.
## Desktop
- OS: Windows 10
- Version: Version: 2.0.0-beta.6-nightly.20210515
Date: 2021-05-15T03:10:15.375Z
CLI Version: 0.18.2 alpha [7b5a22a4]
## Additional context
I have only been able to reproduce this on my Arduino Mega, Arduino Uno, and Arduino Due (via Programming Port only). Based on the commonality of their ATmega16U2 USB chip, I expected to also be able to reproduce it on my Arduino Uno Mini LE, but I was not able to.
On my Leonardo and Micro boards, the RX LED flashes at 1 Hz while the Serial Monitor is connected, indicating unexpected data is being received, but I don't get any output from the echo sketch.
---
I notice that the ~1 Hz frequency of the spurious data appears to match the frequency of the notification displayed repeatedly after the board is disconnected while Serial Monitor is open (https://github.com/arduino/arduino-ide/issues/314):
> Reconnecting Arduino Mega or Mega 2560 to COM18 in 1 seconds...
This makes me wonder if already open ports are constantly being reopened at 1 Hz the whole time Serial Monitor is running. Further evidence supporting this is that I get the RX blink on the Leonardo whenever I do a manual [`StreamingOpen` gRPC request](https://arduino.github.io/arduino-cli/latest/rpc/monitor/#cc.arduino.cli.monitor.v1.StreamingOpenRequest) to the port.
---
It appears the data is sent at 115200 baud.
---
As reported at at https://github.com/arduino/arduino-ide/issues/1297, changing the selection in the line ending menu triggers the immediate sending of additional spurious data in addition to the regular periodic data reported above.
I notice the same happens when you toggle the "**Toggle Autoscroll**" or "**Toggle Timestamp**" icons.
None of these should result in any data being sent to the board.
---
Originally reported at: https://forum.arduino.cc/t/serial-monitor-sends-random-f0/850819
There are a couple of possibilities. For one, the keyboard control for sending data has been changed from Enter to Ctrl +Enter :
opened 02:29PM - 23 Oct 21 UTC
closed 03:18PM - 14 Sep 22 UTC
priority: high
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
phase: implementation
criticality: medium
## Describe the bug
🐛 The keyboard control for sending data from Serial Monit… or was changed from <kbd>Enter</kbd> in the classic Arduino IDE to the unintuitive and less convenient <kbd>Ctrl</kbd>+<kbd>Enter</kbd> in Arduino IDE 2.x
The first time I tried to send data via Serial Monitor, I jumped straight to typing into the input field without bothering to look at the gray text, then spent some time repeatedly pressing "Enter" without any result and hunting around for that "Send" button.
## To Reproduce
1. Connect any Arduino board that presents a serial port to your computer.
1. Select **Tools > Serial Monito** from the Arduino IDE menus.
1. Type some text in the Serial Monitor input field.
1. Press <kbd>Enter</kbd>.
🐛 Nothing happens.
## Expected behavior
Pressing the <kbd>Enter</kbd> key while the Serial Monitor input field is selected causes the data to be sent if any is present.
## Screenshots
In the Java IDE's Serial Monitor, sending data is done by typing into the input field and then either pressing "Enter" or clicking the "Send" button:

In Arduino IDE 2.x, there is a message that explains the unintuitive <kbd>Ctrl</kbd>+<kbd>Enter</kbd> system to the user:

but that message disappears as soon as you start typing (as it must). The user will expect the field to work in an intuitive manner and not bother to read the text, then once the find it is not working as expected, the text won't be there to guide them:

## Desktop
- OS: Windows 10
- Version: 2.0.0-beta.12-nightly.20211021
Date: 2021-10-21T03:03:16.691Z
CLI Version: 0.19.1 alpha [718bbbf2]
## Additional context
The loss of the <kbd>Send</kbd> button (https://github.com/arduino/arduino-ide/issues/348) worsens the poor user experience of sending data via Serial Monitor via Arduino IDE 2.x.
Reported at:
- https://github.com/arduino/arduino-ide/issues/348 (incidentally)
- https://forum.arduino.cc/t/serial-monitor/698844/4
- https://forum.arduino.cc/t/several-bugs-issues/899081
- https://forum.arduino.cc/t/ctrl-enter-step-backwards/1013856
- https://forum.arduino.cc/t/arduino-ide-2-0-0-rc9-input-in-serial-monitor-is-not-working/1015720/4
There is also a bug that can cause this under some conditions:
opened 03:06AM - 16 Jan 22 UTC
closed 01:45PM - 08 Jun 22 UTC
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
The Serial Monitor and Serial Plotter have an input field… the user can use to send data over the selected port.
:bug: In all except the first Arduino IDE window of the session with a given port selected:
- Data sent via the Serial Monitor's "**Message**" field is not received by the Arduino board.
- The Serial Plotter's "**Type Message**" field is disabled due to the plotter being in a "disconnected" state.
## To Reproduce
### Preparation
Upload a sketch to your Arduino board that echos serial input as well as autonomously sending serial output:
```cpp
unsigned long previousMillis;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
while (Serial.available() > 0) {
Serial.write(Serial.read());
}
Serial.println();
} else if (millis() - previousMillis >= 1000) {
previousMillis = millis();
Serial.println(random(100));
}
}
```
The bug will occur regardless of which sketch is on the board. This sketch is only intended to make the behavior easier to observe.
### Observe baseline working state
This procedure is not required to reproduce the bug. It is only intended to prove that the issue does not occur in the first window of the session.
1. Open the "**Serial Monitor**" view (**Tools > Serial Monitor**).
1. Select "**9600 baud**" from the "**Serial Monitor**" view's baud rate menu.
:slightly_smiling_face: Notice that random numbers are periodically printed to the Serial Monitor view's output field, as expected.
1. Type `4242` into the the "**Serial Monitor**" view's "**Message**" field.
1. Press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> to send the text over the serial port.
:slightly_smiling_face: Notice that the sent text `4242` is printed to the Serial Monitor view's output field, as expected.

1. Open the "**Serial Plotter**" window (**Tools > Serial Plotter**).
:slightly_smiling_face: Notice that random numbers are periodically plotted in the Serial Plotter, as expected.
1. Type `4242` into the the "**Serial Plotter**" window's "**Type Message**" field.
1. Click the <kbd>Send</kbd> button to send the text over the serial port.
:slightly_smiling_face: Notice that the sent value `4242` is plotted in the Serial Plotter, as expected.

1. Close the "**Serial Monitor**" view (**X** icon).
This is not mandatory to reproduce the bug. It is done so that Serial Monitor will not be open in the first window of the next session, which might give the impression that is a required condition to reproduce the bug.
1. Select **File > Quit** from the Arduino IDE menus.
This is not mandatory to reproduce the bug. It is done so that it is clear that none of the operations performed during this procedure are required conditions to reproduce the bug.
### Observe bug
1. Start the Arduino IDE.
1. If not already selected, select your board and port from the board/port selector dropdown.
1. Select **File > New** from the Arduino IDE menus.
This loads the second window of the current IDE session.
1. Open the "**Serial Monitor**" view (**Tools > Serial Monitor**).
1. Select "**9600 baud**" from the "**Serial Monitor**" view's baud rate menu.
:slightly_smiling_face: Notice that random numbers are periodically printed to the Serial Monitor view's output field, as expected.
:bug: Notice that there is an unexpected banner in Serial Monitor:
> Not connected. Select a board and a port to connect automatically.

1. Type `4242` into the the "**Serial Monitor**" view's "**Message**" field.
1. Press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> to send the text over the serial port.
:bug: Notice that the sent text `4242` is not printed to the Serial Monitor view's output field.
1. Open the "**Serial Plotter**" window (**Tools > Serial Plotter**).
:slightly_smiling_face: Notice that random numbers are periodically plotted in the Serial Plotter, as expected.
:bug: Notice that the Serial Plotter window title has the "**(disconnected)** suffix.
:bug: Notice that a "**Board disconnected**" notification is shown in the Serial Plotter window.
:bug: Notice that Serial Plotter's "**Type message**" field and some other UI elements are disabled.

## Expected behavior
Serial Monitor and Serial Plotter of subsequent IDE windows for a given port selection to allow sending data.
## Desktop
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot.35e5da5
Date: 2022-01-13T17:15:54.562Z
CLI Version: 0.20.2 [13783819]
## Additional context
I bisected the related issue https://github.com/arduino/arduino-ide/issues/726 to https://github.com/arduino/arduino-ide/commit/767b09d2f10cab78b07754039ebb749d55b45d8d (it does not occur at https://github.com/arduino/arduino-ide/commit/88397931c5b704516e881959f6e7ce106094d14d).
If you have a GitHub account, you can subscribe to any of those issues to get notifications of any new developments related to the subject.
system
Closed
September 26, 2022, 10:25pm
3
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.