arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.29k stars 388 forks source link

Serial plotter does not plot #1597

Closed slavicd closed 1 year ago

slavicd commented 1 year ago

Describe the problem

Latest IDE (2.0.2) serial plotter is empty. No value gets plotted and

To reproduce

Install a fresh nightly build and try to plot some values:

Serial.print("P: ");
Serial.println(cfPitch);

Expected behavior

Plotter shows a plot of values.

Arduino IDE version

2.0.2

Operating system

Linux

Operating system version

Fedora 36

Additional context

Wayland 42.4

Issue checklist

nmzaheer commented 1 year ago

Can you share the entire code to reproduce this ? Also the newest release is 2.0.1. Are you referring to a newer build than that?

slavicd commented 1 year ago

The newest build is 2.0.2: https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-latest_Linux_64bit.AppImage As instructed by the bug reporting page, I downloaded a "nightly" instead of latest release. But the issue was present in 2.0.1 too, hence the reason for my nightly download.

Here is an MVE:

void mySetup() 
{
    pinMode(A1, INPUT);
    Serial.begin(115200);
    delay(100);
}

int main(void) 
{
    init();
    mySetup();

    while(1) {
        Serial.print("A1: ");
        Serial.println(analogRead(A1));
        delay(300);
    }

    return 0;
}
slavicd commented 1 year ago

Apparently it's (the plotter) thrown off by the "A1:" label. I can not reproduce without the label. This used to work just fine, though, in 2.0. Is there a new way of printing labels, perhaps?

nmzaheer commented 1 year ago

I've had a look at your code. You will have to remove the space after the label i.e change it to Serial.print("A1:");.

Please have a look at the Serial Protocol. The Label and Value message format does not have a space after the colon :.

slavicd commented 1 year ago

This is one of those cases where the protocol was "reverse engineered" and it so happens it used to work with a space before 2.0.1 . Thanks for the doc.