[SOLVED] Esp8266 as WiFi shield setup

Hi,
I already ran blynk with the esp8266 standalone, but now i want to use the esp as a wifi shield for the arduino. Great that you ade this possible! Can someone tell me how to wire the esp to the arduino for this? And what program should be uploaded to the esp? Thank you in advance

i use an arduino uno

The wiring and the setup is the same as for ITEADLIB_Arduino_WeeESP8266 library.
You should try using it before starting with Blynk.
Remember that we use a modified version (the link is in the sketch)ā€¦

OK - I havenā€™t already run blynk with esp8266 standalone - and I have been trying unsuccessfully for some time to use the esp8266 as a wifi shield on an arduino uno.

What caused me to write in this thread is that this evening I thought I would have another go and Iā€™ve found myself installing the ITEADLIB_Arduino_WeeESP8266 library and I see now that it is similar to / is the basis of the library/sketches provided by blynk for my particular application - esp8266 as wifi shield for arduino uno.

Iā€™ve also failed to use the ITEADLIB library.

I believe my issue revolves around my wish to have the esp8266 on softwareserial which the ITEADLIB library is supposed to support - but I canā€™t get example sketch to even compile while trying to use software serial.

I know that my hardware works as Iā€™ve used the exact same hardware to send readings from a temperature sensor to a ThingSpeak channel with the esp8266 on softwareserial - without relying on a library and just using a very simple sketch that I cobbled together myself (I am a complete noob to all this by the way - been working in IT with PCā€™s and servers for 20+ years but this is my first foray into the world of arduino).

Is there a current recommendation for libraries / sketches / methods I should be using today to link my android smartphone to blynk and use it to communicate with my arduino uno via an esp8266 on digital pins 10 and 11 using the SoftwareSerial.h library?

Iā€™m sorry if Iā€™m just being slow / dumb but I have tried everything I can think of and I really, really want to get this working.

Hereā€™s the code at the start of my sketch which I am having problems with:

// ###################################################################

#include ā€œESP8266.hā€

#define SSID ā€œā€
#define PASSWORD ā€œā€

// set up a new software serial object which will be used with ESP8266
#include <SoftwareSerial.h>
const byte rxPin = 10;
const byte txPin = 11;
SoftwareSerial mySerial (rxPin, txPin);

ESP8266 wifi(mySerial);

// ##############################################################

When I try to verify this code I get errors of the form:

Arduino: 1.6.5 (Windows 8.1), Board: ā€œArduino/Genuino Unoā€ā€¦

ā€¦error: no matching function for call to ā€˜ESP8266::ESP8266(SoftwareSerial&)ā€™

It seems that only hardware serial will do - which doesnā€™t suit my application :frowning:

I think if I can get this to work, finally getting blynk to work will be simple.

Can anyone please help?

1 Like

Blynk does not use this library directly anymore. We included 2 forks of this library (HW and SW serial) in the Blynk ZIP release package: Release v1.3.2 Ā· blynkkk/blynk-library Ā· GitHub

Thanks :yum:

I did of course try using those libraries early on - without success :cry:

So I changed directionā€¦

Got a second ESP8266 and have managed to successfully program it as a standalone unit using the Arduino IDE and some of the sample sketches that come with the library - success :smiley:

So then I thought I would try using this hardware configuration with Blynk and uploaded the ESP8266_Standalone sketch - another success :smiley: The ESP8266 attaches to my WIFI router, grabs an IP address and then successfully connects to the Blynk cloud and for the first time, when I open the Blynk app on my android smartphone it doesnā€™t complain at me that my device is not in network! :heart_eyes:

Now if only I could work out how to set a button on the app to turn on and off the ESP8266 on-board LED (the nice blue one) and an LED on the app to show the state of said LED I would be in heaven!

Can anyone help? Please?

1 Like

Progress :grinning:

Worked out that the blue LED on the ESP8266 is connected to GPIO1ā€¦ configured the button on the Blynk app on my android for that pin and am now able to use that button to toggle the blue LED on the ESP8266! :sunglasses:

The odd thing is though that when the button is illuminated, the LED is off and when the button is off, the LED is on - which seems counter-intuitive :confused:

Now I just need to work out how to get the physical LED activity to be reflected in the LED on the appā€¦

1 Like

after uploading the program to arduino. when i powered up esp & arduino then it show following output in serial monitor
[19] Blynk v0.3.1
[520] Connecting to saurabh
[1536] Failed to disable Echo

