From fd15b61a18e02ca5a4a2418875202946a01622db Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 20 Aug 2017 15:33:20 +0200 Subject: [PATCH] Created Esptool (markdown) --- Esptool.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Esptool.md diff --git a/Esptool.md b/Esptool.md new file mode 100644 index 00000000..19964e7f --- /dev/null +++ b/Esptool.md @@ -0,0 +1,57 @@ +How to setup and configure Esptool for Tasmota upload. + +## Download Esptool +If you do not have an installed copy of Python 2.x or 3.x download and install it from https://www.python.org/. + +Download Esptool Source code from https://github.com/espressif/esptool/releases to a known folder. + +## Install Esptool +Go to the known folder and install Esptool with command ``python setup.py install``. + +## Download Tasmota +Download the latest Tasmota release file *sonoff.bin** from https://github.com/arendst/Sonoff-Tasmota/releases to another known folder. + +## Upload Tasmota +Esptool uses the serial interface to communicate with your device. On Windows these interfaces are named COM1, COM2 etc. On Linux these interfaces are called dev/ttyUSB0, dev/ttyUSB1 etc. + +Before using Esptool make sure you know which serial interface name to use. + +In the following commands I use COM5 as an example. + +### Put device in firmware upload mode +When performing a firmware upload do **not connect the device to AC** but use the power supply provided by your (FTDI type) serial interface. + +Put the device in firmware upload mode by grounding pin GPIO00 while applying power. + +Grounding pin GPIO00 can often be achieved by pressing button 1 on the Sonoff device or using a wire between GPIO00 and Gnd if the button is not available. Deviations may apply. + +Connect the serial interface of your PC to the device while GPIO00 to Gnd. + +### Optional: Backup firmware +Ensure the device is in firmware upload mode. + +Backup the current firmware with the following command +``` +esptool.py --port COM5 read_flash 0x00000 0x100000 image1M.bin +``` +NOTE: When the command completes the device is out of firmware upload mode! + +### Optional: Erase firmware +Ensure the device is in firmware upload mode. + +Backup the current firmware with the following command +``` +esptool.py --port COM5 erase_flash +``` +NOTE: When the command completes the device is out of firmware upload mode! + +### Upload firmware +Ensure the device is in firmware upload mode. + +Load the downloaded Tasmota firmware file *sonoff.bin* with the following command +``` +esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin +``` +NOTE1: When the command completes the device is out of firmware upload mode! +NOTE2: For a proper device initialisation after first firmware upload power down and power up the device. +