Thanks for the help swilson ... I did what you told me, and I returned to load the firmware, and could change the baudrate of esp8266 to 57600...pero now I emerged a new problem, as he had already said, I am in a small project consisting to send data from arduino (one) to a local database (mysql-xampp) through esp8266 ... at first i was just sending data from the keyboard to esp8266 and this sent him to the database (had no problem with that) ... what happens now is that I can not communicate with the arduino esp8266 through SoftwareSerial library, I think there is a problem with my code or am I ignoring some way ... I attached the code arduino and esp8266 (for the module I'm using your library)
Code: Select all//This one code to arduino
#include <SoftwareSerial.h>
SoftwareSerial esp8266(2,3);
char mensaje;
int cont=0;
void setup(){
pinMode(8,INPUT);
Serial.begin(9600);
esp8266.begin(9600);
}
void loop()
{
while(Serial.available()>0)
{
mensaje=Serial.read();
}
if(mensaje=='1')
{
if(digitalRead(8)==HIGH)
{
cont++;
Serial.println(cont);
delay(250);
}
}
else{
if(mensaje=='0')
{
esp8266.println(cont);
cont=0;
mensaje='1';
}
}
}
this one code to ESP8266
Code: Select all#include <ESP8266WiFi.h>
const char* ssid = "SSID";
const char* password = "PASSWORD";
const char* host = "10.0.0.10";//ip local of my pc
int date=0;
void setup() {
Serial.begin(9600);//
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
delay(5000);
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
while(Serial.available()>0)
{
dato=Serial.read();
//Serial.println(date);
// This will send the request to the server
client.print("GET /Project/save.php?value=");
client.print(date);
client.println("HTTP/1.1");
}
}
any help is welcome