I can't upload my code. i use esp-01 wifi module, and esp-01 wifi adapter.
using adpater, gnd - gnd vcc - 5v, rx - 6, tx -7.
there is my debugging comment.
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 54 instead of C0
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Failed uploading: uploading error: exit status 0xffffffff
and there is my code.
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
SoftwareSerial espSerial(6, 7); // RX, TX
const char* ssid = "myWIFI";
const char* password = "PASSWORD";
const char* serverAddress = "http://ip_address/info"; // server
void setup() {
Serial.begin(115200);
espSerial.begin(115200);
espSerial.println("AT");
delay(1000);
if (espSerial.find("OK")) {
Serial.println("ESP8266 is ready");
} else {
Serial.println("ESP8266 not responding");
while (1);
}
espSerial.println("AT+CWJAP=\"" + String(ssid) + "\",\"" + String(password) + "\"");
delay(5000);
if (espSerial.find("OK")) {
Serial.println("Connected to WiFi");
} else {
Serial.println("Failed to connect to WiFi");
while (1);
}
HTTPClient http;
http.begin(serverAddress);
int httpCode = http.GET();
if (httpCode > 0) {
String payload = http.getString();
Serial.println("Server response:");
Serial.println(payload);
} else {
Serial.print("Error on HTTP request. HTTP error code: ");
Serial.println(httpCode);
}
http.end();
}
void loop() {
}