I have an error when I send through ESP8266, of the integer value with the name number, my code is as follows:
#include <ESP8266WiFi.h> // Use this for WiFi instead of Ethernet.h
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
// WiFi card example
**a conexão á minha rede funciona **
char ssid[] = "xxxxxxxxxxxx"; // your SSID
char pass[] = "xxxxxxxxxxxx"; // your SSID Password
IPAddress server_addr(192,168,43,175); // IP of the MySQL *server* here
char user[] = "root"; // MySQL user login username
char password[] = "admin"; // MySQL user login password
int numero = 10;
// Sample query
char INSERT_SQL[] = "INSERT INTO MQTT.TESTES (numero) VALUES (%d)";
WiFiClient client; // Use this for WiFi instead of EthernetClient
MySQL_Connection conn(&client);
MySQL_Cursor* cursor;
void setup()
{
Serial.begin(115200);
// Begin WiFi section
Serial.printf("\nConnecting to %s", ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// print out info about the connection:
Serial.println("\nConnected to network");
Serial.print("My IP address is: ");
Serial.println(WiFi.localIP());
Serial.println("Connecting to SQL... ");
if (conn.connect(server_addr, 3306, user, password))
Serial.println("OK.");
else
Serial.println("FAILED.");
// create MySQL cursor object
cursor = new MySQL_Cursor(&conn);
}
void loop()
{
if (conn.connected())
cursor->execute(INSERT_SQL);
delay(5000);
}
The error I get is as follows when I run the code on ESP8266:
I do not know where I'm going wrong, I've already done research and it only appears that way.