Need help with Blynk+ arduino uno+ esp8266

Hi, I have followed all the steps mentioned in

http://www.instructables.com/id/Connecting-ESP8266-01-to-Arduino-UNOMEGA-and-BLYNK/?ALLSTEPS

I was able to connect to wifi using ESP8266.

But when i try and connect it using the app, it says Arduino is not in the network.

Kindly oblige.

I think Ardunio is not sending/receiving data from ESP8266.

What Arduino are we talking about? If it’s an UNO there is already the problem of only 1 serial port… I’m not sure what to think of the terminal window?

Yes its Arduino Uno.

I have connected Rx pin of ESP8266 to both Ardunio and to USB-TTL, so that i can see the data received from ESP8266

That’s creative, but it’s not gonna work. Use either SoftSerial (see the example in the Blynk library) or get a Mega with more serial ports.

I have directly connected at Uno. Using the basic code.

But no success.

> #include <ESP8266_HardSer.h>
> #include <BlynkSimpleShieldEsp8266_HardSer.h>
> #define BLYNK_PRINT Serial    // Comment this out to disable prints and save space

> #define EspSerial Serial


> ESP8266 wifi(EspSerial);

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

> WidgetLED led1(V1);

> void setup()
> {
>  
>   Serial.begin(115200);
>   delay(10);
>   EspSerial.begin(115200);
>   delay(10);

>   Blynk.begin(auth, wifi, "Sxxxxx", "xxxxx");
>   delay(10); 

>   while (Blynk.connect() == false) {
>   }
>  pinMode(2,OUTPUT);
> }

> void loop()
> {
> Blynk.run();
> }

Remove the Serial.begin(). It may cause trouble if you initialize the serial port twice. It’s also possible to put the Serial debug stuff on to a virtual serial port (tx/rx pins) and thus monitor your Arduino.

Does the ESP/Uno actually not work when switching pins or does it just give a message of “disconnected” hardware. Because that message is not always accurate, so when you fired it up, try and put a button on Pin2 and see if you can turn on/off a LED (or use Uno pin 13, that is the integrated LED).

@faizanshukoor your failure is due to using very old libraries which try to connect to a server (cloud,blynk.cc) that was retired more than 6 months ago.

Update everything (app and libraries) and let us know how it goes.

@faizanshukoor the other problem that you and many new Blynkers will encounter when they look at “old” (more than about 6 months old) sketches either here, on Instructables or elsewhere is that from release 0.3.4 to release 0.3.5 two libraries were removed and given a new name covering the two libraries.

shows 0.3.4 as:

The structure should look like this:
~\Arduino\libraries\Blynk
~\Arduino\libraries\BlynkESP8266_HardSer
~\Arduino\libraries\BlynkESP8266_SoftSer
~\Arduino\libraries\SimpleTimer
~\Arduino\libraries\Time

and 0.3.5 became:

~\Arduino\libraries\Blynk
~\Arduino\libraries\BlynkESP8266_Lib
~\Arduino\libraries\SimpleTimer
~\Arduino\libraries\Time

Quite problematic if you are new to Arduino libraries but basically any sketch that makes reference to hard or soft ser(ial) will no longer work. The modifications required to the sketch are quite minor for an experienced coder but not so trivial for a beginner.

The examples provided by Blynk that are available in the IDE should be studied so you know which libraries are now required for each type of connection.

Thanks for the reply.

I have updated my library .

Now I am not sure which example to use because I am using ESP8266 module not the shield.

Kindly suggest me, which example i should work on to get started with.
I know its bit annoying

You will require the ESP_Shield example and set board type to Arduino UNO in the IDE. You wil; be flashing the UNO and not the ESP.

@faizanshukoor if you are using the ESP as a WiFi shield for the Uno then @Lichtsignaal is spot on.

I see 0.3.11 in your Library Manager which is strange for 2 reasons.

The latest release appears to be only 0.3.10 in Github and you DO NOT use Library Manager to install Blynk libraries. They should be installed manually as follows for 0.3.10:

The structure should look like this:
~\Arduino\libraries\Blynk
~\Arduino\libraries\BlynkESP8266_Lib
~\Arduino\libraries\Adafruit_NeoPixel
~\Arduino\libraries\SimpleTimer
~\Arduino\libraries\Time

Thanks for the reply.

I was able to successfully able to connect to my app, thanks for your guidance.

But still facing issues, it’s getting disconnected too frequently. So i cant really access the ports (LED in my case). Kindly find the serial details as well as details from ESP8266 Rx pin below:

Serial Details From Ardunio:

