Using ESP8285 ESP M2 with Arduino UNO

Hello,

I'm new in this, so I need some guide with the module ESP8285 ESP M2, I already (I guess) connected the Module with Arduino, but I don't figure it out how to make it works, so I'm asking for help with this.

Thanks

1. Post the picture of your ESP8255 ESP M2 which you have connected with Arduino.

2. Which Arduino are you using -- UNO, NANO, MEGA, DUE?

3. Which communication line have you used to connect the two devices -- UART, SUART, I2C, or SPI? Please, post the connection diagram.

4. Have you written any codes for them? If yes, please post the codes using code tags.

Thanks for the response

  1. Post the picture of your ESP8255 ESP M2 which you have connected with Arduino.

this is the one

  1. Which Arduino are you using -- UNO, NANO, MEGA, DUE?

R/ UNO

  1. Which communication line have you used to connect the two devices -- UART, SUART, I2C, or SPI? Please, post the connection diagram.

I really don't sorry, I guess UART

I don't have a diagram but basically is,

Module | Arduino
GND GND
VCC 3.3V
RXD RX (0 digital)
TXD TX (1 digital)

In the ESP8255 ESP M2 are two pins STATE and EN but I'm not using those.

  1. Have you written any codes for them? If yes, please post the codes using code tags.

No I haven't

I have been reading this manual and with the actual configuration that I have, I can access to 192.168.4.1 but I don't really understand how to configure.

This is your module -- correct?
doitwifi.jpg

1. The UART connection should be like this:
UNO: RX --------> ESP: TXD
UNO: TX --------> ESP: RXD
UNO: GND ------> ESP: GND

2. If ESP is 5V tolerant (I think it should be as ESP8266 is 5V tolerant), Then:
UNO: 5V --------> ESP: VCC/5V.

3. I don't see any USB connector with you module -- how are you going to upload sketch in your module?

You have said that you are new in this field -- if so, start with UNO and NANO.

doitwifi.jpg

Sorry the late response, the module from the image is the one that I’m using, I connected everything as you mention, I’m using Arduino UNO, when I try to upload the code with Arduino IDE, the result shows this error

esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

What I need is to connect to a WiFi and consume a Web API to send or receive data.

I’m using this code

#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>

void setup() {

Serial.begin(115200); //Serial connection
WiFi.begin(“WIFI”, “PASSS”); //WiFi connection

while (WiFi.status() != WL_CONNECTED) { //Wait for the WiFI connection completion

delay(500);
Serial.println(“Waiting for connection”);

}

}

void loop() {

if(WiFi.status()== WL_CONNECTED){ //Check WiFi connection status

HTTPClient http; //Declare object of class HTTPClient

http.begin(“http://jsonplaceholder.typicode.com/todos/1”); //Specify request destination
http.addHeader(“Content-Type”, “text/plain”); //Specify content-type header

int httpCode = http.POST(“Message from ESP8266”); //Send the request
String payload = http.getString(); //Get the response payload

Serial.println(httpCode); //Print HTTP return code
Serial.println(payload); //Print request response payload

http.end(); //Close connection

}else{

Serial.println(“Error in WiFi connection”);

}

delay(30000); //Send a request every 30 seconds

}

Thanks,

imagenarduino.png