Esp8266 + Arduino uno + Blynk

@Sahal_hash you need Blynk libraries from https://github.com/blynkkk/blynk-library/releases/tag/v0.3.3 and ensure you follow the notes on this page about the structure for the 5 lbraries.

Select Uno in your IDE (not ESP) and in your IDE there will be some Blynk examples once you have installed the libraries. The example you should use t start with is called ESP8266_Shield_SoftSer. As it states in the sketch you might want to move to hard serial after trying the soft serial as it is more stable but try soft serial first.

The app bit is very easy but shout if you are stuck after installing the libraries, sketch and app.

@Costas your instructions were of great use.

However I am getting these on my serial monitor.
[19] Blynk v0.3.3 [520] connecting to Espwifi [1536] Failed to disable Echo
Espwifi is the hotspot I created.
I have replaced the authtoken, wifi sssid and password in the ESP8266_Shield_Softser
Please advise.

[UPD: “Failed to disable echo” will most probably be reported as “ESP is not responding” now]

@Sahal_hash in plain English my understanding of “Failed to disable Echo” means:

A. We can’t talk to each other (ESP and Uno) because we don’t talk the same language i.e. the ESP doesn’t have the correct firmware. If you have a relatively new ESP the firmware is normally plug and play. Which ESP do you have? There are lots of tutorials on the internet to flash firmware to ESP’s but don’t go this route unless you think you have an ‘old’ ESP. If you have to go this route pick a relatively new tutorial. As some point of Uno and ESP can talk to each other AT+GMR via serial monitor will tell you what firmware you have on the ESP.

or

B. We can’t talk to each other becuase we are not ‘connected’ for a number of reasons. A common issue here is with the circuits being incorrectly wired up so it’s worth double checking you system. Maybe point us to the circuit you are using. Which pins did you pick for rx and tx on the Arduino and presumably you have Uno rx to ESP tx and vice versa?

From the message you sent me about AP and your reference to hotspot in your last post I think you might have the wrong idea about the ESP’s. The ESP will be connecting via WiFi to your existing wireless network (and the SSID and pwd you will have included in the sketch), you are not creating an AP or hotspot.

[UPD: “Failed to disable echo” will most probably be reported as “ESP is not responding” now]

1 Like

Hey @Costas
I am using Esp8266 ESP-01

To test the Esp I uploaded bareMinimum example to the arduino while esp was connected to it as follows.
Vcc,Ch_pd connected to 3.3v of arduino uno
Esp gnd to arduino gnd
Rst,GPIO0 GPIO2 - unwired
Esp Rx to arduino pin0 (Rx) via voltage divider ckt.
Esp Tx to arduino pin1 (Tx)
The circuit connection I got is from this link.

  1. http://www.jayconsystems.com/tutorials/esp01/
  2. http://forum.arduino.cc/index.php?topic=283043.0

I don’t get response if Rx is connected to Tx of uno
And if Tx is connected to Rx of uno.
Tx-tx and Rx-rx seems to be the right connection in case of arduino uno according to arduino forum 2nd link.
(So continued with Tx-tx and Rx-rx)
After uploading BareMinimum example
I was getting garbage value for command AT
After changing the setting to ‘Both NL&CR’ and baudrate to 115200 esp responded ‘Ok’ to AT command.
Firmware version command AT+GMR
AT version: 0.21.0.0
SDK version: 0.9.5

According to the 1St link given above Esp01 has 3 operating modes.
1 Access point - AP
2 Station - STA
3 Both.

In AP the Wi-Fi module acts as a Wi-Fi network, or access point, allowing other devices to connect to it via wifi (wifi scan on phone showed this device and was able to connect with :grey_exclamation:mark, guess that’s a limited connection) so I presume here a wifi modem(wifi connection) is not required to communicate to esp.
The modes can be checked using AT+CWMODE?
And set using AT+CWMODE=1 or 2 or 3 as needed.

This was the reason for me to mention about using AP mode in your message as I don’t have an access to wifi right now.

To make it less confusing I decided to use one mobile as wifi modem (creating a tethering hotspot, named it Espwifi - which you saw in the error message) which will help me to connect my other mobile having blynk to connect to esp8266. Here the mode used can be 2nd (STA) or 3(both).
This is how the term tethering came in my previous post.

