Skip to content

Serial Monitor sends spurious data #375

Closed
@per1234

Description

@per1234

Describe the bug

🐛 Spurious data is sent by the Serial Monitor over the connected 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:
    void setup() {
      Serial.begin(115200);
    }
    
    void loop() {
      if(Serial.available()){
        Serial.println(Serial.read());
      }
    }
  2. Upload to the Arduino board.
  3. Open Serial Monitor
  4. 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:

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 (#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 to the port.


It appears the data is sent at 115200 baud.


As reported at at #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

Activity

NazariiBoichuk

NazariiBoichuk commented on Nov 16, 2021

@NazariiBoichuk

I faced similar problem with Arduino Due on Arduino IDE 2.0.
The problem disappeared when I used usual Arudino IDE 1.8.16.
More about my issue here:
https://forum.arduino.cc/t/serial-read-and-serial-available-are-working-not-as-expected-in-the-code/925823

hemmikall

hemmikall commented on Dec 16, 2021

@hemmikall

Still seems to be an issue.

Using Arduino UNO on COM3, the serial monitor sends out two bytes of 0xF0 (hex value of each byte) every second.
As soon as I close the serial monitor, the transmission stops.

BlueBles

BlueBles commented on Mar 3, 2022

@BlueBles

Still a problem.
Baud rate 115200
Arduino Mega on IDE 2.0 each 1-2 seconds appear some weird random data on serial.
On old IDE, no problem, all text from serial is the only that I have sended.

PaulStoffregen

PaulStoffregen commented on Mar 3, 2022

@PaulStoffregen
Sponsor

Maybe switching to new API (#769) will help? Or at least should be done first, so testing and troubleshooting is done with new pluggable serial monitor?

sterretjeToo

sterretjeToo commented on Jul 30, 2022

@sterretjeToo

Some additional information that might help; with the given sketch

  1. SparkFun RedBoard (FTDI) and clone Nano (CH340) do not show activity on the RX led and no data is displayed in the serial monitor.
  2. The RX LED flashes on an Arduino Leonardo / Micro as well as on a SparkFun ProMicro; nothing is displayed in serial monitor. Specifically on the ProMicro this can be disturbing as the RX LED is used is often used as a heartbeat to detect if a sketch might be hanging or not.

35 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @cmaglie@PaulStoffregen@kittaakos@AlbyIanna@palazzol

    Issue actions

      Serial Monitor sends spurious data · Issue #375 · arduino/arduino-ide