Hi All.
Have been all through this thread:
I have a Nano Every with Arduino ide V2.0.0 -rc9
My code below:
everything commented out with Serial.print or Serial.write
I have tried and it does not work in the serial monitor.
Any help will be appreciated.
#include <Wire.h>
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include "RTClib.h"
RTC_DS3231 rtc;
char daysOfTheWeek[7][12] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
void setup() {
Serial.begin(115200);
Wire.begin();
#ifndef ESP8266
while (!Serial)
; // wait for serial port to connect. Needed for native USB
#endif
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
while (1) delay(10);
}
if (rtc.lostPower()) {
Serial.println("RTC lost power, let's set the time!");
// When time needs to be set on a new device, or after a power loss, the
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
// When time needs to be re-set on a previously configured device, the
// following line sets the RTC to the date & time this sketch was compiled
// rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
// rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
}
void loop() {
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" (");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
Serial.print("Temperature: ");
Serial.print(rtc.getTemperature());
//Serial.print("°");
//Serial.write("°");
//Serial.write(0xC2);
//Serial.write(0xB0);
//Serial.print("\xC2\xB0");
//Serial.print("\u00b0");
//Serial.print(byte(223));
//Serial.print((byte)223);
//Serial.print(F("\xB0""C"));
Serial.println("C");
Serial.println();
delay(1000);
}
Regards
Charles
Hi.
2022/7/23 (Saturday) 20:11:17
Temperature: 21.25�C
Is displayed...
It could be a V2.0 thing.
Is there a way to maybe report it as a bug?
I am obviously not the sharpest tool in the shed..
Look around over here --
Latest Software/Arduino IDE 2.0 beta topics - Arduino Forum
Maybe it's been noted.
If not, ask.
Thanks will check into it thank you.
Tried PuTTY or TeraTerm ?
Tried PuTTY or TeraTerm ?
No, am not familiar with either Still very much a noob in Arduino..... Well, any coding platform..
They are 'terminal emulators'.
SerialMonitor is limiting.
gcjr
July 23, 2022, 6:33pm
11
don't such symbols use UTF-8(?) coding, multiple bytes.
_Others od -x tmp
0000000 b0c2 000a
0000003
_Others cat tmp
°
This particular one is in the extended ASCII table.
Ascii character table - What is ascii - Complete tables including hex, octal, html, decimal conversions
Hi @Charles_Gibbs . The Arduino IDE developers are tracking this bug 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.
For a more simple demonstration:
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("Temperature: 42 °C");
delay(1000);
}
gives me this sort of output in Serial Monitor:
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 °C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 ��C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 °C
Temperature: 42 ��C
Yes, It seems this is a serial monitor thing;
I copied your code:
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("Temperature: 42 °C");
delay(1000);
}
My results are far worse I'm afraid:
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 °C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 °C
Temperature: 42 ��C
Temperature: 42 ��C
Temperature: 42 ��C
Have subbed, hope there's a fix soon.
thanks
Try this:
void setup()
{
Serial.begin(115200);
}
void loop()
{
static unsigned long timer = 0;
unsigned long interval = 1000;
if (millis() - timer >= interval)
{
timer = millis();
Serial.print("Temperature: 42");
Serial.write(0xC2); Serial.write(0xB0); // degree symbol
Serial.println("C");
}
}
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Temperature: 42°C
Hi @groundFungus
Sorry does not work. If you look at the OP you will see that I have already tried that, this seems to be an IDE specific fault on serial monitor.
IDE V2.0.0-rc9..
Regards
@runaway_pancake
I have loaded putty up.
Serial output works floorlessly So it must be a serial bug.
2022/7/24 (Sunday) 11:54:21
Temperature: 20.55°C
2022/7/24 (Sunday) 11:54:22
Temperature: 20.30°C
2022/7/24 (Sunday) 11:54:23
Temperature: 20.55°C
2022/7/24 (Sunday) 11:54:24
Temperature: 20.55°C
2022/7/24 (Sunday) 11:54:25
Temperature: 20.55°C
2022/7/24 (Sunday) 11:54:26
Temperature: 20.55°C
2022/7/24 (Sunday) 11:54:27
Temperature: 20.30°C
2022/7/24 (Sunday) 11:54:28
Temperature: 20.55°C
Hope there is a bug fix soon...
system
Closed
January 20, 2023, 9:56am
18
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.