In only one sketch I cannot make the serial monitor to show normal text. only squares are displayed.
Baud rates are set correctly, tried different baud rates, same NodeMCU used on same COM port, other sketches do show correctly, tried different text instead of just the dot, tried Serial.println() but it doesn't make new lines ...
Removed all complexity in the sketch, nothing changed (sketch is working) :
int PB0 = 16; // D0 = LED at USB connector (blink to show heartbeat)
int PBH = 1; // TX = LED on PCB for heartbeat
int PB8 = 2; // D4 = Push Button 8 = grey LED at antenna (only after boot)
// PB Pin states
int PB0state = 0;
int PB8state = 0;
// PB milliseconds
const long HB = 2500; // heartbeat duration for PB0
long ms0 = 0;
void setup() {
Serial.begin(19200);
delay(500);
pinMode(PB0, OUTPUT);
pinMode(PBH, OUTPUT);
pinMode(PB8, OUTPUT);
digitalWrite(PB0, 0);
digitalWrite(PB8, 1);
Serial.println(" ");
Serial.println("HTTP server started");
Serial.print("VMBGATE Local IP is : ");
}
void loop() {
if (millis() - ms0 >= HB) {
ms0 = millis();
Serial.println("."); // just print a dot every 2500ms (should do a linefeed, but doesn't and prints only squares)
PB0state = !PB0state; // toggle status
digitalWrite(PB0, PB0state); // heartbeat on PCB
digitalWrite(PBH, !PB0state); // heartbeat on connector (inverted to keep current low)
}
}