Getting Started with esptool for flashing firmware on ESP8266 and ESP32

Esptool is a free and open source ESP8266 and ESP32 serial bootloader command-line utility. The source code is available at GitHub under GPLv2 license. It is written in Python therefore it is universal and runs on Microsoft Windows, Mac OS and any GNU/Linux distribution (Ubuntu, Debian, Linux Mint, Fedora, CentOS, OpenSUSE, etc).

Installation

As of today esptool works fine with Python 2.7 or Python 3. Python 2 has been deprecated since January 1, 2020 therefore it is recommended to use esptool with Python 3.

The easier way to install the latest stable version of esptool is from pypi via pip. Open a terminal and execute the following command:

pip install esptool

Flashing Firmware

Using write_flash argument esptool flashed pre-compiled binary to devices with ESP8266 or ESP32. Here are the exact steps:

  • Download an appropriate binary for your ESP8266/ESP32 device.
  • Connect your device to a computer. For example, for ANAVI Thermometer, ANAVI Gas Detector, ANAVI Light Controller and ANAVI Miracle Controller you must use UART to USB debug cable.
  • Turn on the device in boot mode. For example, on ANAVI Thermometer, ANAVI Gas Detector, ANAVI Light Controller and ANAVI Miracle Controller, press and hold the RESET button and plug the power supply.
  • In a terminal execute the following command:
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 firmware.bin 

Finding the Right Firmware

All ANAVI Internet of Things with ESP8266/ESP32 combine free and open source software with open source hardware. The firmware is built using Arduino IDE and a pre-compiled binary file is available at GitHub. Follow the links below to identify your ANAVI device and download appropriate binary for the latest stable firmware:

Of course, alternatively, instead of using esptool you can build the firmware from source through Arduino IDE or PlatformIO.

You may also like

ANAVI Smiley and ANAVI Tag Manager Certified by the Open Source Hardware Association

The primary goal of ANAVI Technology Ltd. is to combine open source hardware with free and open source software. So far numerous of our development boards have been certified by the Open Source Hardware Association (OSHWA). In February 2020 a couple new products were also certified: ANAVI Smiley and ANAVI Tag Manager. Both of them have been designed with the free and open source tool KiCad.

A lot of products on the market claim their are open source hardware, however this is not always true. Open Source Hardware certification allows the community to quickly identify hardware that truly complies with the definition of open source hardware. Because of this certification by OSHWA is important for us.

ANAVI Smiley

Image
ANAVI Smiley add-on board for Raspberry Pi as a soldering kit

ANAVI Smiley is a simple add on for Raspberry Pi that comes as a soldering kit. It has a couple of LEDs and a button. A simple Python 3 application for using this add-on board is available at GitHub. ANAVI Smiley was certified by OSHWA with UID BG000061. It has been designed as a prize for the teams competing at Pi Wars 2020. Soon ANAVI Smiley will be also available on sale at tindie.

ANAVI Tag Manager

Image
ANAVI Tag Manager with PN532 NFC RFID module and an acrylic enclosure

ANAVI Tag Manager is a WiFi development board for using PN532 NFC RFID module. The board is using ESP8266. It is powered from microUSB connector. There are slots for UART pins, mini OLED display and up to 3 I2C sensor modules. Furthermore there is also an extra GPIO pin for custom automation solutions. ANAVI Tag Manager is useful for various applications with NFC, including smart locks and payment systems. It has been certified by OSHWA with UID BG000062.

Stay tuned for new articles with details about both of these exciting new open source hardware gadgets!

You may also like