0

Here is my sketch:

#include<ESP8266WiFi.h>

char* ssid = "xxxxxxxx";
char* pass = "xxxxxxx";

void setup() {
 WiFi.begin(ssid,pass);
 Serial.begin(9600);
 while(WiFi.status()!=WL_CONNECTED)
 {
  Serial.print(".");
  delay(500);
  }
  Serial.println("");
  Serial.print("IP Address: ");
  Serial.print(WiFi.localIP());
}

Here is the error:

Traceback (most recent call last):   File "C:\Users\ASUS\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py", line 25, in <module>
    esptool.main(fakeargs)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 2653, in main
    esp.connect(args.before)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 460, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 440, in _connect_attempt
    self.sync()   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 379, in sync
    timeout=SYNC_TIMEOUT)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 322, in command
    self.write(pkt)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 285, in write
    self._port.write(buf)   File "C:/Users/ASUS/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/pyserial\serial\serialwin32.py", line 323, in write
    raise writeTimeoutError serial.serialutil.SerialTimeoutException: Write timeout the selected serial port
serial.serialutil.SerialTimeoutException: Write timeout  does not
exist or your board is not connected
  • 1
    does the code "verify"? – dandavis Oct 9 '19 at 16:32
  • This looks more like an error while uploading than on compilation to me. Have you selected the correct board settings? – Sim Son Oct 9 '19 at 18:35
2

The section

void loop() {
}

Is missing in the code, add it and recompile and.....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.