Skip to content

Commit 60f6a41

Browse files
author
Mark Dornbach
committed
update README
1 parent 1afd690 commit 60f6a41

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
# A minimal firmware for OTA (over the air) flashing Tasmota starting from Mongoose OS
1+
# Mg2x - a minimal firmware for OTA (over the air) flashing various target firmwares starting from Mongoose OS
22

33
## Overview
44

5-
This is a first working draft for an intermediate firmware that can be used to
6-
install [Tasmota](https://github.com/arendst/Tasmota) on various Shelly
7-
models. It will install the same version of Tasmota as [Tuya Convert](https://github.com/ct-Open-Source/tuya-convert/),
5+
Mg2x is an intermediate firmware that can be used to install [Tasmota](https://github.com/arendst/Tasmota)
6+
or [Home Accessory Architect](https://github.com/RavenSystem/haa) on various
7+
Shelly models. For Tasmota, it will install the same version as [Tuya Convert](https://github.com/ct-Open-Source/tuya-convert/),
88
and you can continue from there to your favourite target release.
99

1010
## Install
1111

12-
**Warning:** _This application is still at an early stage. If something fails,
13-
your device may be bricked, if you don't know how to flash a new firmware over a
14-
wired connection. Proceed with caution!_
12+
**Warning:** _This application should generally be safe to use for all supported
13+
devices. Still, overwriting a devices boot loader via OTA update is a risky
14+
operation. If something unexpected fails, your device may be bricked, unless you
15+
know how to flash a new firmware over a wired connection._
1516

1617
**Warning:** _As of now, once you convert to Tasmota, there is no way back via
1718
an OTA update to Mongoose OS! You'll need a wired connection to get your device
@@ -36,6 +37,9 @@ succeeds, the device will restart again, and you will see a new WIFI network
3637
labeled _tasmota-????_. This process should take no longer than 4 - 5 minutes,
3738
depending on your network connection.
3839

40+
If you replace _mg2tasmota_ by _mg2haa_ in above URLs, your device will install
41+
the Home Accessory Architect firmware instead of Tasmota.
42+
3943
If the download fails, or your internet connection is disrupted, simply turn the
4044
device off and on again, the intermediate firmware will retry until it succeeds.
4145

@@ -46,8 +50,8 @@ which you can use for recovery.
4650
## Build the firmware yourself
4751

4852
You can compile a binary version of this firmware using [mos tools](https://mongoose-os.com/docs/mongoose-os/quickstart/setup.md#1-download-and-install-mos-tool). Once installed, clone this repository and run
49-
`mos build --build-var MODEL=Shelly1 --platform esp8266` to create a binary
50-
for e.g. a Shelly1 switch located in `build/fw.zip`.
53+
`mos build --build-var MODEL=Shelly1 --build-var TARGETFW=tasmota --platform esp8266`
54+
to create a binary for e.g. a Shelly1 switch located in `build/fw.zip`.
5155

5256
## Acknowledgments
5357
Thanks to [rojer](https://github.com/rojer) for helping me with the debugging of

src/main.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ rboot_config *rboot_cfg;
1414
* hash verify download!
1515
* if failed wait 60 sec and reboot
1616
* disable wdt and interrupts during critical write operations
17+
* move block for bootloader (0...4096) and its config (BOOT_CONFIG_ADDR ... BOOT_CONFIG_ADDR) last
18+
* move to esp flash write lib:
19+
#include "esp_flash_writer.h"
20+
static struct esp_flash_write_ctx s_wctx;
21+
...
22+
case MG_EV_CONNECT:
23+
esp_init_flash_write_ctx(0x2000, (0x100000 - 0x2000));
24+
...
25+
case MG_EV_HTTP_CHUNK:
26+
esp_flash_write(&s_wctx, hm->body);
1727
*/
1828

1929
/*

0 commit comments

Comments
 (0)