warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
error: espcomm_upload_mem failed
Setelah mencari referensi ke Web, akhirnya mendapat solusi.
Semoga tulisan ini dapat membantu anda jika mengalami masalah yang sama.
NodeMCU adalah suatu open source IoT platform yang memasukan firmware yag mana berjalan diatas chip ESP8266 Wi-Fi SoC.
Gambar 1. Board NodeMCU
Gambar 2. Tampilan belakang Board NodeMCU
Langkah-langkah:
1. Tancapkan Board NodeMCU diatas breadboard
Gambar 3. NodeMCU yang ditancapkan diatas breadboard
2. Install driver CP2102 (USB to Serial Converter) sesuai dengan sistem operasi yang dapat di download.
3. Catat nomor port hasil instalasi, misalnya COM4
Gambar 4. Port setelah instalasi driver USB CP2102
3. Install Arduino IDE (Sketch) yang dapat di download
4. Install esp8266 boards manager
4.a. Pada menu File, pilih Preferences
4.b. Pada Additional Board Manager URLs isikan:
4.c. Pada menu Tools, Board ..., pada sub menu pilih Boards manager.
4.d. Scroll kebawah, dan pilih esp8266 by ESP8266, dan install
Gambar 6. Setelah boards manager diinstalasi
5. Pilih board & Port yang sesuai
5.a. Pada menu Tools, Board ..., pada sub menu pilih NodeMCU 1.0 (ESP 12E module)
6.Buatlah rangkaian anda dimana kaki anoda pada pin D7, dan kaki cathoda pada GND
Gambar 8. Led pada pin D7 dan GND
void setup() {
pinMode(D7, OUTPUT);
}
void loop() {
digitalWrite(D7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(D7, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
pinMode(D7, OUTPUT);
}
void loop() {
digitalWrite(D7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(D7, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
8. Lakukan verify
Jika anda berhasil melakukan hal tersebut diatas, maka led akan blink.
10. Jika gagal
Trouble Shooting:
Pada saat upload muncul error:
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
error: espcomm_upload_mem failed
Untuk mendapatkan verbose output yang lebih spesific, dapat disetting pada menu File, Preference, dan berikan tanda check pada Show verbose output during (x) compilation (x) upload.
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
error: espcomm_upload_mem failed
Untuk mendapatkan verbose output yang lebih spesific, dapat disetting pada menu File, Preference, dan berikan tanda check pada Show verbose output during (x) compilation (x) upload.
Solusi:
Hal tersebut dapat terjadi karena board tidak berhasil masuk ke programming/flash mode, untuk memungkinkan programming/flash mode hubungkan pin D3 (GPIO 0) ke GND
Gambar 10. Pull pin D3 (GPIO 0) ke GND
Dan coba Upload ulang (contoh verbose hasil upload yang berhasil).
Sketch uses 230,113 bytes (22%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 32,368 bytes (39%) of dynamic memory, leaving 49,552 bytes for local variables. Maximum is 81,920 bytes.
C:\Users\hendra-new\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM4 -ca 0x00000 -cf C:\Users\HENDRA~1\AppData\Local\Temp\arduino_build_696037/nodeMCUhelloworld.ino.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from COM1 to COM4
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
Uploading 234256 bytes from C:\Users\HENDRA~1\AppData\Local\Temp\arduino_build_696037/nodeMCUhelloworld.ino.bin to flash at 0x00000000
erasing flash
size: 039310 address: 000000
first_sector_index: 0
total_sector_count: 58
head_sector_count: 16
adjusted_sector_count: 42
erase_size: 02a000
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting serial port timeouts to 15000 ms
setting serial port timeouts to 1000 ms
espcomm_send_command: receiving 2 bytes of data
writing flash
................................................................................ [ 34% ]
................................................................................ [ 69% ]
..................................................................... [ 100% ]
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
closing bootloader
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
Akhir silakan mencoba, dan semoga berhasil.
Sketch uses 230,113 bytes (22%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 32,368 bytes (39%) of dynamic memory, leaving 49,552 bytes for local variables. Maximum is 81,920 bytes.
C:\Users\hendra-new\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM4 -ca 0x00000 -cf C:\Users\HENDRA~1\AppData\Local\Temp\arduino_build_696037/nodeMCUhelloworld.ino.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from COM1 to COM4
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
Uploading 234256 bytes from C:\Users\HENDRA~1\AppData\Local\Temp\arduino_build_696037/nodeMCUhelloworld.ino.bin to flash at 0x00000000
erasing flash
size: 039310 address: 000000
first_sector_index: 0
total_sector_count: 58
head_sector_count: 16
adjusted_sector_count: 42
erase_size: 02a000
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting serial port timeouts to 15000 ms
setting serial port timeouts to 1000 ms
espcomm_send_command: receiving 2 bytes of data
writing flash
................................................................................ [ 34% ]
................................................................................ [ 69% ]
..................................................................... [ 100% ]
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
closing bootloader
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
Akhir silakan mencoba, dan semoga berhasil.
Salam,
Hendra.
Mkasih pak..mntaaaaap
BalasHapus