Skip to main content
Improved formatting
Source Link
MatsK
  • 1.4k
  • 1
  • 11
  • 25

i I can't upload codes to my esp8266ESP8266

This is the error it gives ,this is the error iI encounter when i try to upload my codeemphasized text

#include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h>

#ifndef STASSID #define STASSID "your-ssid" #define STAPSK "your-password" #endif

const char* ssid = STASSID; const char* password = STAPSK;

const char* host = "192.168.1.1"; const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() { Serial.begin(115200);

// We start by connecting to a WiFi network WiFi.mode(WIFI_STA); WiFiMulti.addAP(ssid, password);

Serial.println(); Serial.println(); Serial.print("Wait for WiFi... ");

while (WiFiMulti.run() != WL_CONNECTED) { Serial.print("."); delay(500); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP());

delay(500); }

void loop() { Serial.print("connecting to "); Serial.print(host); Serial.print(':'); Serial.println(port);

// Use WiFiClient class to create TCP connections WiFiClient client;

if (!client.connect(host, port)) { Serial.println("connection failed"); Serial.println("wait 5 sec..."); delay(5000); return; }

// This will send the request to the server client.println("hello from ESP8266");

//read back one line from server Serial.println("receiving from remote server"); String line = client.readStringUntil('\r'); Serial.println(line);

Serial.println("closing connection"); client.stop();

Serial.println("wait 5 sec..."); delay(5000); }

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK  "your-password"
#endif

const char* ssid     = STASSID;
const char* password = STAPSK;

const char* host = "192.168.1.1";
const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() {
  Serial.begin(115200);

  // We start by connecting to a WiFi network
  WiFi.mode(WIFI_STA);
  WiFiMulti.addAP(ssid, password);

  Serial.println();
  Serial.println();
  Serial.print("Wait for WiFi... ");

  while (WiFiMulti.run() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  delay(500);
}


void loop() {
  Serial.print("connecting to ");
  Serial.print(host);
  Serial.print(':');
  Serial.println(port);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;

  if (!client.connect(host, port)) {
    Serial.println("connection failed");
    Serial.println("wait 5 sec...");
    delay(5000);
    return;
  }

  // This will send the request to the server
  client.println("hello from ESP8266");

  //read back one line from server
  Serial.println("receiving from remote server");
  String line = client.readStringUntil('\r');
  Serial.println(line);

  Serial.println("closing connection");
  client.stop();

  Serial.println("wait 5 sec...");
  delay(5000);
}

i can't upload codes to my esp8266

This is the error it gives ,this is the error i encounter when i try to upload my codeemphasized text

#include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h>

#ifndef STASSID #define STASSID "your-ssid" #define STAPSK "your-password" #endif

const char* ssid = STASSID; const char* password = STAPSK;

const char* host = "192.168.1.1"; const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() { Serial.begin(115200);

// We start by connecting to a WiFi network WiFi.mode(WIFI_STA); WiFiMulti.addAP(ssid, password);

Serial.println(); Serial.println(); Serial.print("Wait for WiFi... ");

while (WiFiMulti.run() != WL_CONNECTED) { Serial.print("."); delay(500); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP());

delay(500); }

void loop() { Serial.print("connecting to "); Serial.print(host); Serial.print(':'); Serial.println(port);

// Use WiFiClient class to create TCP connections WiFiClient client;

if (!client.connect(host, port)) { Serial.println("connection failed"); Serial.println("wait 5 sec..."); delay(5000); return; }

// This will send the request to the server client.println("hello from ESP8266");

//read back one line from server Serial.println("receiving from remote server"); String line = client.readStringUntil('\r'); Serial.println(line);

Serial.println("closing connection"); client.stop();

Serial.println("wait 5 sec..."); delay(5000); }

I can't upload codes to my ESP8266

This is the error it gives ,this is the error I encounter when i try to upload my code

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK  "your-password"
#endif

const char* ssid     = STASSID;
const char* password = STAPSK;

const char* host = "192.168.1.1";
const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() {
  Serial.begin(115200);

  // We start by connecting to a WiFi network
  WiFi.mode(WIFI_STA);
  WiFiMulti.addAP(ssid, password);

  Serial.println();
  Serial.println();
  Serial.print("Wait for WiFi... ");

  while (WiFiMulti.run() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  delay(500);
}


void loop() {
  Serial.print("connecting to ");
  Serial.print(host);
  Serial.print(':');
  Serial.println(port);

  // Use WiFiClient class to create TCP connections
  WiFiClient client;

  if (!client.connect(host, port)) {
    Serial.println("connection failed");
    Serial.println("wait 5 sec...");
    delay(5000);
    return;
  }

  // This will send the request to the server
  client.println("hello from ESP8266");

  //read back one line from server
  Serial.println("receiving from remote server");
  String line = client.readStringUntil('\r');
  Serial.println(line);

  Serial.println("closing connection");
  client.stop();

  Serial.println("wait 5 sec...");
  delay(5000);
}
Source Link
Hope
  • 11
  • 1

i can't upload codes to my esp8266

This is the error it gives ,this is the error i encounter when i try to upload my codeemphasized text

#include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h>

#ifndef STASSID #define STASSID "your-ssid" #define STAPSK "your-password" #endif

const char* ssid = STASSID; const char* password = STAPSK;

const char* host = "192.168.1.1"; const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() { Serial.begin(115200);

// We start by connecting to a WiFi network WiFi.mode(WIFI_STA); WiFiMulti.addAP(ssid, password);

Serial.println(); Serial.println(); Serial.print("Wait for WiFi... ");

while (WiFiMulti.run() != WL_CONNECTED) { Serial.print("."); delay(500); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP());

delay(500); }

void loop() { Serial.print("connecting to "); Serial.print(host); Serial.print(':'); Serial.println(port);

// Use WiFiClient class to create TCP connections WiFiClient client;

if (!client.connect(host, port)) { Serial.println("connection failed"); Serial.println("wait 5 sec..."); delay(5000); return; }

// This will send the request to the server client.println("hello from ESP8266");

//read back one line from server Serial.println("receiving from remote server"); String line = client.readStringUntil('\r'); Serial.println(line);

Serial.println("closing connection"); client.stop();

Serial.println("wait 5 sec..."); delay(5000); }