I'm trying to get the Arduino Uno to work with the ESP8266 ESP-12E UART WIFI Wireless Shield Development Board For Arduino UNO R3 connected to it.
I'm using the following:
Arduino Uno (confirmed working with simple blink test)
ESP8266 ESP-12E UART WIFI Wireless Shield Development Board For Arduino UNO R3 (image here)
USB to TTL Serial
I have researched several threads regarding this shield. Many are having issues with serial definition. I do not have alot of serial (hardware) experience but am a programmer by profession so I understand some.
I've read and tried following the suggestions mentioned in the following of threads:
https://forum.arduino.cc/index.php?topic=356174.15
This thread seemed most helpful: help with ESP-12E ESP8266 UART WIFI Wireless Shield for Arduino UNO R3 - Project Guidance - Arduino Forum
I'm using the following sketch to test with connection specific details redacted
/**************************************************************
* Blynk is a platform with iOS and Android apps to control
* Arduino, Raspberry Pi and the likes over the Internet.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Downloads, docs, tutorials: http://www.blynk.cc
* Blynk community: http://community.blynk.cc
* Social networks: http://www.fb.com/blynkapp
* http://twitter.com/blynk_app
*
* Blynk library is licensed under MIT license
* This example code is in public domain.
*
**************************************************************
*
* This example shows how to use ESP8266 Shield (with AT commands)
* to connect your project to Blynk.
*
* Note: Ensure a stable serial connection to ESP8266!
* Firmware version 1.0.0 (AT v0.22) is needed.
* You can change ESP baud rate. Connect to AT console and call:
* AT+UART_DEF=9600,8,1,0,0
* In general, Soft Serial may be unstable.
* It is highly recommended to switch to Hard Serial.
*
* Change WiFi ssid, pass, and Blynk auth token to run :)
* Feel free to apply it to any other example. It's simple!
*
**************************************************************/
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "<redacted>";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "<redacted>";
char pass[] = "<redacted>";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial
// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(0, 1); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);
void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Blynk.run();
}
I upload this code setting my Arduino IDE to use Board Arduino/Genuino Uno on COM 6 (Uno USB port).
I also have a USB to TTL Serial connected to the Wifi Shield showing up as COM 7
I have also tried disconnecting the shield and setting the Arduino IDE to use Board NodeMCU 1.0 and the USB to TTL Serial port COM 7 as specified in the first thread mentioned above but that always results in a series of espcomm open, sync, and upload fails. I've only found the upload successful when connecting the shield to the Uno and setting board type to Arduino/Genuino Uno.
I upload the code setting the first 2 dip switches down and the last 2 up.
The code successfully uploads and shows the following in the serial output with the last 3 lines repeating continuously:
[9]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.3 on Arduino Uno
Give Blynk a Github star! => https://github.com/blynkkk/blynk-library
[523] Connecting to <redacted>
AT
[1533] ESP is not responding
AT+CIPCLOSE=1
AT+CIPCLOSE=1
AT+CIPSTART=1,"TCP","blynk-cloud.com",80
AT+CIPCLOSE=1
AT+CIPCLOSE=1
It even shows this output even when I set the first 2 dip switches back to on and reset the shield and arduino.
I'm thoroughly confused on what I need to define as the serial connections and whether I need to use a software serial or whether I need to upload 2 different sketches, one for the wifi sheild and one for the arduino. I've tried so many things at this point, I'm just overly confusing myself now and realize I need some help. Username pert seems to know alot about this particular type of shield and I have been following along in the main thread about this shield but I'm now just stuck on getting the ESP to respond (seen in serial monitor output above).
If someone would have the patience to help me through this issue or just provide a high level step-by-step on the configuration settings that need to be set or changed in order to make this work, I would be very grateful and would consider posting a comprehensive step-by-step guide to setting up one of these shields with an uno for people like me in the future.
Thank you for your time.