I am new to arduino and recently I have bought a ESP8266 wifi Schield. I uploaded the following program to the arduino
//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>
// Set ESP8266 Serial object
//#define EspSerial Serial1
// This can be a SoftwareSerial object
// (remember to also edit ESP8266.h):
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(0,1); // RX, TX
#define EspSerial SwSerial
ESP8266 wifi(EspSerial);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "39d2704e6d824930a5e348ecfd953e55";
void setup()
{
Serial.begin(115200); // Set console baud rate
while (!Serial) {}
EspSerial.begin(115200); // Set ESP8266 baud rate
while (!EspSerial) {}
Blynk.begin(auth, wifi, "HITRON-8090", "81KLKP7154XB");
}
void loop()
{
Blynk.run();
}
But receives the following Error on Serial monitor
[0] Blynk v0.2.2-beta
[0] Connecting to HITRON-8090
[1026] Failed to disable Echo
I would really love to see the communication going on through blynk. Could anyone help in resolving this problem. Thanks in advance.
[UPD: âFailed to disable echoâ will most probably be reported as âESP is not respondingâ now]
I had the same problem. The Arduino TX must connect to the ESP8266 RX and vice versa. I had TX to TX and RX to RX and I received the dreaded âFailed to disable echoâ (happened when I switched from breadboard to shield).
If you use SOftSeria, anything which is NOT 0 and 1, and with Hardware serial you use 1 and 0, but your console wont be usable (unless you use a arduino Mega with more than hardware serial port)
I try the basic code for esp shield but i can`t make to work.
Arduino: 1.6.3 (Windows 7), âArduino Unoâ
^
ESP8266_Shield.ino: At global scope:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:51:14: note: in expansion of macro âEspSerialâ
ESP8266_Shield.ino: In function âvoid setup()â:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:61:3: note: in expansion of macro âEspSerialâ
and i cant understand where i change the version for my esp (at+gmr = 0018000902-AI03 and at+rst=Version:0.9.2.4).
Can someone help me ?im new with arduino.(sorry for my English)
@Robots can you please post your code too? Serial1 not declared means you donât have initialized your serial object, but thatâs logical because you use an Arduino Uno, It has only one serial port, the hardware one (via either the USB and/or the pins on the board (pins 0 and 1).
So Iâm guessing you made some errors in your code.
i use the basic code but i dont make the chages for my esp .i dont know how to do that.
/#define BLYNK_DEBUG
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266.h>
#include <BlynkSimpleShieldEsp8266.h>
// Set ESP8266 Serial object
#define EspSerial Serial1
// This can be a SoftwareSerial object (remember to also edit ESP8266.h):
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266 wifi(EspSerial);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
void setup()
{
Serial.begin(9600); // Set console baud rate
delay(10);
EspSerial.begin(9600); // Set ESP8266 baud rate
delay(10);
Blynk.begin(auth, wifi, "ssid", "pass");
}
void loop()
{
Blynk.run();
}
and down say:
Arduino: 1.6.3 (Windows 7), PlacÄ"Arduino Uno"
In file included from C:\Users\Dominic\Documents\Arduino\libraries\blynk-library-0.3.0/BlynkSimpleShieldEsp8266.h:18:0,
from ESP8266_Shield.ino:43:
C:\Users\Dominic\Documents\Arduino\libraries\blynk-library-0.3.0/BlynkApiArduino.h: In member function 'void BlynkApi<Proto>::processCmd(const void*, size_t)':
C:\Users\Dominic\Documents\Arduino\libraries\blynk-library-0.3.0/BlynkApiArduino.h:94:82: note: #pragma message: Good! Analog pins can be referenced on this device by name.
#pragma message("Good! Analog pins can be referenced on this device by name.")
^
ESP8266_Shield.ino: At global scope:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:51:14: note: in expansion of macro âEspSerialâ
ESP8266_Shield.ino: In function âvoid setup()â:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:61:3: note: in expansion of macro âEspSerialâ
Eroare de compilare
Acest raport ar avea mai multe informaČii cu
âDetaliazÄ informaĹŁiile de ieĹire a compilatorului:â
Activat ĂŽn FiĹier > PreferinĹŁe.
can you help me please? i`m new with arduino
thx.
So you got an ESP attached with the TX and RX pins to your Arduino Uno pins 2 and 3? If so, you have to use the SoftwareSerial and set your ESP to a much lower baudrate.
Comment out the #define EspSerial1 Serial1 and uncomment the two SoftwareSerial lines below it (and change accordingly in the .h file given in the description).
Also donât forget to get the changed library from the comments instead of the regular ESP library.
Change the ESP baudrate with the ESP attached to a serial port (with 3.3v logic on TX and R port, NOT 5v which is what a normal serial port does!) with the command AT+CIOBAUD=9600
i cant undestand ..... sorry (rx and tx is 0 1 default ) and how i change the library (i dont know how to do that ) can you give me a library ?thx for help
When you compile/upload it, the library will use the SoftwareSerial function and you can attach the ESP to any tx/rx pins other than 0 or 1 (note to set slow speed, like 9600 baudrate for stability).
i make the changes in his lybrary and now he give me :
Arduino: 1.6.3 (Windows 7), PlacÄ"Arduino Uno"
In file included from ESP8266_Shield.ino:42:0:
C:\Users\Dominic\Documents\Arduino\libraries\ITEADLIB_Arduino_WeeESP8266-master/ESP8266.h:29:28: fatal error: SoftwareSerial.h: No such file or directory
#include âSoftwareSerial.hâ
^
whith //#include <SoftwareSerial.h>
and with #include <SoftwareSerial.h>:
ESP8266_Shield.ino: At global scope:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:51:14: note: in expansion of macro âEspSerialâ
ESP8266_Shield.ino: In function âvoid setup()â:
ESP8266_Shield.ino:46:19: error: âSerial1â was not declared in this scope
ESP8266_Shield.ino:61:3: note: in expansion of macro âEspSerialâ
Thank you for the time spend with me.
// Set ESP8266 Serial object
#define EspSerial Serial1
// This can be a SoftwareSerial object (remember to also edit ESP8266.h):
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX
To:
// Set ESP8266 Serial object
//#define EspSerial Serial1
// This can be a SoftwareSerial object (remember to also edit ESP8266.h):
#include "SoftwareSerial.h"
SoftwareSerial EspSerial(2, 3); // RX, TX
And attach rx/tx to pin 2 and 3 (rx to tx and tx to rx)
Please note the changed quotes on the library include. Somehow that works in weird way with Arduino compiler. It may have trouble finding the library.