Wifi Module not found using Arduino Uno & ESP8266

Hello Blynk Community,

I have been able to get the ESP8266 to work directly with Blynk within a very short time, which is amazing.

I am now trying to get the Arduino Uno to connect to Blynk using an ESP8266 module using the wiring shown below:

I used the Blynk Quickstart option to get the code as shown below:

#define BLYNK_TEMPLATE_ID           "TMPLm1jltcCZ"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "_B-lvlW8fsKzjxcXs0aRNwLHBpFyQaCS"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleWiFiShield101.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "***";
char pass[] = "***";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

I got two issues which are as follows:

  1. The current setup is not linking to Blynk. I know this because my Serial Monitor is saying “[463] WiFi module not found” and the Blynk website has not been able to establish a connection. Can anyone help please?

  2. When uploading the code to the Arduino Uno; I am getting a warning which says “Low memory available, stability problems may occur.”. I find that weird given that I hadn’t added any additional code yet. Am I doing something wrong during the upload perhaphs?

Please note that I have put *** for char ssid[] and char pass[].

Thank you all in advance for your time and support.

hey there,
try this example

Your ESP-01 is connected to the one hardware serial UART on the Uno (pins 0 & 1). You can’t use this port for anything else.

Is your ESP-01 actually configured to communicate with the Uno at this baud rate?

Note that if you choose to use a sketch which created a SoftwareSerial port to connect your ESP-01 to, instead of using the hardware UART (which then allows the hardware UART for debugging) then the SoftwareSerial library doesn’t work reliably at baud rates higher than 9600.

Whichever speed you tell the Uno to use when communicating with the ESP-01, the ESP-01 needs to be configured to communicate at the same baud rate. This is done via an AT command, not in the sketch.

Pete.

Hi John93,

Thank you for the quick reply. I tried the link and Arduino IDE produced a compiler error. It seems to think its for the Arduino Mega not Uno. Any advise?

Hi Pete,

Thank you for the quick reply. With reagrds UART; I have moved the cables to pin 1 & 2. Is that ok?

With regards to the baud rate; I have flashed the ESP to 9600. I have tried to use the AT Command but it does not work for me. Do you have instructions that I can follow please?

In the example you have to use software serial instead of hardware serial like this

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

No!

That statement makes no sense.

You probably need to re-install the AT firmware. This cannot be done via the Arduino IDE.

With regard to your error message, I’m guessing that you have a 3rd party Blynk WiFi Manager (WM) library installed. You should in-install this.

Pete.

On Blynk Legacy, Arduino/ESP01 combinations used a 3rd party library:
#include <ESP8266_Lib.h>
together with
#include <BlynkSimpleShieldEsp8266.h>

Can this be just used for the new Blynk as well?

According to this example

It’s still possible.

1 Like

Hi John93,

Thank you for spotting my error. I have used the software serial and things are looking better as shown below:

The latest code is as follows:

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLm1jltcCZ"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "zSQpZBaUy_veyQZhSXD9qw0yZKItJxlM"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "********************";
char pass[] = "*******************";

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 38400

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(115200);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

As Pete has advised me; I can’t use UART (pins 0 and 1) because they are utalised by the Serial Monitor of the Arduino IDE. So I used pins 2 & 3; for RX & TX respectively.

The only remaining issue I have pending is that the ESP is not responding. Any ideas on what I have done incorrectly please?

1 Like

1- Make sure the esp8266 is connected correctly, tx to rx and rx to tx.

2- try changing the baud rate to 9600.

3- make sure that you are providing enough power to the esp8266.

Hi RolandW,

Thank you for the info. I believe you are right. I have used the latest code from Blynk.Console as shown below:

/*************************************************************

  This is a simple demo of sending and receiving some data.
  Be sure to check out other examples!
 *************************************************************/

// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID           "TMPLm1jltcCZ"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "zSQpZBaUy_veyQZhSXD9qw0yZKItJxlM"


// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleWiFiShield101.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "****************";
char pass[] = "****************";

BlynkTimer timer;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

Unfortuntley I am still having issues with the Wifi as shown below:

The other thing I noticed is that I am low memory on my Arduino Uno and I haven’t even added one line of my own code yet. Any ideas how I can improve on this situation please?