Hi There,
I had similar symptoms, the program worked and the next time I tried to run it I had the same messages. I found that if I powered up the Arduino first and then the ESF8266 al worked fine. Could worth trying in your case.

I had tried but now i am getting following ouput


Can u guide me from starting .i am trying lot but i canā€™t able to solve the problem.
I have Arduino ide 1.6.5 .
Plz helpā€¦

You are using an UNO. You canā€™t do Serial output and connect via the same serial hardware port to your ESP unless you use software serial, is that the case?

Try to close your Serial monitor window and see if the Arduino comes online in the app.

Thank you very much i am successfully blynk.
The error was in program. i had change serial buad rate to 9600&closed the serial monitorā€¦
Thx againā€¦

1 Like

No problem, have fun Blynking :wink:

Hello. I am new here so my applologies for any mistakes I may make. Please correct me.

I spent last night trying to get to run the following scheme:
Aruino UNO+ESP8266+Blynk

ā€¦ and I succeeded today blynking my first green diode :smiley:. I have the following good advices which will make it maybe easier for newbies:

  1. If you want to see the debug info in Serial Monitor, use pins 2,3 instead of 0,1. If you use 0,1 you get error like ā€œfailed to disable echoā€ from the Blynk program. Of course update this in the code: SoftwareSerial EspSerial(2, 3); // RX, TX
    Rx on UNO goes to Tx on ESP8266 and vice versa.
    In this way you are using ā€œSoft serialā€ scenario - appropriate example can be found in IDE after you import Blynk libraries.

  2. When uploading your sketch disable CH_PD pin. Otherwise you might get sync errors. Then power up the UNO, then connect the CH_PD back to vcc. At this time you should get friendly messages in the Serial port monitor.

  3. ESP8266 (8-pin not board friendly version) works fine with 5v logic (at least for a couple of hours now :smile:).

  4. Keep the firmware version of the ESP8266 updated. Perhaps you can use the simplest update from cloud method: call ā€œAT+CIUPDATEā€

  5. Use 9600baud in the program for better stability.

1 Like

@mcovsky can you indicate which example sketches you used as I believe the ones on the Github are outdated. With USB Iā€™m fine but I canā€™t compile Uno with ESP.

latest compile errors are:

In file included from ESP8266_Shield_SoftSer.ino:34:0:
C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/BlynkSimpleShieldEsp8266.h:14:2: error: #error Sorry, we changed things a little bit. Please check new examples for ESP8266. This is easy to fix :)
 #error Sorry, we changed things a little bit. Please check new examples for ESP8266. This is easy to fix :)
  ^
ESP8266_Shield_SoftSer.ino:41:1: error: 'ESP8266' does not name a type
ESP8266_Shield_SoftSer.ino: In function 'void setup()':
ESP8266_Shield_SoftSer.ino:57:3: error: 'Blynk' was not declared in this scope
ESP8266_Shield_SoftSer.ino:57:21: error: 'wifi' was not declared in this scope
ESP8266_Shield_SoftSer.ino: In function 'void loop()':
ESP8266_Shield_SoftSer.ino:62:3: error: 'Blynk' was not declared in this scope
'ESP8266' does not name a type

Hello M
Iam also new to this stuff and i also having a trouble to connect arduino nano and the esp 01
First of all wich sketch did you use?
Is the Arduino nano suppose to be defined in the tools-board? (and not Esp8266)
I managed to connect my esp to my wifi by the AT commands while connected to the arduino nano
:\ but i cant connect the nano to the blynk
I managed to do that with the Wemos d1r2
I feel that iam close but somrthing is missingā€¦

I need helpā€¦someone

@gal.shlifer yes select Nano device in Blynk not ESP8266.
What do you mean by socket?
Are you using the SoftSerial sketch?

Hi and thanks for the response.
I used the softSerial for connecting the esp with the AT commands to wifi
The only thing that missing is the code and libraries for connecting all together
iā€™ve got the esp 01 connected to arduino nano and connected to wifi (with IP adresses and all) . but when
i open the blynk app i am getting message that arduino nano is offline

what am i missing?

You are missing a sketch.
If you have added the 5 libraries then you should select soft serial example from Blynk examples and move on from there.

which 5 libraries?
and what sketch to use?

because if i connect the arduino nano as a board in tools then i am getting errors

ESP8266_SoftSer.h: No such file or directory