Skip to content

Instantly share code, notes, and snippets.

@Ivorforce
Created July 10, 2020 17:35
Show Gist options
  • Save Ivorforce/a6e3b899d6d0b96b6e8a0106eb4d2d22 to your computer and use it in GitHub Desktop.
Save Ivorforce/a6e3b899d6d0b96b6e8a0106eb4d2d22 to your computer and use it in GitHub Desktop.
import sys
import os
from pathlib import Path
from os.path import expanduser
home = expanduser("~")
idf_path = (Path.home() / Path(".platformio/packages/framework-espidf")).absolute()
os.environ['IDF_PATH'] = str(idf_path)
sys.path.append(str(idf_path / Path("components/app_update")))
sys.path.append(str(idf_path / Path("components/partition_table")))
if "-f" not in sys.argv:
sys.argv.insert(1, "-f")
partition_file = Path("./partitions_8mb.csv").absolute()
sys.argv.insert(2, str(partition_file))
print(f"[Auto] Using Partitions File: {partition_file}")
import otatool
otatool.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment