Hello, i plugged esp to arduino uno, following this tutorial, there is also a circuit according to which I have it connected (https://www.instructables.com/id/Get-Started-With-ESP8266-Using-AT-Commands-Via-Ard/).
so, my circuit is:
Arduino --------------------------------------------------- ESP8266
Pin 10 (Software RX) -----------------------------------> TXD
Pin 11 (Software TX) -------> Voltage Divider -----> RXD
GND --------------------------------------------------------> GND
3.3 V --------------------------------------------------------> VCC
3.3 V --------------------------------------------------------> CH_PD
AT commands works perfectly, i can connect to WiFi without any problems.
Then I try to connect to the mysql database: (ino is in the attachment)
#include <WiFiEsp.h> //use for ESP8266
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
// Emulate Serial1 on pins 2/3 if not present
#ifndef HAVE_HWSERIAL1
#include "SoftwareSerial.h"
SoftwareSerial Serial1(10, 11); // RX, TX
#endif
byte mac_addr[] = { 0x30, 0x3A, 0x64, 0xBB, 0x29, 0x0C };
//117.193.105.210
IPAddress server_addr(127,0,0,1); // IP of the MySQL server here
char user[] = "root";
char password[] = "";
// WiFi card example
char ssid[] = "Zaplat2"; // your network SSID (name)
char pass[] = "daniel12"; // your network password
//WiFiClient client; // Use this for WiFi instead of EthernetClient
WiFiEspClient client; //Use this for ESP8266
MySQL_Connection conn((Client *)&client);
void setup() {
Serial.begin(115200);
while (!Serial); // wait for serial port to connect. Needed for Leonardo only
// initialize serial for ESP module
Serial.println("Starting....");
Serial1.begin(112500);
// initialize ESP module
WiFi.init(&Serial1);
//Serial1.println("Connecting to WiFi");
// Begin WiFi section
int status = WiFi.begin(ssid, pass);
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while(true);
}
// print out info about the connection:
else {
Serial.println("Connected to network");
IPAddress ip = WiFi.localIP();
Serial.print("My IP address is: ");
Serial.println(ip);
}
// End WiFi section
Serial.println("Connecting...");
if(conn.connect(server_addr,3306,user,password)) {
delay(1000);
Serial1.println("Connected to mysql");
}
else
Serial.println("Connection failed.");
conn.close();
}
void loop() {
}
Serial monitor give me an error. Unsupported firmware. (picture is in the attachment)
OK, I try update firmware following this tutorial (Flashing Espressif and NodeMCU Firmware to ESP8266). Sync results in an error.
Strange is, that a do not have detected info, no MAC address showing. (picture is in the attachment)
30/5000
my question is, what am i doing wrong?
Thanks
esp8266mysql.ino (1.6 KB)