Serial.println("text") is printing gibberish/garbage, indicative of an incorrect baud rate. However, I know the baud rate has been set correctly in the sketch, and in the COM monitor (and putty).
The problems occurs on my Wemos D1 R2 v2.1.0. There are no problems on my Wemos Mini V2.2.0
Using PUTTY with the baud rate at 76800, the boot message is readable, so it's clear the serial port works (plus the sketch can be loaded). It therefore doesn't seem like the board is faulty.
However, a modified blink sketch prints gibberish with Serial.println.
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(76800);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("ON ");
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
Serial.println("OFF ");
delay(1000); // wait for a second
}
(PUTTY at 76800)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld
O
j▒▒▒▒▒▒O▒j▒▒▒▒▒
j▒ϔ*▒▒
*
▒▒▒▒
:▒▒▒A▒▒
*▒▒▒▒▒▒O
▒O▒j▒▒▒▒▒ j▒▒▒A
Changing the baud rate in Serial.begin, setting the Serial Monitor to the same speed (115200) doesn't work either.
The board and core loaded are:
Using board 'd1_mini' from platform in folder: C:\Users\...\...\esp8266\hardware\esp8266\2.4.1
Using core 'esp8266' from platform in folder: C:\Users\...\...\esp8266\hardware\esp8266\2.4.1
Is there some compile switch or library I have installed incorrectly? Is there an incompatible library that needs updating? I've compiled with the selected board of "WeMos D1 R2 and Mini" - see attached image
(tested on IDE 1.8.3 and 1.8.5)
For reference, the output from my Wemos Mini is as expected.
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld
ON
OFF
ON
OFF
ON
OFF
ON
OFF
ON
OFF
