Go Down

Topic: hiletgo esp8266 does not serial print in setup() but does in loop() (Read 72 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy