Problem with Arduino Uno and ESP 8266 module

Hi there!

I try to do a small project via Wi-Fi, but the worst thing is to connect Uno and that damned ESP 8266. No matter which Firmware I use, no matter which library and attached examples, no matter even module itself - I bought 2 separated from different shops and both act exactly the same.

My every try cointains:

  • Arduino Uno
  • 3.3V <-> 5V Logical Level Converter
  • ESP 8266

and nothing more.

Please, do me a favor and take a look at my latest try:

Connections:

ESP -> Converter -> Arduino

Vcc -> Lvcc -> Hvcc -> 5V
RST -> Lvcc -> Hvcc -> 5V
CH_PD -> Lvcc -> Hvcc -> 5V
GND -> GND -> GND -> GND
Tx -> L4 -> H4 -> Digital pin 10
Rx -> L3 -> H3 -> Digital pin 11

GPIO 0 and 2 are not connected. Tried even to switch pins 10/11 manually and as you may guess - nothing happened.

Program code:

#include <Arduino.h>
#include <SoftwareSerial.h>
#include <ESP8266_Simple.h>

// These are the SSID and PASSWORD to connect to your Wifi Network
#define ESP8266_SSID  "name"
#define ESP8266_PASS  "password"

ESP8266_Simple wifi(10,11);

// See HelloWorld example for further comments.

void setup()
{  
  Serial.begin(115200); // Reduce this if your Arduino has trouble talking so fast
  Serial.println("ESP8266 Demo Sketch");

  wifi.begin(9600);  
  wifi.setupAsWifiStation(ESP8266_SSID, ESP8266_PASS, &Serial);    
  
  // A blank line just for debug formatting 
  Serial.println();
}

void loop()
{
  
  // This example is just to show you how to grab the IP address of your
  //  device after it has connected, in case you want to do something with
  //  it.
  
  // You can get it either as a 16 byte string, or as a long unsigned integer 
  // representation.  
  
  char          ipAddressString[16]; // 16 bytes needed
  unsigned long ipAddressLong;       // only 4 bytes needed
  
  // Either way, you get the address exactly the same.
  wifi.getIPAddress(ipAddressString); 
  wifi.getIPAddress(ipAddressLong);
  
  // And then do what you like with it.
  Serial.print("The string IP is: ");
  Serial.println(ipAddressString);  
  Serial.print("The unsigned long IP is: ");
  Serial.println(ipAddressLong);
  
  // You can convert from one to the other
  strcpy(ipAddressString,"127.0.0.1");    
  wifi.ipConvertDatatypeFromTo(ipAddressString,ipAddressLong);  
  Serial.print("The IP address ");      Serial.print(ipAddressString);
  Serial.print(" has integer value ");  Serial.println(ipAddressLong);
  
  ipAddressLong = 0x36F1256B;
  wifi.ipConvertDatatypeFromTo(ipAddressLong,ipAddressString);    
  Serial.print("The integer value ");  Serial.print(ipAddressLong);
  Serial.print(" has IP address ");    Serial.println(ipAddressString);
    
  Serial.println("End of Demo");  
  Serial.println();
  delay(5000);  
}

Photos:

Thanks in advance for showing me my mistake :slight_smile:

You should post a link to this ESP8266_Simple library you're using.

You should provide information on what you've done regarding the firmware on the ESP8266.

Your stated connection of Tx to pin 10 and Rx to pin 11 is correct for this application because that's an RX-TX, TX-RX connection.

I found Arduino to ESP8266 By Serial Communication | Martyn Currey to be very helpful.

You must buy a 3.3V AC adapter. The ESP8266 is power hungry and the Arduino Uno cannot supply the current that the ESP8266 needs.

pert:
You should post a link to this ESP8266_Simple library you're using.

Totally agree, sorry for trouble:

You should provide information on what you've done regarding the firmware on the ESP8266.

Current firmware is "ESP8266 v0.9.5.0 AT".

Also tried firmware used in this project:
https://create.arduino.cc/projecthub/circuito-io-team/simple-arduino-uno-esp-8266-integration-dba10b
It was called "v1.1.1.1 AT". Didn't know if that was official one or just "homemade" (like their library for ESP8266) so decided to rollback to 0.9.5.0 mentioned above.

ieee488:
I found Arduino to ESP8266 By Serial Communication – Martyn Currey to be very helpful.

You must buy a 3.3V AC adapter. The ESP8266 is power hungry and the Arduino Uno cannot supply the current that the ESP8266 needs.

Thanks for link, as I see it contains a lot of useful info, will check it when I wake up :slight_smile:

In terms of power for ESP... It's not a big deal to get adapter, but then my question is - if it's required for ESP to work properly, why (at least) a dozen people managed to create working projects with ESP supplied with Uno?

Xenhil:
In terms of power for ESP... It's not a big deal to get adapter, but then my question is - if it's required for ESP to work properly, why (at least) a dozen people managed to create working projects with ESP supplied with Uno?

Maybe they were lucky.

The AT firmware runs at 115200 baud by default. However, SoftwareSerial library does not work reliably at that speed. So you need to use the correct AT command to change the baud to 9600, which is the speed at which your sketch is currently configured to communicate with the ESP8266.

5V pin of Uno can supply esp. converted to 3.3V

Juraj:
5V pin of Uno can supply esp. converted to 3.3V

What does converting or not converting have to do with anything?

It either can supply the current or it can't.

If the OP wants to chase gremlins that later turn out to be power supply issues, that's his right.
Not waste of my time.

ieee488:
What does converting or not converting have to do with anything?

It either can supply the current or it can't.

If the OP wants to chase gremlins that later turn out to be power supply issues, that's his right.
Not waste of my time.

see the Uno R3 spec

I also have a related question yet i'm a complete noob to arduino. And i have been following the guide in the link

to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution? :frowning:

Juraj:
see the Uno R3 spec

See the ESP8266 spec

Nipuni18:
I also have a related question yet i'm a complete noob to arduino. And i have been following the guide in the link
ESPWiFi Shield Rev2.0 User Manual - Google Docs

to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution? :frowning:

Start your own thread!

ESP datasheet max max value Tx802.11b, CCK 11Mbps, P OUT=+17dBm 170 mA

UNO R3 5 V pin max current depends only on power source and is limited by heat dissipation. it can be 500 mA

UNO R3 3.3 V pin max 50 mA

UNO WiFi has 1A 3.3 V pin

http://forum.arduino.cc/index.php?topic=70450.0

Nipuni18:
I also have a related question yet i'm a complete noob to arduino. And i have been following the guide in the link
ESPWiFi Shield Rev2.0 User Manual - Google Docs

to setup my wifishield with arduino uno. Also i am using a wifi router with no internet connection for the setup as my uni wifi restricts the usage. I proceed until recieving the IP then when i open it in the browser, the IP doesn't respond and fails to connect the server. any solution? :frowning:

@Nipuni18's thread:
http://forum.arduino.cc/index.php?topic=513687

pert:
The AT firmware runs at 115200 baud by default. However, SoftwareSerial library does not work reliably at that speed. So you need to use the correct AT command to change the baud to 9600, which is the speed at which your sketch is currently configured to communicate with the ESP8266.

As far as I understand AT commands are used to control ESP, but my problem is -> I can't even "talk" to this module. I mean, it doesn't respond to any commands, not only checking IP/connecting to local network, but whole communication between me/arduino and the module doesn't work. ESP seems to be turned off even if red LED lights all the time on its surface.

flashing the esp did work? (you write about firmware versions)

Juraj:
flashing the esp did work? (you write about firmware versions)

Yes, tried two versions of 0.9.5.2 AT (9600 and 115200 baud).

So flashing esp seems ok (no troubles/errors), but after that I can't communicate to my module in any way.

Below you can see connected ESP 8266 to PC via PL2303 to flash device:

However, while flashing firmware seems to work, I couldn't talk to my ESP using Arduino IDE serial monitor port - again, it doesn't respond to my AT command... well, AT command isn't even visible in that window:

Of course I picked correct COM port in Arduino IDE options, that's not a problem.

So my question is why can't I even insert simplest command "AT"? As I said in first post - no matter firmware version, no matter connection, no matter baud, no matter even supplying module -> got 3.3V adapter and still can't talk to my module.

Any help or tips would be truly appreciated :slight_smile:

and GPIO0 was grounded for flashing and is pulled HIGH for normal boot?

Juraj:
and GPIO0 was grounded for flashing and is pulled HIGH for normal boot?

GPIO0 was grounded during flashing - no effects, as you can see in post above. For normal boot GPIO0 was unplugged, but decided to try high as you mentioned and still it didn't work.

Tried even using random program to check if ESP is visible. Well, it isn't. Beside flashing my module seems to be invisible in serial monitor and other places. The real question, is my device really updated? So it could connect through adapter to get flashed, but can't connect to let me communicate with him via AT commands? Seems weird...

ok. it is possible, that you flashed the firmware with wrong settings. if you have Windows, use the Espressif Flash Download Tool. it detects the settings and sets them into bootloader and the esp-init.bin before writing.