Let me know how the connection is to be made for softser example.
In code they have set (2,3) as Rx and Tx.
Which one should I go for Rx-Tx or Tx-tx, Rx-rx as done while testing.
I feel things going the right way but don’t know where it is lagging. The knowledge I collected about esp is in the past 3 days and surely isn’t enough for me to blink an led :tired_face::joy:
Correct me if any of the above knowledge acquired is incorrect. Em a beginner hope you understand.

@Costas sorry for this very long post. I wanted you to have a clear picture of what em into.
Others who also have been through such situations pls help.

I would say for sure rx to rx is WRONG. There are occasions when some devices are marked up to show that the incoming rx is connected HERE but this is rare and the markings are normally to say this is the rx port and you do not want rx to rx. You will notice in the forum that the OP was questioned about rx to rx etc.

Sometimes things work even though they shouldn’t. The correct set up that many of use is the one that @psoro posted at Robot with Esp8266 Shield and Arduino Nano

The other thing that is recommended is that you disconnect rx and tx from the ESP when you are flashing the Uno as it can crash the ESP.

The reason you have the ! limited for AP is that unless you have some other magic then the ESP is not on the internet it is just a local network that will not work with Blynk’s cloud server. So you must use STA unless I am having a blonde moment.

You seem to have a fairly old firmware and my recollection was that STA was 1, AP 2 and 3 is both whereas you indicate 1 & 2 the other way round. Just checked that and with the later firmware, probably all of them, 1 is STA (the one you require). From memory you need at least 0.22 AT version with Blynk.

Ok so you don’t have a regular internet connection. You are wirelessly tethering the ESP to a phone (presumably 3G / 4G). In theory this should work but I haven’t tried it (yet) but you would still need mode 1 or 3 not 2 AP.

I think I read recently that Blynk doesn’t support GSM connections yet so this might be your problem as the tether will make it a GSM connection.

1 Like

Ohh yess I though the pin on arduino was named I didn’t notice the arrow marks, pin0 was marked Rx​:arrow_left:0 which meant pin0 was Tx :joy:🙋
And you were correct about STA being 1 and AP being 2.
Having an old firmware, so are you suggesting me to upgrade…?


In example code of softser it says EspSerial (2,3);//Rx,Tx
So my pin 2 on uno must connect with Tx of esp and pin 3 of uno must connect to Rx of esp ryt…?

I don’t have any Uno’s but I have some Nano’s that pretend to be Uno’s because of the WDT bug.
Nano’s can be flashed with Uno sketches with a few exceptions. Pin 0 on the Nano is marked as TX and that ties up with your Uno except the Uno’s are marked to tell you what needs to be at the other end of connection rather than what the pin on the Uno actually does (i.e. transmit).

So yes we are both correct and I can understand now why some tutorials say connect tx to tx when really it is tx to rx (if the boards are marking the actually pin action).

The soft serial pins of 2 and 3 for rx and tx are referring to the pins on the board you are flashing (Uno in your case). So pin 2 is rx (going to tx on ESP) and vice versa for pin 3.

If you do the pin 2 + 3 connections, check everything and you still have the echo issue then yes I think you need to flash the ESP. How long have you had the ESP?

Glad I made it till here…but yes even after the connection of Rx,tx pins em getting those 3 lines including failed to disable Echo.
Is it because of not having a wifi network connection…?
After having the softser codes flashed in uno I noticed my AT commands are not working, is it normal…?
I also tried doing editing the softser code by keeping (1,0)rx,tx still no response of AP Codes

It’s been a week I bought it, Going crazy since then :stuck_out_tongue_closed_eyes::joy:

I don’t think the echo error is due to having no WiFi as I believe that is checked later in the sketch.

You can’t use pins 0 and 1 because Serial Monitor is using those pins on a single serial port device like the Uno & Nano. I guess you could keep Serial Monitor closed and you might see the ESP-01 connect to Blynk in the app but you should really pick pins 2 and 3 onwards.

If you can’t issue AT commands in Serial Monitor, Putty, Hyperterm or similar then there is a problem but that will be because you are hooking up to pins 0 and 1.

