Hello, Recently I bough a ESP8266 ESP-12-Q and I would Like to connect it to Arduino UNO, so that I can control sensors from the internet.
This one:
And Im using the code below, which I got from here: #36
#include <ESP8266.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); // uno sw RX(pin3) --> wifi TX, uno sw TX(pin2) --> wifi RX
ESP8266 wifi(mySerial);
void setup() {
Serial.begin(9600);
mySerial.begin(115200);
setupESP8266();
}
void loop (){
}
void setupESP8266()
{
while (1) {
Serial.print("restaring wifi...");
if (wifi.restart()) {
Serial.print("ok\r\n");
break;
}
else {
Serial.print("not ok...\r\n");
Serial.print("Trying to kick...");
while (1) {
if (wifi.kick()) {
Serial.print("ok\r\n");
break;
}
else {
Serial.print("not ok... Wait 5 sec and retry...\r\n");
delay(5000);
}
}
}
}
Serial.print("setup begin\r\n");
Serial.print("FW Version:");
Serial.println(wifi.getVersion().c_str());
while (1) {
if (wifi.setOprToStation()) {
Serial.print("to station ok\r\n");
break;
}
else {
Serial.print("to station err\r\n");
Serial.println("Wait 5 seconds and try again...");
delay(5000);
}
}
while (1) {
if (wifi.joinAP("MYNETWORK", "PASS")) {
Serial.print("Join AP success\r\n");
break;
}
else {
Serial.print("Join AP failure\r\n");
Serial.println("Wait 5 seconds and try again...");
delay(5000);
}
}
Serial.print("setup end\r\n");
}
I connected like this:
ESP --------- External Power (3.3V 1A) ---------- UNO
Vcc 3.3V
GRD GRD
CH_PD(EN) 3.3v
TX ------------------------------------------------------ Digital 3
RX ------------------------------------------------------ Digital 2
When I open the Serial Console this is the info I get:
I tried several speeds for the software serial (9600, 19200, 115200) no worked.. always the same thing. What am I missing here?
Any tip helps! I really would like to use Wee, fits perfectly to my project but I can not get this ESP working....
Hello, Recently I bough a ESP8266 ESP-12-Q and I would Like to connect it to Arduino UNO, so that I can control sensors from the internet. This one:
And Im using the code below, which I got from here: #36
I connected like this:
ESP --------- External Power (3.3V 1A) ---------- UNO Vcc 3.3V GRD GRD CH_PD(EN) 3.3v TX ------------------------------------------------------ Digital 3 RX ------------------------------------------------------ Digital 2
When I open the Serial Console this is the info I get:
I tried several speeds for the software serial (9600, 19200, 115200) no worked.. always the same thing. What am I missing here? Any tip helps! I really would like to use Wee, fits perfectly to my project but I can not get this ESP working....
Thank you for your time!