EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: Thane of Cawdor on July 08, 2017, 07:45:13 am

Title: ESP8266 Programming Circuit
Post by: Thane of Cawdor on July 08, 2017, 07:45:13 am
Hi everyone!

I'm having some difficulty uploading an Arduino sketch to the ESP12-E module using a standard Sparkfun FTDI USB-serial converter (getting a espcomm_upload_mem failed error). Are there any particular issues with the circuit I'm using to reset/program the ESP8266 (from the NodeMCU schematic https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH.png (https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH.png)

Thank you :)
Title: Re: ESP8266 Programming Circuit
Post by: JoeO on July 08, 2017, 02:48:55 pm
Sparkfun has a list of things to check.  Did you do these?

https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/discuss
Title: Re: ESP8266 Programming Circuit
Post by: kripton2035 on July 08, 2017, 03:28:06 pm
RX on the esp must go to TX on the serial-usb-converter
TX go to RX
Title: Re: ESP8266 Programming Circuit
Post by: TJ232 on July 08, 2017, 05:35:35 pm
For ESP8266 programming, might worth to look also at this USB Programming adapter:
USBProgv8.4 (http://esp8266-projects.org/2017/05/esp8266-usb-programmer-usbprog-htm/)
Title: Re: ESP8266 Programming Circuit
Post by: Nusa on July 08, 2017, 06:02:39 pm
If you're using USB for power, try an external supply instead. I've had problems with USB ports supplying enough current for the eeprom write operation to succeed on the esp8266.
Title: Re: ESP8266 Programming Circuit
Post by: kripton2035 on July 08, 2017, 06:25:50 pm
For ESP8266 programming, might worth to look also at this USB Programming adapter:
USBProgv8.4 (http://esp8266-projects.org/2017/05/esp8266-usb-programmer-usbprog-htm/)
you can also program the esp8266 OTA (over the air) that is program it remotely with wifi.
complete isolation guaranteed !
Title: Re: ESP8266 Programming Circuit
Post by: TJ232 on July 08, 2017, 06:49:26 pm
For ESP8266 programming, might worth to look also at this USB Programming adapter:
USBProgv8.4 (http://esp8266-projects.org/2017/05/esp8266-usb-programmer-usbprog-htm/)
you can also program the esp8266 OTA (over the air) that is program it remotely with wifi.
complete isolation guaranteed !

Absolutely, OTA Programming is the best IF you are allowed to use OTA.


Title: Re: ESP8266 Programming Circuit
Post by: Thane of Cawdor on July 10, 2017, 02:51:43 pm
Thanks for the responses! Yes, I have made sure that TX/RX are connected the right way around, am using an external power source and did look through the setup guide but still having some issues (which curiously is quite intermittent if I click on the reset button about 2-3 times a second and manage to get the reset timing just right  :-DD - although this defeats the purpose of the digital reset line I guess).

I just wanted to make sure there are no specific issues with the circuit I'm currently using before I purchase any new devices.

Will have a look into OTA - any particular things I should be looking out for here?

Title: Re: ESP8266 Programming Circuit
Post by: kripton2035 on July 10, 2017, 03:21:19 pm
to program the chip OTA, you first have to download a program in it with the serial link.... then only it will be OTA
so we are at the same point !

take a look at the OTA examples of the arduino IDE.


edit: video about OTA
https://www.youtube.com/watch?v=GR2ZXyPaqMo (https://www.youtube.com/watch?v=GR2ZXyPaqMo)
Title: Re: ESP8266 Programming Circuit
Post by: tablatronix on July 12, 2017, 04:50:18 pm
You did not mention how you are trying to upload.. arduino IDE, esptool ? what flags baud rates? Or log output besides  espcomm_upload_mem
Title: Re: ESP8266 Programming Circuit
Post by: JoeO on July 12, 2017, 09:17:31 pm
Good in focus pictures of your hardware would help alot.
Title: Re: ESP8266 Programming Circuit
Post by: tablatronix on July 13, 2017, 02:40:44 pm
I would do what others mentioned.

Good clean power, no breadboards etc.

Use manual reset mode, not auto until you know the board works and communication works, first thing first.

Use 9600 baud for testing.

Use esptool and see if you can talk to the board, a simple flash check or erase etc. or something else that has verbose output

Loopback test your ftdi adapter via a terminal or putty, make sure it works.

Title: Re: ESP8266 Programming Circuit
Post by: free_electron on July 13, 2017, 03:05:24 pm
power supply is key.
i had trouble with some esp8266 boards as well. slapping 470uf on the power rail solved that.

a usb connector is NOT a reliable power source !
Title: Re: ESP8266 Programming Circuit
Post by: JoeO on July 13, 2017, 08:16:53 pm
Pictures.