[SOLVED] Resolved: Error: espcomm_upload_mem failed

Compiled without error:

#include "ESP8266WiFi.h"
#include "UbidotsMicroESP8266.h"
#define TOKEN  "YdtbEvgKnwVssEDK2wzMqmnGjuOnxU"  // Put here your Ubidots TOKEN
#define WIFISSID "Untrusted-Network"
#define PASSWORD "12345"

Ubidots client(TOKEN);

void setup(){
    Serial.begin(9600);
    delay(10);
    client.wifiConnection(WIFISSID, PASSWORD);
}
void loop(){
    float value = analogRead(A0);
    client.add("Temperature", value);
    client.sendAll(true);
}

But while uploading to NodeMcu Lua ESP8266 CH340G ESP-12E

Uploading 237408 bytes from C:\Users\flash_os\AppData\Local\Temp\build8017001818300400212.tmp/sketch_jul29b.cpp.bin to flash at 0x00000000
error: failed sending 1072 bytes
...
.error: failed sending 1072 bytes
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
error: espcomm_upload_mem failed

Code taken from:
http://ubidots.com/docs/devices/nodeMCU.html#send-one-value-to-ubidots

Followed by instruction:
http://ubidots.com/docs/devices/nodeMCU.html#setup

Resolved:

Arduino IDE 1.6.5
Tools -> Board: NodeMCU 0.9 (ESP 12 Module)

And

Tools -> Upload Speed: 115200

1 Like

Hello @flash_os

We are glad to read that you have solved the problem.

Catalina M.

That don’t works

Dear @Crxzy,

Please, let us know your inconvenience so we can do the best to help you! :slight_smile:

Regards,
Maria C.

Same error occurred for me. I wrongly selected port then selected a correct port got worked.

when you upload your code than, press flash button