Arduino IDE 2.0.0-rc5
I'm trying to space some data for ease of quick viewing. I've tried multiple spaces and tabs (\t) in the print "strings". Regardless the serial monitor only adds a single space.
Is there a way to accomplish this that I'm missing?
Thanks
CODE:
// Read MAX31855
rawData = myMAX31855.readRawData();
Serial.print(F("CJ:"));
Serial.print("\t");
Serial.print(myMAX31855.getColdJunctionTemperature(rawData));
Serial.print(F(" TC: "));
Serial.print(myMAX31855.getTemperature(rawData));
// Read DS18B20
sensors.requestTemperatures(); // Send the command to get temperatures
float tempC = sensors.getTempCByIndex(0);
// Check if reading was successful
if(tempC != DEVICE_DISCONNECTED_C){
Serial.print(F(" 1_Wire: "));
Serial.print(tempC);
Serial.print(" Δ ");
Serial.println(myMAX31855.getTemperature(rawData)-tempC);
}
else{
Serial.println("One wire error...");
}
delay(5000);
}
RESULTS:
J-M-L
March 27, 2022, 4:51pm
2
I find that the Serial monitor and the whole serial line handling is pretty poor in IDE 2 (wit hfrequent issues with uploading, annoying disappearance of the monitor when you compile, indeed could not get tabs to work etc...).
Until this is fixed I stay with 1.8.x
J-M-L
March 27, 2022, 5:05pm
3
the bug is already reported by the way
opened 05:08PM - 10 Dec 21 UTC
closed 07:38AM - 07 Apr 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
criticality: high
In previous versions (up to Arduino 1.8x), sending a /t tab character to the ser… ial monitor resulted in an aligned output (8 character tab spacing)
Exemple
```
int value1=11;
int value2=22;
int value3=33;
Serial.print("\tParameter 1\tParameter 2\tParameter 3\n");
Serial.print("\t");
Serial.print(value1);
Serial.print("\t\t");
Serial.print(value2);
Serial.print("\t\t");
Serial.println(value3);
```
in previous versions, the output would look like this
```
Parameter 1 Parameter 2 Parameter 3
11 22 33
```
In Arduino 2, it looks like this :
```
Parameter 1 Parameter 2 Parameter 3
11 22 33
```
The \t character is replaced by a space (except as the first character of a line where it produces no output).
This makes tables and aligned data difficult to read as proper formatting is lost.
I tested this on Linux Mint 20.2
opened 09:05PM - 08 Oct 21 UTC
closed 04:05PM - 06 Apr 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
**Describe the bug**
Today I copied the nightly build files (arduino-ide_nightl… y-20211008_Windows_64bit) and launched the Arduino IDE to continue work on my current project. I'm outputting a lot of formatted data via the Serial Port to the Serial Monitor (115200 baud) and have been using this IDE (2.0 Beta) for a number of weeks. The Serial Monitor has been working fine until last nights build. Now all the leading spaces have disappeared. So for example:
This output:
```text
Events:
List 'E'
Add 'EA mm/dd/yyyy rr Annual|Once Description..'
Edit 'EE nn [mm/dd/yyyy] | [rr] | [Annual|Once] | [Description..]'
Del 'ED nn'
Time/Date:
Get 'T'
Set 'T [mm/dd/yyyy][hh:mm[:ss][am/pm]]'
```
Now looks like this:
```text
Events:
List 'E'
Add 'EA mm/dd/yyyy rr Annual|Once Description..'
Edit 'EE nn [mm/dd/yyyy] | [rr] | [Annual|Once] | [Description..]'
Del 'ED nn'
Time/Date:
Get 'T'
Set 'T [mm/dd/yyyy][hh:mm[:ss][am/pm]]'
```
**To Reproduce**
Steps to reproduce the behavior:
1. `Serial.print(" xyz");`
2. Output looks like this "`xyz`"
**Expected behavior**
The serial output should now swallow any characters that are output.
Output should look like this "` xyz`"
**Desktop (please complete the following information):**
- OS:
Edition Windows 10 Pro
Version 21H1
Installed on 1/16/2021
OS build 19043.1237
Serial number 011754392857
Experience Windows Feature Experience Pack 120.2212.3530.0
- Version: arduino-ide_nightly-20211008_Windows_64bit
and overall
arduino:main
← arduino:grpc-performance
opened 10:57AM - 05 Oct 21 UTC
## Why
Serial monitor is affected by performance issues: basically it's not abl… e to keep up with the grpc messages arriving from the CLI when a decent amount of message (>100/sec) is being sent from the board.
There are a number of reasons causing this undesirable effect:
- the communication between Frontend and Backend is very chatty: the FE basically pulls a message at a time from the BE and gets notified when a new message arrives (see [comment](https://github.com/arduino/arduino-ide/issues/519#issuecomment-934164852))
- The frontend re-renders the whole list of messages every time a new one is pulled
- JRPC is used to marshal/unmarshal the data, causing additional overhead to the messages
- all messages are aggregated (and then printed), without any limit to the maximum number
## How
A new architecture for the communication has been designed:
- the backend collects the messages from the CLI and aggregates them in array.
- every 32 milliseconds the BE sends a chunk of message to the FE, containing all messages arrived in the 32msc timeframe. The reason behind the "32" milliseconds is the refresh rate of the electron application (32msec ~= 30fps). 16ms would guarantee a 60fps, but at the cost of more CPU and reduced responsiveness in the IDE2 GUI
- the communication between FE and BE is now a "raw" WebSocket connection, without the overhead of JRPC.
- as the frontend receives the chunk of messages, it adds them to its internal state, assigning them a timestamp and removing the old ones when the buffer size is reached
- the frontend renders only the messages that are actually in the monitor window: this allows to dramatically reduce the CPU usage as only a few messages are printed, rather than millions
## How to test
- upload a sketch with `Serial.print` or `Serial.println` and use no `delay` in order to have a high throughput of data flowing from the board
- open the serial monitor in the IDE2
## Related issues
fixes #391, fixes #79, fixes #519
1 Like
Good news everyone! This bug has now been fixed:
arduino:main
← arduino:monitor-tabs
opened 09:30AM - 05 Apr 22 UTC
### Motivation
When printing output to the serial monitor, some characters are … not being rendered as expected. For example, tabs are rendered like normal whitespaces (#675). This is caused by how HTML treats these kinds of characters.
### Change description
Wrap each serial monitor message inside a `<pre>` element.
fixes #675
### Reviewer checklist
* [ ] PR addresses a single concern.
* [ ] The PR has no duplicates (please search among the [Pull Requests](https://github.com/arduino/arduino-ide/pulls) before creating one)
* [ ] PR title and description are properly filled.
* [ ] Docs have been added / updated (for bug fixes / features)
It is now available for testing via the nightly builds. The download links are listed here:
https://github.com/arduino/arduino-ide#nightly-builds
1 Like
system
Closed
October 4, 2022, 6:11am
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.