Can't serial print in setup() using HiLetgo ESP8266 with ESP8266WiFi.h library and Arduino IDE

397 views Asked by At

When I Serial.print() anything within the setup function using the Arduino library and IDE, I don't get anything. But when I move the Serial.print() lines to the loop function they appear normally. The code in setup() seems to be running. I just can't print anything to serial.

2

There are 2 answers

0
ThomasDr On

Add a delay of 1000ms before Serial.begin(115200).

0
cagdas On

Put these lines at the top of the setup :

  Serial.begin(9600);
  Serial.setDebugOutput(true);