Error espcomm_sync failed - also on new cards

Hi

Google is full of answers to solve this problem,I have tried some of them. My case is that it happens all the time.

I have changed cable, I have changed upload baud rate. Nothing helps.....

I have 2 brand new WeMos D1 mini Node MCU WIFI

I uploaded BLINK code to both of them:
Test 1 perfect, all did work

Test 2 both give error.

espcomm_sync failed

I used board type Node MCU 0.9 (ESP12 Module), also tried version 1.0

The code I try to upload now is:



/* TO test 1/8-22 ESP8266 Node MCU WIFI 12F DOITING
 *  TO Test 29.7.22 on board TTGO LoRa32-Oled V2.1 (1.6.1)
  DHT20: (colours of soldered wires
  VCC  Yellow  -> 5V
  SDA Black    -> D2  I2C bus
  GND Green    -> GND
  SCL Red      -> D1  I2C bus
  I2C port 0x38 (Dont know if adressing is nessesary due to code working.
*/

//
//  FILE: DHT20 test xyz
//  AUTHOR: Rob Tillaart
// PURPOSE: Demo for DHT20 I2C humidity & temperature sensor
//


#include <DHT20.h>

DHT20 DHT;


void setup()
{
  DHT.begin();

  Wire.setClock(400000);

  Serial.begin(115200);
  Serial.println(__FILE__);
  Serial.print("DHT20 LIBRARY VERSION: ");
  Serial.println(DHT20_LIB_VERSION);
  Serial.println();

  delay(2000);

  Serial.println("Type,\tStatus,\tHumidity (%),\tTemperature (C)");
}


void loop()
{
  if (millis() - DHT.lastRead() >= 1000)
  {
    // READ DATA
    uint32_t start = micros();
    int status = DHT.read();
    uint32_t stop = micros();
    switch (status)
    {
      case DHT20_OK:
        Serial.print("OK,\t");
        break;
      case DHT20_ERROR_CHECKSUM:
        Serial.print("Checksum error,\t");
        break;
      case DHT20_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
      case DHT20_MISSING_BYTES:
        Serial.print("Missing bytes,\t");
        break;
      default:
        Serial.print("Unknown error,\t");
        break;
    }
    // DISPLAY DATA, sensor has only one decimal.
    Serial.print("DHT20, \t");
    Serial.print(DHT.getHumidity(), 1);
    Serial.print(",\t");
    Serial.print(DHT.getTemperature(), 1);
    //Serial.print(",\t");
    //Serial.print(start - stop);
    Serial.print("\n");
  }
}


// -- END OF FILE --

This is usually true, but it can also be true that the answers are always the same, I have been in contact with computer programming since the year 2001.

I've suffered a lot in search of solutions, and many of them take a long time to be found, I don't know how the search engine works, but I believe they show the most popular ones first, so while the programmer has not exhausted the search options, there is still a possibility that there is a solution to follow.

I also tend to search in tutorial videos, and others that are related to the functionality, many videos have tips of a few seconds, which are the solution, and it may happen that this tip is not in text form, so any search engine will be difficult list this option.

Don't give up on search engines so easily! Good luck!

Sometimes the ESP8266 and ESP32 (and maybe other similar models) have problems starting data transfers to upload the sketch (or to write the microcontroller memory), usually in ESP it is something related to the reset line.

Check if your boards need any hardware modification so the serial port can reset. Some versions support manual reset, holding down the BOOT button, then pressing the RESET button causes the ESP to enter programming mode.

But be aware that the ESP pins are not free for any kind of use, some pins have to be in a high initial state and others may have to be in a low logic level.

Thanks for info.

But today, like WAF!!!!, both boards enter upload, I did not do anything... pressed compile + upload. Same computer, same com port, same cable.....

So then the answer is; sleep on it, next day it will work..... :expressionless:

If I remember correctly, on the TV series called The It Crowd, they always ask: Did you reset the equipment? :sweat_smile:

:grin::laughing::sweat_smile::rofl::joy:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.