ESP-01 Serial.println() or Serial.print() not working

I went crazy, mad trying to understand why the module is not printing anything to the Serial Monitor or receiving any AT commands.

I went through lots of articles on the internet and was on the verge of throwing the module away. Just that my mind was not willing to believe that it is dead – because I was able to burn OS / Firmware to the module every time I tried and the status showed success. And my suspicion was confirmed accidentally – I put some Serial.print code in loop instead of setup and it did throw output to serial monitor. It confirmed that something is wrong with the settings of Arduino IDE.

After lots of tweaking and trials I found that – the “Built In Led” settings of Arduino that mattered.  The built in LED is on the TX line of the module, hence just after printing some output when I toggled the LED, the print function didn’t get enough time to write to the monitor. To solve the matter a delay can be used also.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("");
  Serial.println("Hello");
  delay(1000);
  pinMode(1, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(1, LOW); // turn the LED on (HIGH is the voltage     level)
  delay(500); // wait for a second
  digitalWrite(1, HIGH); // turn the LED off by making the voltage LOW
  delay(300); 
  digitalWrite(1, LOW); 
  delay(500); // wait for a second
  digitalWrite(1, HIGH); 
  delay(2000); 
}

In my module the LED is on PIN 1.

Leave a Reply