====== Loading new firmware onto an ESP8266 ====== ===== Firmware ===== A lot of people will prefer now to use [[start-with-esp-12-arduino|Arduino IDE]] for this. Alternatively you may use: First you need a firmware file. You can build one yourself with the [[Toolchain]] or download one: * Espressif firmware source updated at http://bbs.espressif.com * Electrodragon's [[http://www.electrodragon.com/w/ESP8266_AT-Command_firmware|ESP8266 AT-Command firmware]] describes the AT Firmware, where to get it from and how to flash it. There is a link to [[http://bbs.espressif.com/viewforum.php?f=46|Expressif's release page]]. * [[https://github.com/nodemcu/nodemcu-firmware|NodeMCU]] - firmware for running Lua scripts, or see the forum article [[http://www.esp8266.com/viewtopic.php?f=23&t=3001|Build your own custom NodeMCU firmware in the cloud]] * [[https://github.com/micropython/micropython/|MicroPython]] - firmware for running Python 3 scripts. Supports several microcontrollers including the ESP8266. * [[ESP8266Basic]] - Basic interpreter with browser based development. * Other projects listed on the [[start#esp8266com_users_projects|user projects section]] of the wiki home * **__See this site for a prac.__**[[http://www.xess.com/blog/esp8266-reflash/|http://www.xess.com/blog/esp8266-reflash/]] ===== Prerequisites ===== To flash the ESP8266, you'll need first need to wire things up. See [[start-with-esp-12-arduino|start-with-esp-12-arduino -> Hardware]] for the basics. Connect GPIO 0 to ground and reboot the ESP8266 to enter flashing mode. ===== Arduino IDE ===== Arduino now offer a third party plugin to use the Arduino IDE for different CPUs. See step by step instructions in [[start-with-esp-12-arduino|Start with the ESP-12E and the Arduino tools]] ===== GUI Flashing tool: NodeMCU ===== The [[https://github.com/nodemcu/nodemcu-flasher|NodeMCU flasher]] is designed for use with the NodeMCU firmware, but it can also be used to flash other firmware files. Windows-only currently, but a cross-platform version is in the works. ===== Command Line Flashing Utilities ===== See [[https://github.com/themadinventor/esptool/|ESPtool on Github]] and Christopher Rust's accompanying [[https://www.youtube.com/watch?v=kS8PucmUt5Y|YouTube tutorial]]. However, if you don't want to use a Python-based tool, there are two other command-line tools on Github: [[https://github.com/igrr/esptool-ck/|Christian Klippel's esptool-ck]] written in C for Windows, Linux and OS X, and [[https://github.com/DonKinzer/esp_tool/|Don Kinzer's esp_tool]] written in C++ with makefiles for Windows and Linux (also includes a pre-built Windows executable). All three command-line utilities perform the same basic functions but the invocation syntax is different for each. Kinzer's esp_tool utility can also build a sparse combined image file meaning that most of the "filler" between the actual image data components is omitted. Omitting the filler can significantly reduce the Flashing time while still providing the benefits of a combined image file. ===== Uploading Scripts ==== For NodeMCU or MicroPython, use [[https://github.com/4refr0nt/ESPlorer|ESPlorer]] or [[https://github.com/nodemcu/nodemcu-studio-csharp|NodeMCU Studio]] to upload the Lua or Python scripts after uploading the initial firmware.