Go Down

Topic: hiletgo esp8266 does not serial print in setup() but does in loop() (Read 627 times) previous topic - next topic

chjno

The following code does not print anything to the serial monitor but if I move the println to loop then it will print. I get the same result when running the esp8266 example sketches.

Any ideas?

Code: [Select]

#include "ESP8266WiFi.h"

void setup() {
  Serial.begin(115200);
  Serial.println(WiFi.macAddress());
}

void loop(){
 
}

rw950431

Have you tried using delay() to wait a little while before printing in setup()?  There is a lot of background stuff that has to happen before the WiFi is available so a lot of the sketches have a delay at the start.

Go Up