logo elektroda
logo elektroda
X
logo elektroda

[Solved] VS Code + PlatformIO: ESP-01S Upload Fails - Timed Out Waiting for Packet Header

Interval 2184 30
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20790596
    Interval
    Level 32  
    I have written a simple program to blink the LED. The program has compiled, when I press Upload it doesn't want to connect to the ESP

    "Auto-detected: COM3
    Uploading .piobuild.bin
    esptool.py v3.0
    Serial port COM3
    Connecting........_____....._____....._____....._____....._____....._____...............__________

    A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
    *** [upload] Error 2"
  • ADVERTISEMENT
  • #2 20791321
    Anonymous
    Level 1  
  • #3 20791574
    Interval
    Level 32  
    I am using a link 1.0 esp module mounted in a socket, so it is connected correctly. When using the arduino it works. The problem occurs when I use the PlatformIO.
  • #4 20791699
    xury
    Automation specialist
    Are you sure the correct COM port number has been detected?
  • #5 20791766
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #6 20791782
    Interval
    Level 32  
    Yes, definitely valid COM port 3.

    Added after 5 [hours] 26 [minutes]:

    platform.ini :

    [env:esp01_1m]
    platform = espressif8266
    board = esp01_1m
    framework = arduino
  • ADVERTISEMENT
  • #7 20792207
    Anonymous
    Level 1  
  • #8 20795150
    Interval
    Level 32  
    After modification to form:

    [env:esp01_1m]
    platform = espressif8266
    board = esp01_1m
    framework = arduino
    upload_speed = 115200
    monitor_speed = 115200
    monitor_dtr = 0
    monitor_rts = 0

    still message:

    Looking for upload port...
    Using manually specified: COM3
    Uploading .. pio\n_1mfirmware.bin
    esptool.py v3.0
    Serial port COM3
    Connecting........_____....._____.........._____.........._____.........._____....._____.........._____

    A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
    *** [upload] Error 2.
  • #9 20795191
    Anonymous
    Level 1  
  • #10 20795211
    Interval
    Level 32  
    COM3 settings, 115200.
  • #11 20795242
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #12 20795420
    Interval
    Level 32  
    No, I only have Platformio running.
  • #13 20795458
    Anonymous
    Level 1  
  • #14 20800306
    Interval
    Level 32  
    After changing the platform.ini, the programme was uploaded successfully, but it does not start. It does not show any errors.
  • #15 20800359
    Anonymous
    Level 1  
  • #16 20800370
    Interval
    Level 32  
    I uploaded the Blink program, the diode should blink - just like on the Arduino, it doesn't.
  • #17 20800378
    Anonymous
    Level 1  
  • #18 20800380
    Interval
    Level 32  
    Executed. It doesn't work either.
  • #19 20800390
    Anonymous
    Level 1  
  • #20 20800431
    Interval
    Level 32  
    --- Terminal on COM3 | 115200 8-N-1
    --- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
    --- More details at https://bit.ly/pio-monitor-filters
    --- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
    -␀␀␀␀{d␀d��|␀�d�|␃␄␌␌�␄d�␌c|��␃�␛�r�c�␄c��gn�$og��␄c␜p��l;lsl8�o�␐␂␌␄�␄l␌��␄␄␌c␌n�|␃�␌�␜�␄c��'n�␀l��d`␃�␛␒gn␄l`␂␇␃o{���'␄␄#l�␇lp�o�␘␃␄␄{�ܜ�␜��␂␌b␄o�|␃␄�␄c��no�␀␌␌d`␃�␛␒g'␄$`␂␇␃n{���g␌␄c��`␃␇s��g␌␄c��`␂�␃␄␄␌�␌�p�$`␂��'�␇l��␃�␛�g�s��o|�␌�d�␜{d␜c�␛␃␌�|␂{�␃l�'�␌�o�␀␌d`␃��r�d�$␓�␌␄␄��␀␀␀␀␀␀␀
  • #21 20800435
    Anonymous
    Level 1  
  • #22 20800455
    Interval
    Level 32  
    115200 in the manager also 115200
  • #23 20800469
    Anonymous
    Level 1  
  • #24 20800473
    Interval
    Level 32  
    Ok, the diode when uploading behaves like when uploading with Arduino, it blinks.

    Added after 1 [minute]:

    Serial port COM3
    Connecting....
    Chip is ESP8266EX
    Features: WiFi
    Crystal is 26MHz
    MAC: bc:dd:c2:27:cb:ca
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Compressed 265648 bytes to 195769...
    Writing at 0x00000000... (8 %)
    Writing at 0x00004000... (16 %)
    Writing at 0x00008000... (25 %)
    Writing at 0x0000c000... (33 %)
    Writing at 0x00010000... (41 %)
    Writing at 0x00014000... (50 %)
    Writing at 0x00018000... (58 %)
    Writing at 0x0001c000... (66 %)
    Writing at 0x00020000... (75 %)
    Writing at 0x00024000... (83 %)
    Writing at 0x00028000... (91 %)
    Writing at 0x0002c000... (100 %)
    Wrote 265648 bytes (195769 compressed) at 0x00000000 in 17.1 seconds (effective 124.1 kbit/s)...
    Hash of data verified...

    Leaving...
    Hard resetting via RTS pin...
    =========================================================== [SUCCESS] Took 27.44 seconds ===========================================================
    * Terminal will be reused by tasks, press any key to close it.
  • #25 20800489
    Anonymous
    Level 1  
  • #26 20800496
    Interval
    Level 32  
    #include // include file Arduino.h

    int pin = LED_BUILTIN; // GPIO number for LED

    void setup() {
    pinMode(pin, OUTPUT); // set GPIO as output
    }

    void loop() {
    digitalWrite(pin, HIGH); // turn on LED with high state
    delay(1000); // wait 1 second
    digitalWrite(pin, LOW); // turn off LED with low state
    delay(1000); // wait 1 second
    }
  • #27 20800538
    Anonymous
    Level 1  
  • #28 20800540
    Interval
    Level 32  
    Generic ESP8266 Module
  • Helpful post
    #29 20800592
    Anonymous
    Level 1  
  • #30 20800674
    Interval
    Level 32  
    Ok, I defined the "pin" as 2 and it works. Thank you very much for your time and help.

Topic summary

The discussion revolves around an issue with uploading a simple LED blink program to an ESP-01S module using VS Code and PlatformIO, where the user encounters a "Timed out waiting for packet header" error. Initial troubleshooting steps included verifying the USB converter connection, ensuring the correct COM port (COM3) was selected, and examining the platform.ini configuration. Modifications to the platform.ini file, including adjusting upload and monitor speeds, were suggested. After several attempts, the user successfully uploaded the program but reported that the LED did not blink as expected. Further investigation revealed that defining the LED pin explicitly in the code resolved the issue, allowing the program to function correctly.
Summary generated by the language model.
ADVERTISEMENT