I've just received several LoLin NodeMCUs from a 'cheap Chinese ebay vendor'. They're working well except for the fact that I'm getting garbage in the Arduino IDE Serial monitor.
I am able to:
- Load and run sketches
- Use the NodeMCU as a webserver and connect to it from a computer/smartphone/etc
- Everything you else you would expect an ESP8266 to do EXCEPT
I am not able to get readable data to display in the Serial Monitor.
Some Details: -My computer is running Linux Mint so I understand that drivers shouldn't be a problem
-The NodeMCU board has instructions printed on it to 1) Install CH340G driver 2) Use 9600 baud rate 3) Connect to WiFi
-I have not tried issuing an AT command to slow the default baud rate down to 9600 (as suggested in answer to another question on this forum). Since the NodeMCU standard rate is 115200 and it's only talking to my computer and not another Arduino, I didn't think that would be required. {Could that be the answer to my problem?}
-I've tried all the standard baud rates between 9600 and 115200. None produced readable outputs.
-I've connected stabilized external 5 and 3.3 V power sources to the board and added some caps for extra smoothing.
I'm running the simplest sketch I could think of to send data back the Arduino Serial Monitor:
int LEDState = LOW;
int pinNum = D7; //LED on D7 will flash while loop is running
void setup()
{
Serial.begin(15200);
pinMode(pinNum, OUTPUT);
}
void loop()
{
digitalWrite(pinNum, HIGH);
Serial.println("T"); // send the Letter T to the serial output
for (int c = 0; c < 10; c++)
{
Serial.println(c); // send the count 0 to 9 to the serial output
delay (200);
LEDState = blinkLED(pinNum, LEDState); // blink the LED to demonstrate that the loop is running
}
}
int blinkLED(int pinNum, int State)
{
if (State == LOW)
{
digitalWrite(pinNum, HIGH);
State = HIGH;
}
else
{
digitalWrite(pinNum, LOW);
State = LOW;
}
return State;
}
I've tried all the various line endings (CR/LF, CR, LF, nothing at all). No success with any of them.
Serial.begin(115200)
.