Prerequisites
- A Windows PC with Arduino IDE installed
- An Arduino Uno board
- A reliable connection between ESP-01 module and Arduino board. This procedure is based on my cheap Arduino WiFi shield with ESP-01
Wiring
First of all you have to build my cheap Arduino WiFi shield with ESP8266. This will provide a solid foundation for powering the ESP module and setup the communication to the Arduino board.
Ensure you are able to issue simple AT commands to the ESP-01 board before proceeding.
Now modify the wiring as follows.
- Remove ATmega328P chip from the Arduino board. By removing the microcontroller you can use the Arduino Uno onboard FTDI interface to directly communicate with the ESP module.
- Connect ESP' RDX pin to the RX pin of Arduino (pin 0).
- Connect ESP's TXD pin to the TX pin of Arduino (pin 1).
Test connectivity
Open the Arduino IDE, select the correct port and open the serial monitor.
You should be able to issue AT commands and get a nice output. Try 'AT' and 'AT+GMR' commands.
If you do not get any output you can try the following.
- The serial monitor baud rate must correspond to the ESP UART baud rate. Old modules have 9600, newer ones have 115200.
- Try different settings for the 'Line ending' option of the serial monitor. For my ESP module I have to set it to 'Both NL & CR' as you can see in the screenshot.
Download firmware and tools
Download the following files and extract them
- esp_iot_sdk_v1.5.0_15_11_27.zip from Espressif site (direct link).
- FLASH_DOWNLOAD_TOOLS_v2.4_150924.rar from Espressif site (direct link).
Flash it!
To put the ESP module in flashing mode you must connect ESP's GPIO0 pin to ground.- Unplug the Arduino board from the PC
- Put a jumper between GND and GPIO0 pin (see photo)
- Plug the Arduino board to the PC.
Follow these steps to flash the new firmware to the ESP-01 board.
- Close the Arduino IDE if still opened
- Launch the ESP flash download tool (ESP_DOWNLOAD_TOOL_V2.4.exe) you have previously extracted
- Apply the following settings
- Bin files (from the esp_iot_sdk extracted zip file) :
- bin\at\noboot\eagle.flash.bin - 0x00000
- bin\at\noboot\eagle.irom0text.bin - 0x40000
- bin\blank.bin - 0xfe000
- bin\blank.bin - 0x7e000
- Flash size: 8MBit
- COM port: choose your Arduino COM port
- Baud rate: 115200 or 345600 (this is not related to the ESP baud rate
Now press the START button and wait for the flashing process to complete.
Now press the STOP button and close the flashing tool.
Test connectivity and set default UART speed
Before proceeding it is better to verify that the new firmware is working fine.
- Unplug the Arduino board from the PC
- Remove the jumper between GND and GPIO0 pin
- Plug the Arduino board to the PC
Test connectivity with 'AT' and 'AT+GMR' commands. The correct settings for the ESP firmware v1.5 are:
- Speed: 115200
- Line ending: Both NL & CR
AT+UART_DEF=9600,8,1,0,0
Now set the serial monitor speed to 9600 and test again the communication.
Rebuild your ESP WiFi shield
Remove the modifications made to the ESP shield.
- Insert the ATmega328P chip back into the Arduino board
- Connect ESP' RDX pin to Arduino pin 7
- Connect ESP's TXD pin to Arduino pin 6
Compile and upload the updated sketch and you should be able to correctly interact with the ESP module.
Your ESP8266 board is now flashed with the updated firmware and ready to be used for your connected projects!
Don't forget to take a look at my WiFiEsp library for Arduino.
Perfect !! I have now ESP8266 firmware v1.5 (AT v0.51) in my ESP-01 :) and now ... to the arduin o part, I am sure my Iot venture started ... Thanks to you ;)
ReplyDelete,Hope to be lucky and you answer me ... I tried in my ESP-01 (1 year old?) but is not working.
ReplyDeleteMemory says 25Q40xxx so 512 KB. You say Flash size: 8MBit (1 MB?) how is marked the memory in your ESP-01? Is that the problem? besides my clumsiness ... :( AT+GMR puts AT 0.51 SDK 1.5.0 but I have not tried all AT commands. I like the idea of Arduino for "the things" and ESP-01 for the Internet but ....
Thanks a lot in advance
Thank you very much, this solved my problem with the ESP8266! Henning
ReplyDeleteNot working for me. Are there any other settings or tips, such as order of flashing, etc?
ReplyDeleteMy situation is really puzzling: it flashes fine, success, but will NOT respond to AT commands. And I know how to terminal to the thing, and flashing other firmware works fine. But something about espressif firmware with espressif flash tool is not working. I've tried 4Mbit as well, not that it matters, it "succeeds" to write with either 4 or 8Mbit settings.
I had the same problem, but after several tries, realized the speed on the testing console should be 115200 as this is the default of the firmware. Set the speed of the port to 115200, then apply the UART speed to 9600 as explained above, then set the speed again of the testing console to 9600 and all should work.
DeleteThis comment has been removed by the author.
ReplyDeleteAwsm...after so many try this blog help me at last.thanks alot.
ReplyDeleteGreat tutorial. Yesterday I got my ESP8266 died by wrong wiring. It was working on 74880 baud and was giving this message all the time:
ReplyDeleteets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000
Today I was looking for a sloution. After doing all your steps (I connected RESET to the GROUND instead of pulling out the ATMEGA chip) everything went perfectly smooth. Also I learned something new today, so double win.
THANKS A LOT AGAIN!
I want to update using another bin file. In step-4 of flashing firmware, where i should put my bin file?
ReplyDeletehere: 1. bin\at\noboot\eagle.flash.bin or where?
Thanks you very much for this post! It's works fine!
ReplyDeleteI know that my several ESP8266 01 had this versions:
ReplyDeleteAT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
I only want to reflash it like it was before.
I need to know:
The version of the flash tool I should use. V3.4.4 is ok?
The files, for example: blank.bin; eagle.flash.bin; irom0text.bin (I need more?) with the address, or where I can see it for this version?!
Any sugestion is welcome!
Thank you a lot!
I find it!
DeleteThanks for the good information you have in your blog.
http://bbs.espressif.com/viewtopic.php?f=46&t=2199
Thank you so much. It worked out finally after 3 hrs of struggle. I'm able use AT commands again now. Thank you :)
ReplyDeleteHow did you solve the AT commands?
Deletecan you help me i have this error when i upload my code:
ReplyDeletewarning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
Thanks
just reset and try to upload again
DeleteReally I love you man... You test gonna save my semester!
ReplyDeleteThanks!
I once turned a blind eye to a tutorial on Flashing ESP8266 firmware v1.5 using Arduino Uno, only to realize that it was very important. I didn't realize it until i was in need to do so, but then the information was nowhere to be found. Finding this post is a great achievement. Quality Literature Review Chapter Writing Help have been of great help to many people, and to be among them you only need to check the link provided.
ReplyDeleteHi
ReplyDeleteI'm lost, my esp8266 was with a newer version but as it was not working with your librairies, I have flashed it...
now when I do "AT+GMR"
I have exactly the same as your first picture
AT version : 0.51...
SDK version : 1.5
but now when i do the basic test
[WiFiEsp] Initializing ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Cannot initialize ESP module
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
********************************************** Firmware version > FAILED (actual="", expected="1.5.2")
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
********************************************** Status is (WL_DISCONNECTED) > FAILED (actual=255, expected=3)
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Failed connecting to boxLnJl
********************************************** Connect > FAILED (actual=2, expected=1)
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
********************************************** Check status (WL_CONNECTED) > FAILED (actual=255, expected=1)
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
********************************************** Check SSID > FAILED (actual="", expected="boxLnJl")
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
********************************************** Check IP Address > FAILED (actual=0, expected=0)
IP Address: 0.0.0.0
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] No tag found
MAC: 0:0:0:0:0:0
nothing is working, even the things that was working before...
cna you help me ?
as I read i check for the expected version 1.5.2 ( and not 1.5.0)
DeleteI found this one
https://github.com/adriano65/esp-open-sdk/tree/master/esp_iot_sdk_v1.5.2
and do the same for flashing...
everything is ok now!!!
yeah
great thx !!!great job !!!
This Tutorial worked for me! Thank you!
ReplyDelete[espDownloader.pyo][line:457][ERROR]: ESP8266 Chip flash download error esp_write_flash.
ReplyDeleteTHIS IS MY PROBLEM IN MIDDLE OF FLSDHING IT STOPPED AND SHOWING ERROR PLZ HELP!
AFTER 4 LONG DAYS!!!
ReplyDeleteTHANKS A LOT!
Your explanations about which .bin to choose, it's the only place on the web I found it.
IT'S NOW WORKING with Blynk!!!
esp8266 Noname from china. Arduino Uno, Arduino Ide and a bread board.FLASH IT. Nothing else!
I have followed each step of the above documentation and successfully flashed the firmware. But after flashing when I open the serial port only few AT commands are working which is AT, AT+GMR & AT+RST. When I give other AT commands like AT+CWMODE it is showing error message. Can anyone help me to resolve this issue.
ReplyDelete