[19] Blynk v0.3.11 on Arduino Uno
[520] Connecting to XXXXXXXX
[19] Blynk v0.3.11 on Arduino Uno
[520] Connecting to Sun Softronic
[13542] AT veqsion:0.22.0/0(Mar 20 2015 10:04:26(
SDK version:1.0.0
con0
[13557] Failed to set STA mode
[29017] Ready (ping: 11ms).
[39250] Login timeout
[49433] Ready (ping: 12ms).
[59588] Login timeout
[107307] Ready (ping: 2304ms).
[117348] Login timeout
[127529] Ready (ping: 12ms).
[137688] Login timeout
[147868] Ready (ping: 12ms).
[157907] Login timeout
[170084] Login timeout
[210718] Login timeout
[218880] Ready (ping: 12ms).
[228921] Login timeout
[241104] Login timeout
[19] Blynk v0.3.11 on Arduino Uno
[520] Connecting to XXXXXXXXXXX
[13542] AT vY®®ZËK‚r’’r‚r‚Bj…É�’‚’‚ŠªŠ‚Ò‚¢Ò’²Jj
SDK version:1.0.0
colpil
[23582] +CIFSR:STAHP,“192.168/0.7”
+CIFSS:STAMAC,“5c;cf:7f:0a:56;8f”

[23596] Connected to WiFi
[54632] Ready (ping: 12ms).
[55045] Invalid HW cmd: fw
[71209] Ready (ping: 36ms).
[81248] Login timeout
[91496] Ready (ping: 41ms).
[101764] Login timeout
[122412] Ready (ping: 12ms).
[123143] Invalid HW cmd: `r
[128251] Login timeout
[133448] Ready (ping: 20ms).
[149062] Ready (ping: 32ms).
[159215] Login timeout
[169406] Ready (ping: 12ms).
[181679] Login timeout
[191898] Invalid HW cmd: aq
[203198] Login timeout
[218563] Ready (ping: 12ms).
[228716] Login timeout
[19] Blynk v0.3.11 on Arduino Uno
[520] Connecting to xxxxxxxxxxxxxxxxx
[13542] AT version:0.22.0.0(Maq 20 2015 10;04:26)
SDK version:1.0/0
com5CLOSED

[23582] +CIFSR:STAHP,“192.168.0.7”
+CIFSR9STAMAC,“5c9cf:7f:0a:56;8f”

[23596] Connected to WiFi
[38929] Ready (ping: 17ms).
[53280] Login timeout
[78557] Login timeout
[113870] Login timeout
[122035] Ready (ping: 12ms).
[132084] Login timeout
[167426] Ready (ping: 12ms).
[177465] Login timeout
[187650] Ready (ping: 12ms).
[197804] Login timeout
[223115] Ready (ping: 13ms).
[238672] Ready (ping: 22ms).
[248901] Login timeout
[274225] Ready (ping: 12ms).
[284833] Ready (ping: 12ms).
[294872] Login timeout
[305061] Ready (ping: 12ms).
[315286] Login timeout
[355624] Ready (ping: 13ms).
[365663] Login timeout
[418256] Login timeout
[458674] Login timeout
[466846] Ready (ping: 13ms).
[493937] Ready (ping: 12ms).
[503977] Login timeout
[514160] Ready (ping: 12ms).

RX Pin Details From ESP8266:

CONNECT

OK

OK

SEND OK

+IPD,31:<0><0><0>È<0><0>pm<0>7<0>out<0>14<0>in<0>12<0>out
OK

SEND OK

OK

SEND OK

OK

SEND OK

+IPD,5:<0><0><0>ÈCLOSED

OK

OK
AT version:0.22.0.0(Mar 20 2015 10:04:26)
SDK version:1.0.0
compile time:Mar 20 2015 11:00:32

OK
+CWMODE:1

OK

OK

OK
+CIFSR:STAIP,“192.168.0.7”
+CIFSR:STAMAC,“5c:cf:7f:0a:56:8f”

OK

OK

ERROR
CONNECT

OK

OK

busy s…
busy s…
CLOSED
SEND FAIL

ERROR
CONNECT

OK

OK

SEND OK

+IPD,31:<0><0><0>È<0><0>pm<0>7<0>out<0>14<0>in<0>12<0>out
OK

SEND OK

OK

SEND OK

OK

SEND OK

+IPD,5:<0><0><0>È
OK

busy s…

SEND OK
CLOSED

OK
CONNECT

OK
CLOSED

OK
CONNECT

OK

OK

SEND OK

+IPD,31:<0><0><0>È<0><0>pm<0>7<0>out<0>14<0>in<0>12<0>out
OK

SEND OK

OK

SEND OK

OK

SEND OK

+IPD,5:<0><0><0>È
OK

busy s…

SEND OK
CLOSED

OK
CONNECT

OK

OK

SEND OK

+IPD,31:<0><0><0>È<0><0>pm<0>7<0>out<0>14<0>in<0>12<0>out
OK

SEND OK

OK

SEND OK

OK

SEND OK

+IPD,5:<0><0><0>È

@faizanshukoor you are making some progress.

I consider Arduino with ESP to be the worst possible way to use Blynk.

ESP
Ethernet
USB

are all generally much better.

Your ESP12 is far more powerful than the Uno and MUCH cheaper. Do you REALLY need an Uno?

1 Like

Thanks for the reply.

Yes i guess i should use ESP, but only drawback i feel is connecting analog sensors, where UNO comes handy .
I was thinking of building a robot, so i need to have a wireless communication rather than going in for USB/Ethernet connection.

@faizanshukoor even if I wanted to connect half a dozen analogue sensors I would still use an ESP without an Arduino. Just connect up an analogue board to the ESP if you need more than one analogue port.

Feel free to continue with Arduino and ESP but it is the biggest nightmare imaginable for many users.

Just search the forum for “echo” and it will give you some idea of the problems. It can be done and some people have it running within a few hours, for some it is a few weeks and some never achieve it.

1 Like

Totally with Costas here. Use the Arduino and an Ethernet port or get a standalone ESP chip like the Wemos D1 (highly recommended!!!). Sometimes I still try to attach the ESP as shield, but after about 10 minutes I either get a Wemos or pull out a network port and attach that.

1 Like

and this is from someone that knows pretty much all there is to know about Blynk.

@faizanshukoor as you say Ethernet and USB will not really be suitable for a robot so ESP in standalone mode (or bluetooth which I know nothing about) is the way to go. If you really want to make use of the Uno you can connect it to the ESP rather than connecting the ESP to Uno.

This might seem like the same thing but it’s not. You would flash the ESP with the Blynk sketch and the Uno has a sketch passing data via the Serial port (soft or hard) to the ESP.