Issue :connecting arduino uno to mysql database using esp8266 via the arduino ide sketch program.
Hardwares we are using :
Arduino uno connected to local system via cable
ESP8266 wifi module connected to arduino uno as per the attached diagram.
Software:
Arduino ide 1.8.7 sketch program
mysql 8.0
our objective is to insert the data from arduino uno sensor data into local mysql database .
arduino ide board we are using is "generic esp8266 module".
We are using following code for inserting the data into database:
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
#include <MySQL_Encrypt_Sha1.h>
#include <MySQL_Packet.h>
#include <mysql.h>
char *host, *user, *pass, *db;
void setup()
{
Serial.begin(9600);
host = "localhost";
user = "root";
pass = "sriram135$";
db = "arduino";
if(is_mysql(host,user,pass,db)){
Serial.print("Connected to ");
Serial.println(host);
// int y=is_mysql();
char INSERT_SQL = "INSERT INTO arduino_table(weight) VALUES('0001')";
//int result = mysql_query("INSERT INTO arduino_table(weight) VALUES('0001')");
if(INSERT_SQL){
Serial.println("Query exexcuted.");
}else{
Serial.println("Query exexcution failed.");
}
}else{
Serial.println("Connection failed.");
}
}
void loop(){}
.............................................................................
We are getting following error for the following when arduino ide while uploading:
Arduino: 1.8.7 (Windows 8.1), Board: "Generic ESP8266 Module, 80 MHz, Flash, ck, 26 MHz, 40MHz, QIO, 512K (no SPIFFS), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Sketch uses 247964 bytes (49%) of program storage space. Maximum is 499696 bytes.
Global variables use 28044 bytes (34%) of dynamic memory, leaving 53876 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
kindly help...


