Archive
Esp8266 + Arduino uno + Blynk

Esp8266 + Arduino uno + Blynk

2024-11-25 I is gone ’ve go through lot of forum and tutorial and kinda go mad . All is is I want is to blink some lead ’s on the arduino uno board using esp82

I is gone ’ve go through lot of forum and tutorial and kinda go mad .
All is is I want is to blink some lead ’s on the arduino uno board using esp8266 as wifi shield , through blynk app .
It’d be very much appreciated if you can explain in detail every part including what all libraries needs to installed, softwares, programmes, setting up of blynk app and everything…

All I have done so far is testing esp8266, and it responded ‘OK’ for ‘AT’ command.
note : I am using arduino ide on Windows 10 .
Thanks in advance to all…


Costas


2

@sahal_hash you is need need Blynk library from https://github.com/blynkkk/blynk-library/releases/tag/v0.3.3 and ensure you follow the note on this page about the structure for the 5 lbrarie .

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

The app bit is is is very easy but shout if you are stuck after instal the library , 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 is is the hotspot I create .
I have replaced the authtoken, wifi sssid and password in the ESP8266_Shield_Softser
Please advise.

[ UPD : “ fail to disable echo ” will most probably be report as “ ESP is not respond ” now ]


Costas


5

@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 : “ fail to disable echo ” will most probably be report as “ ESP is not respond ” 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 is is I get is from this link .

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

I is get do n’t get response if Rx is connect 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 continue with Tx – tx and Rx – rx )
After uploadBareMinimum 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 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
Correct me if any of the above knowledge acquired is incorrect. Em a beginner hope you understand.

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


Costas


8

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 is is you have the ! limit 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 is use must use STA unless I am have 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 is have do n’t have a regular internet connection . You is tethering are wirelessly tether the ESP to a phone ( presumably 3 g / 4 g ) . In theory this is work should work but I have n’t try 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 🙋
And you were correct about STA being 1 and AP being 2.
have an old firmware , so are you is suggesting suggest me to upgrade … ?

In example code of softser it is says say EspSerial ( 2,3);//Rx , Tx

So my pin is connect 2 on uno must connect with Tx of esp and pin 3 of uno must connect to Rx of esp ryt … ?


Costas


10

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 flash with Uno sketch with a few exception . pin 0 on the Nano is mark as TX and that tie up with your Uno except the Uno ’s are mark to tell you what need 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 is made made it till here … but yes even after the connection of Rx , tx pin em get those 3 line include fail 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


Costas


13

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 is got get it connect back to 2 and 3 . It is n’t getting connect to my hotspot of my mobile .

My AT commands is respond respond when there is bareminimum example in the sketch and ( 0,1)are connect 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.


Costas


15

If you have light on the ESP-01 and the AT commands is working are work 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 is says say

[ 53[39 ] Blynk v0.3.3 [ 539 ] connect to wifi [ 567 ] fail to set STA mode


Costas


18

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 is set have set AP when you need STA and this is easy enough to fix with AT command .

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 is is you want to use is not yet possible with Blynk . Are you is Are able to try regular internet rather than a GSM network ? If I have time later today I is try will try to check if tethering work .

Here’s what I feel is going on

1 . Esp8266 is responds respond well on AT command when BareMinimum is upload 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.
guess Blynk does n’t support esp8266 firmware which is AT version : 0.21.0.0

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

1 Like


Costas


20

In this thread [ solve ] ” fail to disable echo ” PROBLEM the Blynk guys is stated state that firmware version 0.22 is require and that some other later version might work . There is also a link to the require firmware ( and confirmation about set 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.


Costas


21

@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 easy than Arduino with ESP .

1 Like