Tag Archives: ESP8266

How to load Zimodem firmware to an ESP8266 without Arduino IDE

Updates:

  • 2018-02-25: Clarification on what ESP devices these instructions are currently limited to, per a comment from James J.
  • 2018-02-26: Added notes about versions for ESP-1, NodeMCU ESP8266-12E, and NodeMCU-32S modules.
  • 2018-02-27: Added link to Espressif tool for Windows that is supposed to do ESP32 modules (and also does ESP8266). If it works, I may update this just to use that one tool for both module types.
  • 2018-03-02: Removed second Windows option until I have confirmed how it works.

Updating ESP8266 / ESP32 Firmware

NOTE: These instructions are currently limited to devices like the NodeMCU ESP8266-12E and the NodeMCU-32S development kits:

An ESP8266 development board, available for under $9 from Amazon. (And much less from China!)

These devices have a built-in USB-to-Serial interface, so they can be plugged up to a Mac/PC over a USB cable for uploading firmware. However, the instructions probably will work with things like the ESP-1 module by using a USB programming device that interfaces it to USB.

ESP-1 module USB programming adapter.

Customized Zimodem firmware for all three of these platforms is now being created.


The excellent Zimodem firmware by Bo Zimmerman turns a low-cost ESP8266 module into a WiFi smart modem. One of the challenges users face is how to get this firmware installed on their module to begin with. I have been providing steps on how to install and configure the Arduino IDE so you can download the Zimodem source, build it, and load it.

But, if you aren’t a developer and don’t really want to go through that many hoops, you can take an existing firmware binary file and just load it directly.

Here are the steps as I know them, for Windows (with a nice GUI), or Mac OS X/Linux (command line).

Customized Zimodem Firmware images

I have a customized version of the Zimodem firmware on my server pre-built for the NodeMCU ESP8266-12E devkit, NodeMCU-32S devkit, and ESP-1 module. Download this firmware image here:

http://subethasoftware.com/files/zimodem/

The versions will be named as follows:

  • zimodem.ino.generic-3.4.bin – for the ESP-1 module.
  • zimodem.ino.nodemcu-3.4.bin – for the NodeMCU ESP8266-12E development kit.
  • zimodem.ino.nodemcu-32s-3.4.bin – for the NodeMCU-32S development kit.

These names are the default names that the Arduino IDE creates, with the version number added.

Windows – ESP8266 NodeMCU Firmware Programmer

Download the NodeMCU flasher program. There is a 32-bit and 64-bit version:

https://github.com/nodemcu/nodemcu-flasher

NOTE: A different utility may be needed for ESP32. There is one that espressif (the ESP chip creator) provides that does both ESP8266 and ESP32. It is a .rar file, and when I downloaded it under Window 10, it ended up as a .man file (?). I had to rename that to .rar, and then find a RAR extractor (I used a free one from the Microsoft store). If you are using an ESP32, you may want to try this:

https://www.espressif.com/en/products/hardware/esp32/resources

Tutorial: http://iot-bits.com/esp32/esp32-flash-download-tool-tutorial/

With your ESP8266 module plugged in (so it appears as a COM: port to Windows), open the NodeMCU flasher program and select that COM port:

On the Advanced tab, uncheck the default internal firmware (that is the option you would use to restore an ESP8266 module back to factory firmware), and browse to the new firmware in the second line. Checkbox that line, and set the start address to 0x0000.

ESP8266 Flasher for Windows – Config tab, for specifying the new firmware to load.

You might also go to the Advanced tab and increase the baud rate if you want the update to go faster. Once the binary file and COM port have been specified, return to the Operation tab and click Flash to begin the upload to the ESP8266.

ESP8266 Flasher for Windows – Operation tab, flashing in progress.

…and when complete…

ESP8266 Flasher for Windows – Operation tab, flashing complete.

You can now restart the ESP8266 module and it should be using the new firmware.

Windows – ESP8266/ESP32 Espressif Flash Download Tools V3.6.3

I have tested this tool on ESP8266, but not on ESP32 yet. I will update this section when I do. It requires more steps to install and setup, but may be what we have to use for ESP32. Running it offers four different parts it can flash:

Espressif Flash Download Tools V3.6.3 for ESP8266 and ESP32

I will update this tutorial when I have confirmed how to use this.

Mac and Linux – esptool

Install esptool (a Python script) and pySerial (a Python library for talking to the serial port):

easy_install esptool
easy_install pyserial

NOTE: I think I hadto run this as super user, “sudo easy_install esptool”.

Identify the serial port connected to the ESP module. This can be done from a shell (Linux) or the Terminal (Mac). On Mac, can look for devices that begin with “cu”:

alsmbpro:temp allenh$ ls /dev/cu*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.HC-05A-DevB /dev/cu.SLAB_USBtoUART

If you do not know what to look for, you could do this command before plugging in the ESP8266, then again after you plug it in and see what appears. (On my system, I know I installed Silicon Labs drivers, so I recognized the “SLAB” name.)

On Linux, I think you need to do ls /dev/ttyS*. (I also saw an exemple using “setserial -g /dev/ttyS[0123]”).

Now that you know what serial port is connected to the ESP module,  run esptool.py specifying that port, and the firmware image to use. On my system:

esptool.py -p /dev/cu.SLAB_USBtoUART --baud 460800 write_flash --flash_size=detect 0 zimodem.ino.nodemcu-3.4.bin

If it works, you should see something like this:

prompt$ esptool.py -p /dev/cu.SLAB_USBtoUART --baud 460800 write_flash --flash_size=detect 0 zimodem.ino.nodemcu-3.4.bin
esptool.py v2.2.1
Connecting........_
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 344528 bytes to 247587...
Wrote 344528 bytes (247587 compressed) at 0x00000000 in 5.8 seconds (effective 472.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

You can now restart the ESP8266 module and it should be using the new firmware.

Over-the-Air Updates

Once you have this special build of the firmware, you will be able to do over-the-air updates. Make sure you configure your Zimodem for your WiFi network by going through the:

AT+CONFIG

You can then use the command “AT&U” to see what the current version is. Bo is currently working on 3.4.

In stock Zimodem, firmware updates pull from Bo’s website for the two boards he support (the ESP-1, I think, and some flavor of ESP32). For my customized “CoCoWiFi” version, it will pull special builds from my website instead, and there are three different boards supported.

As I build new versions of this customized Zimodem firmware, I will place them on my server and you can type (from the Zimodem command mode):

AT&U=3.4

That will get whatever version I have available. You should not need to do any more USB updates, unless something goes horribly wrong, or you want to go back to stock NodeMCU firmware.

Please let me know if this works for you.