[ESP8266] Randomly appearing esptool error on IDE 1.1.2 and CLI 2.8.6

I’m getting the vast majority of the time the following error when uploading:

warning: espcomm_send_command: wrong direction/command: 0x01 0x07, expected 0x01 0x08
warning: espcomm_sync failed

This doesn’t happen with the Arduino IDE.

Is this my fault? Or is PlatformIO related?

Do you use an automatic reset method for esptool (e.g. ck with RTS connected to RESET and DTR to GPIO0)?

I had the same issue sporadically, I suspect some EMC problems here. With the RTS/DTR wires removed and manual reset, everything works fine for me.

Yes, I’m using a nodemcu.

I had these issue too sometime. Also using nodemcu or similar boards.
As this got annoying and because its also much faster I’m flashing OTA (using ArduinoOTA) now and use serial connection only when I brick the OTA code.

Sure this is only a workaround but it’s working great and OTA is nice to have anyway.

Could someone explain how reproduce this issue or even how to resolve? :blush:

Problem is, that it sometimes appears and sometimes not. Maybe it’s even a hardware issue - at least once it did appear continuously with one nodemcu board, but not with an other.

But at the end it looked more like a problem with the esptool to me then with PlatformIO. I’ll try to reproduces this later this week.

This problem shows randomly, hence, is difficult to debug it. It only happens me with PlatformIO and NodeMCU. Maybe the esptool in the bundle is not the latest version?