ESP8266 not connecting to router

I’m trying to connect to wifi router using ESP8266 and Arduino UNO. I get this

[9] Connecting to wifi

It stays like that and does not connect


My code:

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>

// Set ESP8266 Serial object
//#define EspSerial Serial
// This can be a SoftwareSerial object (remember to also edit ESP8266.h):
#include "SoftwareSerial.h"
SoftwareSerial EspSerial(2, 3); // RX, TX

ESP8266 wifi(EspSerial);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "123";

void setup()
  Serial.begin(9600);     // Set console baud rate
  EspSerial.begin(9600);  // Set ESP8266 baud rate

  Blynk.begin(auth, wifi, "wifi", "12345678");

void loop()

This is not going to work because you need to attach it to the serial port and the UNO has only one. So you can use that one serial port for either the ESP as a shield or serial output or use software serial as stated in the comments of the sketch.

It may also be advisable to upgrade your Blynk library to 0.3.1. because it works better with software serial I believe.

1 Like