-->
Page 1 of 2

Upload arduino sketch to ESP8266 using HC-05

PostPosted: Tue Sep 26, 2017 5:19 am
by littleoz2
Hello, I am trying to upload a sketch to the ESP8266 using the HC-05 bluetooth module.
I am using the NodeMCU ESP-12E dev board.
I am able to upload via a usb to serial cable plugged into the TX and RX lines on the board by manually holding down the flash button during upload.
I have tried this exact method using the HC-05 but it's not working, below is the output from the upload in the Arduino IDE:
Code: Select allesptool 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 COM9
   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
   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
   read 0, requested 1
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
   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
   read 0, requested 1
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
   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
   read 0, requested 1
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

Re: Upload arduino sketch to ESP8266 using HC-05

PostPosted: Tue Sep 26, 2017 4:50 pm
by QuickFix
A NodeMCU uses the DTR and RTS-lines of an RS232 interface to reset the ESP and put it into flash mode.
Does the HC-05 actually (transparently) forward these lines?

Image

Maybe you might want to consider OTA programming instead?

Re: Upload arduino sketch to ESP8266 using HC-05

PostPosted: Wed Sep 27, 2017 1:56 am
by littleoz2
The HC-05 doesn't have DTR or RST lines but I am manually holding down the RST and FLASH buttons on the NodeMCU and then releasing the RST button and keep the FLASH button held down for the whole upload process.

I have tested this using a USB to Serial adapter without a DTR line and only had the RX, TX and GND pins connected and this worked fine with me manually pressing the buttons, so thought the HC-05 would work in the same way.

Thank you for your help

Re: Upload arduino sketch to ESP8266 using HC-05

PostPosted: Wed Sep 27, 2017 5:08 am
by littleoz2
Sorry for the double post, don't know how to delete