1

I have 3 NodeMCU 1.0 12E ESP8266 boards.

Issues

Two of them require me to unplug and replug in the boards every time I want to flash code, and nothing appears on the serial output with this simple blink modified sketch I've shown below on those same boards. I don't have any special pin configurations on either of these boards, I simply have the NodeMCU boards connected to the PC through MicroUSB. The other board has no issues with uploading and displaying serial output also with no special pin configurations.

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  Serial.begin(115200);
  pinMode(4, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("ON");
  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  Serial.println("OFF");
  digitalWrite(4, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Interestingly enough, the LED connected to the corresponding PIN behaves correctly, which would indicate flashing the code works fine, but serial output doesn't work on 2 of the boards.

What I've tried

  • Making sure the baud rate of the serial monitor is 115200.

  • Tried the sketch with different baud rates.

  • Made sure the correct board and ports are being recognized.

  • I have tried using certain pin configurations on some of my boards, (grounding GPIO pin 0, connecting Rx and Tx, etc), but like I said, I don't do this in general when uploading code. Maybe the ESP8266 requires some sort of initialization process that I haven't done?

I can't tell if my other two boards are defective or if I need to take extra steps for the two boards that are acting strange. Has anyone here experienced something like this?

Thanks

3
  • If you can upload code you should also be able to communicate via serial, it's the same interface. Do you see anything on the serial line? In general there is nothing more to do than calling Serial.begin() for initialization. – Sim Son Jun 28 '20 at 0:51
  • @SimSon I see a bunch of reverse question marks sometimes, and sometimes, I see absolutely nothing in the nonworking boards. As far as I can tell, in both the serial monitor and the Tools settings, the settings are exactly the same for both the working and nonworking boards. The LEDs still blink in the non-working boards. – SD'Anc Jun 28 '20 at 5:06
  • @SimSon Also in the working board, the serial output of a simple program that prints "Message Sent" always prints garbage like "⸮Message ⸮⸮!H⸮", "MessagLR⸮⸮4:, etc". Its usually not perfect and has some soft of problems. Are my boards just simply not working? – SD'Anc Jun 29 '20 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.