Hi There, Currently i'm working with ESP8266 ESP-12 Module.  Yesterday i thought of loading

Hi There,

Currently i’m working with ESP8266 ESP-12 Module.

Yesterday i thought of loading pre compiled binaries to flash to connect wifi router ( eagle.flash.bin & eagle.irom0text.bin)

i will let you know steps followed & kindly help on this…

Environment: WINDOWS VISTA, Python2.x, ESPTool

  1. i played command “esptool.py -p COM5 flash_id” … then i got “Manufacturer : C8, Device: 4016”
  2. i played command “esptool.py -p COM5 write_flash 0x00000 eagle.flash.bin 0x40000 eagle.irom0text.bin” … then i got “invalid packet exception” .
  3. i played command “esptool.py -p COM5 flash_id” … then i got below output

########################################
Connecting…
Traceback (most recent call last):
File “D:\esptool-master\esptool.py”, line 482, in
esp.connect()
File “D:\esptool-master\esptool.py”, line 158, in connect
raise Exception(‘Failed to connect’)
Exception: Failed to connect
########################################

  1. Now, i thought of using AT command to reset the ESP8266… i used many serial monitor softwares (realterm, arduino, sscomm32E, Terminal, accessport etc…)
  2. i made “AT” command … no response in return… i tried “AT+RST” command … no response in return.

Now i’m clueless … can somebody help me out by answer below questions

  1. how can i reset my device ( factory settings ) ?
  2. how to load my precompiled binary files to flash ?

Thanks in advance & have a great day.

Cheers.

What you are doing is the right process. I have tried to find what “invalid packet exception” means - I can only think that your binary is corrupt.

As you are on Windows, had you thought about using the flasher tools rather than the ‘manual’ python tool http://bbs.espressif.com/viewtopic.php?f=5&t=433

I haven’t used the ‘eagle’ binaries myself - if you want to reflash your ESP with an ‘AT’ firmware, you can get the binaries from the /bin’ directory inside the latest sdk: http://bbs.espressif.com/viewtopic.php?f=5&t=591

The process for flashing is explained in detail in the /bin folder.

If you want to try the NodeMCU binaries, you can get them here: https://github.com/nodemcu/nodemcu-firmware/releases/tag/0.9.6-dev_20150406

Thanks @Mike_Thornbury ​.

How do I can get “flash_id” as before?

I will use flasher tools ( suggested by you ) once everything is OK.

now I can’t play “AT commands”… Do you think … Something wrong in my module ?

As I’m newbie to esp8266, kindly accept my apologies to ask these questions.

Thanks in advance.

You don’t need the flash ID. I didn’t know there was such a thing and I have flashed about fifty or so times.

If you have done a successful flash of a portion of your firmware, it will now be corrupt - you need to flash all components together for a successful flashing, so that’s probably why you aren’t getting any AT commands to work.

I don’t think there’s anything wrong with your module. It just doesn’t have complete firmware. Download the latest sdk from espressif from the link above, get the flasher tool and follow the instructions in the /bin folder and you should be fine.

The other very handy piece of software is ESPlorer : http://esp8266.ru/esplorer/

If you use NodeMCU or microPython (https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/flash-firmware) you will find ESPlorer invaluable for programming.

This is a good resource for different firmwares :http://www.electrodragon.com/w/Category:ESP8266_firmware

Don’t apologise for asking questions, that’s how we all learn. Let me know how you get on.

Hi @Mike_Thornbury .

Thanks for quick reply. i tried to “ESP8266 Flash Downloader” to reflash the “v0.9.2.2 AT Firmware.bin”… i got below log

"
connecting …
Erasing flash…
Invalid head of packet

"

Also, i tried with ESP FLASH DOWNLOAD TOOL…got below log

###################################

init finished
_COM: 6
ESP_ROM_BAUD : 115200
test baudrate: 115200
test baudrate selection: 0
spi auto set : 0
1 kill
D:\iotsoftware\esp_iot_sdk_v1.1.2\bin\boot_v1.4(b1).bin
2 kill
D:\iotsoftware\esp_iot_sdk_v1.1.2\bin\user1.bin
3 kill
D:\iotsoftware\esp_iot_sdk_v1.1.2\bin\esp_init_data_default.bin
4 kill
D:\iotsoftware\esp_iot_sdk_v1.1.2\bin\blank.bin
5 kill
test cp intop : 5
(True, [])
test running : False
serial port opened
Connecting…
chip sync error.
com closed
test cp intop : 5
(True, [])
test running : False
serial port opened
Connecting…
chip sync error.
com closed

########################################

Could you pls help me on this ?

Thanks in advance.

How are you connecting to the ESP? What model of ESP is it? What OS are you running?

@Mike_Thornbury ​​ I’m connecting ESP via PCB ( USB To UART via CP2102 - 3.3v converter). Currently I’m working on windows machine…

It is ESP8266 ESP12.

Can you send me a link to the actual PCB device you are using? I am wondering if you are getting enough voltage. I had all sorts of problems with programming using an FTDI USB serial unit until I put it on a breadboard and added external power.

I use ESP-12’s all the time (new ESP-12E, actually) and they work fine using that method.

OK - after doing some reading…

Invalid head of packet occurs when the flash chip times out - this happens because of a number of factors:

Faulty flash chip on the ESP
Faulty serial USB device
Bad timing/faulty PC

So… there are a couple of things to look at.

You have the latest version of esptool and the flash downloader, so we can rule them out (they both have improved timing code for this reason).

Do you have access to another USB TTL device you can try?

Is your PC in generally good order - without a whole lot of concurrent running tasks?

@Mike_Thornbury

you can see the PCB here

Also, my PC is in good condition… http://support.hp.com/in-en/document/c01989776

let me try with another USB TTL … by the way, i use to get the ESP8266 model & manufacturer details with same… (esptool.py -p COM5 flash_id)

Did you make the circuit yourself?

Has it ever worked?

Just for reference, this module is absolutely rock-solid and reliable - easy to program as an Arduino: http://www.aliexpress.com/item/NodeMcu-Lua-WIFI-development-board-based-on-ESP8266-Internet-of-things/32264797795.html

It has NodeMCU flashed to it as standard, but changing that takes only a minute.

So how are you getting on @Krishna_Rao_Veeramac ?

@Mike_Thornbury ​ … After your inputs… I tried different USB cable… Then no change. Finally my problem got solved with new external power source ( changed 2 AA batteries ) …later I’m loaded my pre compiled bins… Now I’m working on esptouch andriod app…

I’m really appreciate your effort Mike & thanks a lot. God bless you.

Let me come back with few more questions soon. Cheers !!

Excellent! Glad it’s working.

In case anyone else is encountering this issue… i solved mine by unplugging the external power supply and simply powering the chips (FTDI + ESP8266) using the USB port during the flash