If you have been changing tx and rx around the rx on the ESP-01 may be ‘damaged’ as it can only take 3.3V not the 5V provided by the Uno. Have you had a voltage divider in the circuit at all times on the ESP rx pin? Some times the ESP’s spring back to life a day or two after they have been ‘damaged’.

I got it connected back to 2 and 3. It isn’t getting connected to my hotspot of my mobile.

My AT commands respond when there is bareMinimum example in the sketch and (0,1)are connected to Rx and Tx.
No response at all when I upload softser example.

I had the voltage divider circuit all the time but I guess I may have 2-4 times connected it directly bcs of the misunderstanding on pin name.

Is there a way to check if it’s damaged.? It still powers on when uno is connected to USB.

If you have lights on the ESP-01 and the AT commands are working in the minimum sketch the ESP-01 should be fine.

Let me see the minimum sketch where the AT commands work and be sure the sketch is formatted with </>.

The BareMinimum sketch.


`void setup () {
// Put your setup code here to run once:
}

void loop() {
//Put your main code here, to run repeatedly:
}
`

For command AT it responded OK
For command AT+GMR it responded
AT version: 0.21.0.0
SDK version: 0.9.5
OK

For command AT+RST (at this point my Rst pin on esp is unwired)
It responded

Hey I tried increasing the delay from 10 - 20 in the softser example.
And also changed the Serial.begin (9600) - (115200) in both places. (as while running bareMinimum example the AT command responded at 115200 baudrate.)

After uploading the sketch in serial monitor
Now it says

[53[39] Blynk v0.3.3 [539] connecting to wifi [567] Failed to set STA mode

Glad you got passed the ‘echo’ issue.
In part B of Esp8266 + Arduino uno + Blynk above I should have added that another reason we can’t talk (Uno and ESP) is that one of us is talking too fast or too slow for the other one to understand what is being said i.e. ensure the baud rates are set correctly.

The ‘STA’ issue should be one of the following:

A. You have set AP when you need STA and this is easy enough to fix with AT commands.

B. You need a different firmware version for the ESP. Reluctant to advise this becuase if it is done wrong you can fry the ESP.

C. The thethering system you want to use is not yet possible with Blynk. Are you able to try regular internet rather than a GSM network? If I have time later today I will try to check if tethering works.

Here’s what I feel is going on

1. Esp8266 responds well on AT commands when BareMinimum is uploaded on uno
So Esp and Arduino uno are both good.

**2.**Blynk softser example example compiles well hence Blynk library is also good.

**3.**Issue is when blynk softser example is uploaded, No response from Esp8266 for AT commands.
Guessing Blynk doesn’t support Esp8266 firmware which is AT version: 0.21.0.0

If my guess is right, what should I be doing.?
If flashing the firmware is the only option left then, how can I do it using arduino uno.

1 Like

In this thread [SOLVED] "Failed to disable echo" PROBLEM the Blynk guys stated that firmware version 0.22 is required and that some other later versions might work. There is also a link to the required firmware (and confirmation about setting the baud to 115200).

This instructable gives details of flashing the ESP’s with an Uno http://www.instructables.com/id/Intro-Esp-8266-firmware-update/?ALLSTEPS but I use an FTDI so I can’t confirm it works.

@Sahal_hash you’ll be glad to know that tethering does work. Or at east it does with ESP standalone (WeMos D1 Mini). Samsung S3 set up as AP on GSM and using the same phone to control the tethered ESP with the Blynk cloud server.

If you didn’t want to try a firmware update to run the ESP with the Uno you could use your ESP as standalone. The ESP8266 Arduino core has the required firmware to work with Blynk. They released something like version 2.2 last week and I haven’t moved over yet but 2.10rc2 is fine. Pretty sure 2.2 is ok too.

Do you need the Uno?

If you have chance you should look to pick up a WeMos D1 Mini. MUCH easier than Arduino with ESP.

1 Like

@Costas Very much happy to know the tethering idea worked and glad that you tried.
Let me have a look at the instructable and I’ll revert back.
Wemos D1 mini, is it the latest one in esp series…?
Talking about the need of uno, I was planning to control 5-6 led’s in the o/p of uno (which will be replaced later according to my project) , can this be done by esp as standalone…?