Intermediate upgrade firmware for ESP8266 based Tuya devices to easily backup and replace stock firmware
Used for OTA flashing by https://github.com/ct-Open-Source/tuya-convert
It was based on https://github.com/khcnz/Espressif2Arduino
- Install
platformio
- Install Arduino 1.8.8
- Go to Preferences and add to "Additional Boards Manager URLs" http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Go to "Board Manager" and search "esp"
- Install esp8266 by ESP8266 Community version 2.3
- Install linker scripts from this repository
cp files/boards.txt $ARDUINO_PATH/packages/esp8266/hardware/esp8266/2.3.0
cp files/*.ld $ARDUINO_PATH/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/ld- Build and package
scripts/build-pio.sh- Edit
$ARDUINO_PATHinscripts/build-arduino.shto point to the arduino executable - Build and package
scripts/build-arduino.sh- Build esp8266-ota-flash-convert.ino using Flash Size "1M (Espressif OTA Rom 1)"
- Convert to a version 2 binary
esptool.py elf2image --version 2 esp8266-ota-flash-convert.ino.elf- Build esp8266-ota-flash-convert.ino using Flash Size "1M (Espressif OTA Rom 2)"
- Convert to a version 2 binary
esptool.py elf2image --version 2 esp8266-ota-flash-convert.ino.elf- Move binaries into
builddirectory asuser1.binanduser2.binrespectively - Package UPG
scripts/create_upg.py- Copy
.binfiles frombuildto thefilesdirectory undertuya-convert