Updated Upgrade (markdown)

blakadder 2019-10-28 01:47:11 +01:00
parent dd98448b12
commit ef9badc7ce
1 changed files with 1 additions and 85 deletions

@ -1,85 +1 @@
For first-time flashers, please follow the [Upload instructions](Flashing) to initially flash Tasmota firmware onto your device.
The first rule of upgrading: _**If it ain't broke, don't fix it!**_ In other words, ensure that there is a good reason to mess with a working installation (e.g., a need to use a new feature or address a found problem fixed in a more current version).
Any time you upgrade it is highly recommended that you [back up your device settings](#device-settings). This is found in the web UI under the `Configuration` menu.
# Device Settings
Tasmota uses flash memory to store many options and settings. Newer versions of Tasmota add features and use more and more of this area than earlier versions. These regions of flash were therefore not used by Tasmota before. If you did not erase flash when you originally flashed your device, a newer update may be accessing areas with values left over from the original factory firmware. Therefore there could be unexpected behavior. It is best to address this before upgrading across major versions of Tasmota.
1. Make a configuration backup using one of these two methods:
- Use `decode-config.py` from the Tasmota [`tools` code folder](../tree/development/tools) to create the backup in human readable form:
`decode-config.py -d <deviceIP> --backup-file Config-@H-@f-@v --backup-type json`
- If you have a `.dmp` backup already, you can create a JSON extract from that file:
`decode-config.py -f <dmpFile> --backup-file Config-@H-@f-@v --backup-type json`
2. Perform a `Reset 6` (erases flash settings area but retains Wi-Fi and MQTT settings)
3. Upgrade the firmware
4. Restore configuration
Particularly the older your current Tasmota versions is, it is probably best not to restore the backup directly since there may be some outdated settings in your configuration. There are often newer better alternatives, particularly since an upgrade is normally done to use new features. Configure the device manually referring to the [Commands article](Commands) and the settings (e.g., SetOptions, Rules, etc.) in the JSON file you created in step #1.
## Upgrading via OTA
It is recommended (and more convenient) to upgrade the device firmware [over-the-air](https://en.wikipedia.org/wiki/Over-the-air_programming), without a serial connection, while being connected to AC and operational.
### OTA Upgrade Methods
**Attention:** Because of limited flash memory it might be needed to flash a *minimal* firmware version before flashing the actual *non-minimal* new firmware update. See below or more details.
There are a few ways to upgrade the firmware:
1. Use the "Upgrade by file upload" dialog on the Tasmota web interface to flash an available firmware binary file (e.g. `firmware.bin`)
2. Use the "Upgrade by web server" dialog on the Tasmota web interface to flash a firmware binary file provided on a web server
3. Initiate the upgrade via the serial/MQTT/web command [`upgrade`](Commands#management)
*Bonus for openHAB users:* Implement an [automation rule](openHAB#maintenance-actions) to upgrade your devices from within openHAB.
### Firmware Binary Sources
Build the firmware binary from source or download the latest build.
The latest build can be found in the [GitHub releases section](releases).
A secondary host for OTA upgrades is provided on [thehackbox](http://thehackbox.org/tasmota/release/) because GitHub will only serve files over HTTPS, which is not supported by the Tasmota firmware.
A full list of available builds for the latest release can be found in [the releases section](releases).
### Functionality vs Firmware size vs OTA
As more functionality is being added to the firmware at some time it reaches the point where OTA or web page upload will fail. Both upgrade features rely on the fact that there is enough free flash memory available to load both the current and the new firmware. With a 1MB flash as available on most ESP82xx devices and the standard linker script providing 950kB code space a firmware file size of as much as 475kB allows for an easy upgrade.
Starting with **version 5.x** Tasmota uses an updated linker script, extending the code space by 70kB, allowing a firmware file size of as much as 510kB.
Larger firmware files can only be loaded when the current flash usage is first reduced to accommodate more free flash to load the new firmware. Hence you'll need to perform a two step process:
1. Upload firmware with `#define FIRMWARE_MINIMAL` **enabled** (remove the slashes) which will have a smaller footprint
2. Upload the final firmware with `#define FIRMWARE_MINIMAL` **disabled** (commented with slashes) with the features you want to use.
This applies if you are not building your own firmware, too - use the `-minimal` firmware image first, then load the normal one.
## Migration path
Until now several versions of Tasmota have been released starting with the C version Sonoff-MQTT-OTA followed by Sonoff-MQTT-OTA-Arduino and Sonoff-Tasmota.
Migrating from one version to the next versions is mostly painless as the settings are saved in the same location in flash and newer settings are appended.
As said, mostly painless. There are some deviations to this rule as I rearranged the flash. In the next list you'll find an overview of supported migrations paths.
* No migration from **Sonoff-MQTT-OTA** to **Sonoff-MQTT-OTA-Arduino** or **Sonoff-Tasmota**.
The settings flash lay-out and OTA image locations are different from the Arduino versions
* Easy migration from **Sonoff-MQTT-OTA-Arduino 1.0.11** to **Sonoff-Tasmota 3.9.x**.
After installing Sonoff-Tasmota for the first time some settings need to be adjusted via web configuration or MQTT commands.
* Easy migration from **Sonoff-MQTT-OTA-Arduino 3.1.0** to **Sonoff-Tasmota 4.x**.
After installing Sonoff-Tasmota for the first time some settings need to be adjusted via web configuration or MQTT commands.
* Easy migration from **Sonoff-Tasmota 4.x** to **Sonoff-Tasmota 5.14**.
As a safeguard perform a Backup Configuration before installing the new version. If settings are lost after the upgrade perform a Restore Configuration.
* Easy migration from **Sonoff-Tasmota 5.2** to **Sonoff-Tasmota 6.7.1**.
As a safeguard perform a **Backup Configuration** before installing the new version. If settings are lost after the upgrade perform a **Restore Configuration**.
- :warning: If you've used development versions between 6.6.0.7 and 6.6.0.11 [Back up your device settings](#device-settings) as described above. Convert the backup to human readable form as you **MUST** restore these settings manually. :warning:
- Perform a `Reset 6` before upgrading the firmware and, for safe measure, after the upgrade completes.
- Enter your device configurations using the settings saved in the first step.
* Easy migration from **Sonoff-Tasmota 6.7.1** to **Tasmota 7.x**.
As a safeguard perform a **Backup Configuration** before installing the new version. If settings are lost after the upgrade perform a **Restore Configuration**.
So to migrate from **Sonoff-MQTT-OTA-Arduino versions before 3.1.0** to **Tasmota 7.x** you will need to take four steps:
1. Migrate to **Sonoff-Tasmota 3.9.x**
2. Migrate to **Sonoff-Tasmota 4.x**
3. Migrate to **Sonoff-Tasmota 5.14**
4. Migrate to **Sonoff-Tasmota 6.7.1**
5. Migrate to **Tasmota 7.x**
Moved to [Upgrading](Upgrading)