Serial Monitor does not Autoscroll to last (latest) line

Hi,

I'm using Arduino IDE
Version: 2.0.0
Date: 2022-09-14T07:08:28.861Z
CLI Version: 0.27.1 [a900cfb2]

I've found, with autoscroll on, the latest line is not scrolled to. It can be manually scrolled to, but then, why have autoscroll.

More details can be given if required.

Thanks
Thanks

Hi @dwc. I'm happy to tell you that this bug has already been fixed:

The fix was made after the time of the 2.0.0 release, so it is currently only available when using the nightly build. If you would like to give it a try, the download links are listed here:

https://www.arduino.cc/en/software/#nightly-builds

Otherwise you can wait for the 2.0.1 release.

Woooo, thanks.

1 Like

Somewhat amusingly, when starting the nightly build I am informed
image

This bug is being tracked here:

I will submit a fix for it later today.

It is not a serious problem of course, but I found it amusing

As someone always uses the tester builds, and who frequently clears the database where the IDE stores whether you have clicked that "SKIP VERSION", there is more annoyance than amusement for me at this point. But at least the cause of the problem was clear and the solution simple.

Bug is still present in 2.0.3. Just cost me 30 minutes fixing a phantom bug in my program.

1 Like

@DavidSG we are discussing that in the other thread you bumped:

I'm also running 2.03 on Windows 10,
Version: 2.0.3
Date: 2022-12-05T09:30:25.331Z
CLI Version: 0.29.0 [76251df9]

Copyright © 2023 Arduino SA

I've been struggling with it and I can't get the Autoscroll to work either.

Working with an M5Stack Core2.

Sir Michael

Hi @SirMichael. Are you talking about the problem of autoscroll not revealing the bottom line of Serial Monitor?

Yes. I’m developing a project using the MtStack, Core2 (slow going for me…). I’m obviously using the serial monitor for debugging and Serial.print() lines to select the test mode (about 14 modes…) and I have to constantly scroll the lines manually. The double down arrow button at the upper right of the serial monitor screen do not work.

I’ll see if I can extract just enough code to demonstrate the error later this morning. I’ve seen where this bug has been reported (and fixed?) before.

Sir Michael

It is pretty easy to reproduce... For example:

void setup() {
  while (!Serial) ; 
  Serial.begin(115200);
  pinMode(13, OUTPUT);
} 

int loop_count = 0;

void loop() {
  loop_count++;
  digitalWrite(13, (loop_count & 1)? HIGH : LOW);
  Serial.println("----------------------");
  Serial.print("Loop count: ");
  Serial.println(loop_count, DEC);
  delay(5000);
}

And as mentioned, I believe there is already an open github issue on the regression since the earlier fix.

Note: I ran this code on todays daily build. And each time the LED changes state, you need to scroll down manually if you wish to see the last update...

Kurt, I was able to get the AutoScroll to work with the sketch that you have above.

I was able to create a sketch that demonstrates the problem that I am seeing on an Arduino UNO, as well as the M5Stack Core2.

The AutoScroll won't keep up with the call to the subroutine.

//#include <M5Core2.h>
//byte Mode;
// 0 is used to know we just went through Setup(), loop() resets to "ModeOff" on startup.
const byte ModeOff = 1;
const byte ModePowerTurnedOn = 2;    //Power was just turned on, need to initialize.
const byte ModeSwrError = 3;         //Bypass mode until corrected, Power Cycle to Reset.
const byte ModePrepareOff = 4;       //Get ready to turn the system off (To Cool or Not to Cool)
const byte ModeCoolDown = 5;         //Allow the Amp to stay ON and cool the Heat Sink Down.
const byte ModeSwrErrorReset = 6;    //User pressed button to reset Power from ModeSwrError.
const byte ModeError = 7;            //Error Investigation Mode, Comms Fault, Volts Hi/Lo, etc.
const byte ModeReceive = 8;          //Amp is ready to go, but not currently transmitting.
const byte ModeTransmit = 9;         //Transmit Detected, Update FWD/REF SWR as well as voltage.
const byte ModeOverTemp = 10;        //OverTemp is active, need to wait for Amp to Cool Down. Dictated by Amp Control board.
const byte ModeSetupBandPower = 11;  //We are in Setup Mode, Adjust Per-Band Power setting (to Eeprom)
const byte ModeSetupTimeout = 12;    //We are in Setup Mode, adjust the Power Off Timeout.
const byte ModeSetupBypOper = 13;    //Select if on Power Up if we start in Bypass or Amplify mode.
const byte ModeSetupAi2Mode = 14;    //Allow turnig AI2 Mode On and Off (Off is Query mode every 2 seconds)


void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  //M5.begin();  //Init M5Core.
}

void loop() {
  static byte Mode;

  if (Mode == 0) { Mode = 1; }

  Mode = TempChangeMode();
  delay(1000);
}


byte TempChangeMode() {
  byte Mode;
  Serial.println(F("  ModeOff = 1"));
  Serial.println(F("  ModePowerTurnedOn = 2"));    //Power was just turned on, need to initialize.
  Serial.println(F("  ModeSwrError = 3"));         //Bypass mode until corrected, Power Cycle to Reset.
  Serial.println(F("  ModePrepareOff = 4"));       //Get ready to turn the system off (To Cool or Not to Cool)
  Serial.println(F("  ModeCoolDown = 5"));         //Allow the Amp to stay ON and cool the Heat Sink Down.
  Serial.println(F("  ModeSwrErrorReset = 6"));    //User pressed button to reset Power from ModeSwrError.
  Serial.println(F("  ModeError = 7"));            //Error Investigation Mode, Comms Fault, Volts Hi/Lo, etc.
  Serial.println(F("  ModeReceive = 8"));          //Amp is ready to go, but not currently transmitting.
  Serial.println(F("  ModeTransmit = 9"));         //Transmit Detected, Update FWD/REF SWR as well as voltage.
  Serial.println(F("  ModeOverTemp = 10"));        //OverTemp is active, need to wait for Amp to Cool Down. Dictated by Amp Control board.
  Serial.println(F("  ModeSetupBandPower = 11"));  //We are in Setup Mode, Adjust Per-Band Power setting (to Eeprom)
  Serial.println(F("  ModeSetupTimeout = 12"));    //We are in Setup Mode, adjust the Power Off Timeout.
  Serial.println(F("  ModeSetupBypOper = 13"));    //Select if on Power Up if we start in Bypass or Amplify mode.
  Serial.println(F("  ModeSetupAi2Mode = 14"));    //Allow turnig AI2 Mode On and Off (Off is Query mode every 2 seconds)
  Serial.println("    Enter Mode Number:");        //Prompt User for Input
  do {
    while (Serial.available() == 0) {
      // Wait for User to Input Data
    }
    Mode = Serial.parseInt();  //Read the data the user has input
  } while (Mode == 0);
  return Mode;
}

Hope this helps... (I was a software tester in a past life!)

Sir Michael

Yes, mine autoscrolls, but it usually misses the last 2 lines.

It is almost like when it gets new inputs to output, it Autoscrolls down to the extent of what was previously printed, and then prints out the new stuff below...

This same issue still exists in 2.0.4
The last line is not displayed until a new line is printed. The new line will not display until another (hidden) line is printed. repeat.

1 Like

There is a fix that went into the daily builds since 2.0.4 was released.

You might give that a try

Nightly builds :wink:

same issue in 2.1.0

Hi @michanisani. Please provide a complete and detailed set of instructions we can follow to reproduce the issue. The scrolling-related bugs in Serial Monitor I was aware of have been fixed in 2.1.0.