Updated Flashing (markdown)

Michael Ingraham 2019-09-25 08:51:06 -04:00
parent f9b1081412
commit 9c25f186ae
1 changed files with 21 additions and 24 deletions

@ -20,7 +20,7 @@ If the flash was successful the console will display:
![Flash succeeded](https://user-images.githubusercontent.com/5904370/55690010-489c3100-598c-11e9-8135-e44469037e11.png)
Unplug your adapter or device and plug it back in or connect to another power source. Your device is now ready for [Initial configuration](Initial-Configuration).
Unplug your serial programming adapter or your device and plug it back in or connect to another power source. Your device is now ready for [Initial configuration](Initial-Configuration). **For proper device initialization after the firmware upload completes, power down and power up the device.**
### Common mistakes
Message `COM# failed to connect: Failed to connect to Espressif device: Timed out waiting for packet header` means your device is not connected (recheck COM port number and USB cable) or not in flash mode (retry flash mode procedure for your device).
@ -44,11 +44,11 @@ sudo apt install esptool
```
### Upload Tasmota
Make sure you followed the steps to put your device in flash mode. Download the latest Tasmota binary ([sonoff.bin](https://github.com/arendst/Sonoff-Tasmota/releases)) in the same folder as Esptool.py.
Make sure you followed the steps to put your device in flash mode. Place your chosen firmware binary file in the same folder as esptool.py.
Esptool uses the serial interface to communicate with your device. On Windows these interfaces are named COM1, COM2, etc. and on Linux they are named /dev/ttyUSB0, /dev/ttyUSB1, etc. Before using Esptool make sure you know which serial interface your device is connected to.
Esptool uses the serial interface to communicate with your device. On Windows these interfaces are named COM1, COM2, etc. and on Linux they are named /dev/ttyUSB0, /dev/ttyUSB1, etc. Before using esptool, make sure you know which serial port your programming adapter is connected to.
In the following commands I use `COM5` as an example. Change `COM5` with your port designation.
The following use `COM5` as an example. Change `COM5` with your serial port designation.
Ensure the device is in flash mode before each step.
@ -57,55 +57,54 @@ Backup the current firmware with the following command:
```
esptool.py --port COM5 read_flash 0x00000 0x100000 fwbackup.bin
```
*When the command completes the device is not in flash mode anymore.*
*When the command completes the device is not in flash mode anymore.* Repeat the process of putting your device in programming mode.
#### Erase firmware
#### Erase flash memory
Erase the complete flash memory holding the firmware with the following command:
```
esptool.py --port COM5 erase_flash
```
It only takes a few seconds to erase 1M of flash.
*When the command completes the device is not in flash mode anymore.*
*When the command completes the device is not in flash mode anymore.* Repeat the process of putting your device in programming mode.
#### Upload firmware
Load the downloaded Tasmota firmware file *sonoff.bin* with the following command:
Load the chosen Tasmota firmware file with the following command (e.g., `sonoff.bin` in this example):
```
esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 sonoff.bin
```
*When the command completes the device is not in flash mode anymore.*
**For proper device initialization after the firmware upload power down and power up the device.**
Unplug your serial programming adapter or your device and plug it back in or connect to another power source. Your device is now ready for [Initial configuration](Initial-Configuration). **For proper device initialization after the firmware upload completes, power down and power up the device.**
## Esptool executable
The executable version of esptool is maintained by Ivan Grokhotkov and releases are kept at [https://github.com/igrr/esptool-ck/releases](https://github.com/igrr/esptool-ck/releases). Supports Linux, Linux ARM, Windows 32-bit and Mac
The executable version of esptool is maintained by Ivan Grokhotkov and releases are kept at [https://github.com/igrr/esptool-ck/releases](https://github.com/igrr/esptool-ck/releases). Supports Linux, Linux ARM, Windows 32bit and Mac
### Download and install
#### Download and install
For the purpose of simplicity only the Windows version will be explained here, but the commands and parameters are the same for Windows, Linux and Mac.
Download the latest release of [Esptool-CK](https://github.com/igrr/esptool-ck/releases) and extract the compressed file to a folder of your choice.
### Upload Tasmota
Place your chosen firmware binary file (e.g., `sonoff.bin` in the example below) in the same folder as Esptool-CK to simplify the process.
Download the Tasmota firmware file [sonoff.bin](https://github.com/arendst/Sonoff-Tasmota/releases) to the same folder as Esptool-CK to simplify the process.
In the following commands I use `COM5` as an example. Change `COM5` with your port designation.
The following commands use `COM5` as an example. Change `COM5` with your port designation.
Ensure the device is in flash mode before each step.
Erase the existing flash
#### Erase flash memory
```
esptool -cp COM5 -cb 115200 -ce -v
```
Once the erase is complete, put device back into flash mode and upload the firmware
#### Upload firmware
Once the erase is complete, put device back into programming mode and upload the firmware
```
esptool -cp COM5 -cb 115200 -bm dout -cf sonoff.bin -v
```
Unplug your serial programming adapter or your device and plug it back in or connect to another power source. Your device is now ready for [Initial configuration](Initial-Configuration). **For proper device initialization after the firmware upload completes, power down and power up the device.**
# Flashing and compiling from source
Tutorials for setting up development environments if you want to modify the code or default settings and compile your own binaries.
- [**PlatformIO**](PlatformIO) - setup and configure [PlatformIO](https://platformio.org) for Tasmota compilation and upload
@ -126,14 +125,12 @@ _**Can only create a firmware binary.** Use one of the [tools](Prerequisites#fla
# OTA Flashing Tools
**Tasmota is NOT a developer of these tools. For help and troubleshooting you will need to _get support from those projects_.**
- [**Tuya OTA**](Tuya-OTA) - easy OTA flash for devices with Tuya chips, no disassembly required
- [**Sonoff DIY**](Sonoff-DIY) - OTA flash for select Sonoff devices (some disassembly required)
- [**Node-RED OTA server and firmware manager**](https://flows.nodered.org/flow/888b4cd95250197eb429b2f40d188185) - [Node-RED](https://nodered.org/) flow for managing OTA updates
- [**OTA over SCP**](OTA-over-SCP) - setup and configure "OTA over SCP" upload for PlatformIO
- [**Python HTTP OTA server**](Python-HTTP-OTA-Server) - setting up a small Python server to serve OTA upgrade binaries
- [**Tuya OTA**](Tuya-OTA) - easy OTA flash for devices with Tuya chips, no disassembly required
- [**SonOTA**](SonOTA---Espressif2Arduino---Tasmota-without-compiling) - OTA flash eWeLink based devices *(mostly outdated - may work with newer Itead firmware)*
- [**SonOTA**](SonOTA---Espressif2Arduino---Tasmota-without-compiling) - OTA flash eWeLink based devices *(mostly outdated)*
## Need more help?
If you have encountered problems during flash see [Troubleshooting](https://github.com/arendst/Sonoff-Tasmota/wiki/Troubleshooting#flashing-issues). Ask for help in [Discord](https://discord.gg/Ks2Kzd4) or [Community Forum](https://groups.google.com/d/forum/sonoffusers)
Tasmota is flashed and your device and ready for [Initial Configuration](Initial-Configuration).