Hi, how to get rid of those question marks in my serial output?
I've a Arduino Nano and am using a baud rate of 19200.
Serial.println(" ");
Serial.println("┌──────────┬────────────────────┐");
Serial.println("│ Sensor │ Messwert [mm] │");
Serial.println("├──────────┼────────────────────┤");
Serial.print( "│ Sensor 3:│ ");
Serial.println(modbus_array[0]);
Serial.print( "│ Sensor 4:│ ");
Serial.println(modbus_array[1]);
Serial.print( "│ Sensor 5:│ ");
Serial.println(modbus_array[2]);
Serial.print( "│ Sensor 6:│ ");
Serial.println(modbus_array[3]);
Serial.print( "│ Sensor 7:│ ");
Serial.println(modbus_array[4]);
Serial.print( "│ Sensor 8:│ ");
Serial.println(modbus_array[5]);
Serial.print( "│ Sensor 9:│ ");
Serial.println(modbus_array[6]);
Serial.println("├──────────┼────────────────────┤");
Serial.print( "│ Fails │ ");
for(int sensor=0; sensor<7; sensor++){
Serial.print(measurement_failed[0]);Serial.print( ", ");
}
Serial.println("");
Serial.println("└──────────┴────────────────────┘");
Not sure, didn't happen to me on my Uno. I don't have the modbus_array in the version I made to test it though. Saved a bunch of dynamic memory using the F macro though (34 vs 9%).
void setup() {
Serial.begin(19200);
Serial.println(" ");
Serial.println(F("┌──────────┬────────────────────┐"));
Serial.println(F("│ Sensor │ Messwert [mm] │"));
Serial.println(F("├──────────┼────────────────────┤"));
Serial.print(F( "│ Sensor 3:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 4:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 5:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 6:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 7:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 8:│ "));
Serial.println(F(""));
Serial.print(F( "│ Sensor 9:│ "));
Serial.println(F(""));
Serial.println(F("├──────────┼────────────────────┤"));
Serial.print(F( "│ Fails │ "));
Serial.println(F(""));
Serial.println(F("└──────────┴────────────────────┘"));
}
void loop() {
}
1 Like
Do you need to use baud rate 19200
?
I'm not sure if that would affect anything, but maybe.
If you need a module to use baud 19200
, use Software Serial
or have multiple `Serial` instances with something like this (click the arrow)
void setup() {
Serial.begin(9600); // for printing to serial monitor
Serial2.begin(19200); // for other module using 19200 baud
}
void loop(){
// your code here:
// Now use Serial.println() and Serial2.println()
}
@anon44338819
1 Like
dlloyd
August 18, 2022, 6:31pm
5
Is this a Nano clone?
Is it setup for 8 or 16 MHz?
This could be a similar issue as here .
1 Like
Interesting thanks, this minimal example caused problems for me too.
@dlloyd
I played around with the baudrates in the monitor and the serial interface instance, with worse results.
@anon44338819 This is not so bad actually, these print out tables are primarily for debugging. The device will serve as a modbus slave, using the same baudrate. I hope those artefacts won't show up there.
1 Like
Hi @erespeel . Thanks for giving the Arduino IDE 2.0.0 release candidate a try.
This bug is being tracked by the Arduino IDE developers here:
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
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
1 Like
system
Closed
February 14, 2023, 8:38pm
8
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.