Esp8266 ESP-01 simple sketch fails to upload

Hi there,
I’m having troubles with my setup:
I am using an ESP8266 ESP-01 module with USB2Serial CH340G based adapter (see below).

and when I try to upload my sketch (which is the Blynk ESP8266_Standalone Example):

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "YourAuthToken";
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

I get :

Archiving built core (caching) in: C:\Users\Edo\AppData\Local\Temp\arduino_cache_917070\core\core_esp8266_esp8266_generic_CpuFrequency_80,ResetMethod_ck,CrystalFreq_26,FlashFreq_40,FlashMode_qio,FlashSize_512K0,LwIPVariant_v2mss536,Debug_Disabled,DebugLevel_None____,UploadSpeed_115200_b20259ed95f75f6e0df9a48570ab40ee.a
Sketch uses 264771 bytes (52%) of program storage space. Maximum is 499696 bytes.
Global variables use 35476 bytes (43%) of dynamic memory, leaving 46444 bytes for local variables. Maximum is 81920 bytes.
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
error: failed reading byte
warning: espcomm_send_command: can't receive slip payload data
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

The configuration is:
OS: Windows 10 ON VIRTUAL MACHINE
Board: Generic ESP8266 Module
Flash Mode: QIO
Flash Size: 512K (no SPIFFS)
Debug port: Disabled
Debug level: None
IwIP Variant: v2
Reset Method: ck
Crystal Frequency: 26MHz
Flash Frequency: 40MHz
CPU Frequency: 80MHz
Upload speed: 115200

And I installed the:

  • ESP8266 Board from the Board Manager
  • Blynk library from Library Manager

AT COMMANDS ARE FULLY WORKING.

I seriously don’t know how to fix this.
Thanks in advance.

The Blue LED on ESP responds somehow, when You try to upload?

Yes of course:
When the Arduino IDE finishes compiling (so it starts to upload), the blue led blinks EIGHT TIMES (~1Hz blinking)
before the first error: failed reading byte comes out on the debug output monitor.

I think that LED blinking coincides with error: failed reading byte outputs number.

I’ve seen a thread somewhere on here where a person was having a problem with those USB programmer boards.
Do you have a regular FTDI programmer that you could use instead?

Also, is QIO the correct programming mode?

Pete.

Then it might be, this board is unable to switch ESP into FLASH mode…

No I don’t… I bought this on eBay (actually two of them, to make sure that - at least - one of them worked) for a really cheap price 2€/piece.
Should I buy a FTDI Board instead?

How do I check the correct programming mode by the way?

You mean to switch the CH_PD “mode”?

No, CH_PD is a “Switch ON” of the ESP. IF Blue light flashes, and IF AT comm is working, then IT IS pulled low properly. What I mean, is pulling the GPIO0 LOW, AND apply RESET.

And CH340 works with ESP (as - I think - every other USB-UART converter). The problem might be it’s wiring (the companion board)

And this is, what I have found: http://www.arjunsk.com/iot/programming-esp8266-esp-01-using-esp8266-programmer-ch340g-chip-adapter/

1 Like

The solution you linked and described might be the right one.
I’ll reply later telling you if it works.

I’m almost sure it is :wink:
In the meantime you should change the flag from issues and errors to problem with my project. Or @Gunner will certainly do it for you :smile:

1 Like

This is the thread I was thinking of:

Pete.

1 Like

AND THAT’S A YES!
You saved my day and now I will be able to do the thesis of maturity!
:star_struck:

Thank you so much.