Hi John93,

Thank you for the quick reply. I have addressed all three points as follows:

  1. I checked it and its ok. And just to be sure; I swapped them around and I still can’t get the arduino uno to work with blynk using ESP8266.

  2. I changed the baud rate to 9600.

  3. I used the power supply from my USB-UART TTL converter, which is capable to supply 1A @ 3.3V. I know this works because I am able to program the ESP8266 easily.

Any other ideas please?

Hi @PeteKnight ,

Thank you once again for the quick reply. I have flashed the ESP8266 and set the baud rate to 9600 using the software as shown below:

Any advise on how to carry out the AT command please?

BlynkSimpleShieldEsp8266.h is one of the Blynk libraries, but your error message shows that files from the Blynk_Esp8266AT_WM library are being used by the compiler, and this is a 3rd party library.

The sketch that you posted in post#12 is designed for different hardware (the ESP WiFi shiled 101, not the ESP-01), so will never work with your hardware.

That’s probably caused by the inclusion of these libraries:

Which are needed for the 101 shield and not the ESP-01. Once you start to use the correct sketch again then you’ll have a little more free memory, but the UNO is a very slow and memort-limited board, which is one of the reasons why 99% of the Blynk regulars use a NodeMCU or ESP32, which have the advantage of having built-in WiFi anyway.

Your previous sketch attempted to use a baud rate of 38400 with a SoftwareSerial port, which I’ve already explained won’t work…

I’m fairly certain that the baud rate in your NodeMCU Software Programmer is the baud rate that is used to upload the firmware to your board, not the baud rate that the firmware is expecting AT communications once it’s been uploaded.
I’m also doubtful; about the use of this tool anyway, as:

  1. You aren’t using a NodeMCU
  2. Very few ESP-01s have 4MB of memory
  3. It doesn’t show if you are uploading AT firmware to the ESP-01

Once the firmware has been uploaded, have you managed to get the ESO-01 to respond to an AT command issued via the serial monitor while issuing an AT command each time.
If this doesn’t work at any baud rate then you havent uploaded AT firmware, and it will never work with Blynk.
If it does work at one baud rate then that’s the baud rate used by your ESP-01 and if you wnat to communicate with it via a SoftwareSerial port then you need to change this (via the appropriate AT command) to 9600.

Or, you could just throw all of your prehistoric hardware in the bin and spend a couple of dollars on a NodeMCU or ESP32 instead.

Pete.

1 Like

Oharran, once you go into Web applications, Wifi, Blynk, etc. Arduino Uno, Nano, just don’t have enough memory. That’s why my prefered Arduino is the Mega Pro, as it has a small footprint as well, a ton of pins and good memory. Otherwise you would have to go with an ESP or other…

I would always suggest that if you are using an IoT application then you should use an IoT capable board.
The NodeMCU or Wemos D1 Mini is perfect if you one a small number of GPIOs and a single analog pins, or an ESP32 if you need more pins.

Pete.

@PeteKnight you are right. I made a number of mistakes which are as follows:

  • I hadn’t set the ESP to 9600 as I originally thought. Also the code was calling up the incorrect Baud. This is fixed now.

  • I used the incorrect wiring diagram as well as I wired it in correctly. I mixed up my Rx with my Tx.

  • Last but not least; you are right by going back to the correct code; the seize of the file shrunk significantly. @John93 thank you for pointing me in the right direction with respect to the code and spotting the errors.

Please find the code that worked for connecting the Arduino Uno to the ESP8266:

#define BLYNK_TEMPLATE_ID           "TMPLm1jltcCZ"
#define BLYNK_DEVICE_NAME           "Quickstart Device"
#define BLYNK_AUTH_TOKEN            "Bc9oGKDnWWoSaRTbyI8EHpZypG6XS2Z5"
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials. Set password to "" for open networks.
char ssid[] = "****************";
char pass[] = "****************";

#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

#define ESP8266_BAUD 9600     // Your ESP8266 baud rate:
ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(9600);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk.cloud", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

The wiring of the Arduino Uno to the ESP as follows:

007

Once again thank you all for being such an awesome community; helping a complete stranger out. :slight_smile:

2 Likes