Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: unified Over-The-Air (OTA) upgrades #2332

Merged
merged 16 commits into from
May 27, 2021

Conversation

slaff
Copy link
Contributor

@slaff slaff commented May 21, 2021

This feature adds architecture-agnostic OTA support. Some of the highlights here:

  • Added component Ota that encapsulates the most important Ota functions and works with storage partitions.
  • Added component OtaNetwork to add network support for the Ota functions.
  • Sample Basic_rBoot is replaced with Basic_Ota. Direct use or rboot component inside your application is discouraged.
  • HttpServer_FirmwareUpdate is updated to use the new Ota component.
  • Sample OtaUpgradeMqtt::Upgrade is updated to use new Ota component.

With a bit of work the OTA component could support also ESP32.

Related to #2328

@slaff slaff added this to the 4.4.0 milestone May 21, 2021
@slaff slaff force-pushed the feature/unified-ota branch from bedbe41 to 29767d5 Compare May 21, 2021 09:20
@slaff slaff requested a review from mikee47 May 21, 2021 09:21
Tested on:
- [x] Host (on Linux)
- [ ] real Esp8266 device
- [ ] real Esp32 device
@slaff slaff force-pushed the feature/unified-ota branch from 29767d5 to f38edaa Compare May 21, 2021 09:46
Tested on:
    - [x] Host (on Linux)
    - [x] real Esp8266 device
    - [x] real Esp32 device
@slaff slaff changed the title [WIP] Feature: unified Over-The-Air (OTA) upgrades Feature: unified Over-The-Air (OTA) upgrades May 25, 2021
- Basic Stream fix.
- StandardPayloadParser fix.
@slaff slaff force-pushed the feature/unified-ota branch from 30e9d6a to 3af0c96 Compare May 25, 2021 12:08
Copy link
Contributor

@mikee47 mikee47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much, much better!

Sming/Arch/Esp32/spiffs-two-roms.hw Outdated Show resolved Hide resolved
Sming/Components/Ota/README.rst Outdated Show resolved Hide resolved
Sming/Components/Ota/README.rst Outdated Show resolved Hide resolved
Sming/Components/Ota/src/Arch/Esp32/IdfUpgrader.cpp Outdated Show resolved Hide resolved
Sming/Components/Ota/src/Arch/Esp32/IdfUpgrader.cpp Outdated Show resolved Hide resolved
Sming/Components/Ota/src/include/Ota/UpgraderBase.h Outdated Show resolved Hide resolved
Sming/Components/OtaNetwork/README.rst Outdated Show resolved Hide resolved
Sming/Components/OtaNetwork/src/HttpUpgrader.cpp Outdated Show resolved Hide resolved
Sming/Libraries/OtaUpgrade/OtaUpgrade/BasicStream.cpp Outdated Show resolved Hide resolved
@slaff slaff force-pushed the feature/unified-ota branch from 015d65c to c91b5f0 Compare May 25, 2021 15:51
@slaff slaff force-pushed the feature/unified-ota branch from 3f62fef to dfe1eb8 Compare May 26, 2021 08:30
@slaff slaff mentioned this pull request May 26, 2021
5 tasks
@slaff slaff merged commit 99bc5af into SmingHub:develop May 27, 2021
@slaff
Copy link
Contributor Author

slaff commented May 31, 2021

@mikee47 The OtaUpgrade library uses the RBOOT_xxx variables to read their location and address. But in ESP32 they are not present.

	$(Q) $(OTATOOL) mkfile \
		$(OTA_CRYPTO_FEATURES_IMAGE) \
		$(if $(OTA_CRYPTO_FEATURES_IMAGE),--key=$(OTA_KEY_IMAGE)) \
		--rom=$(RBOOT_ROM_0_BIN)@$(RBOOT_ROM0_ADDR) \
		$(if $(RBOOT_ROM_1_BIN),--rom=$(RBOOT_ROM_1_BIN)@$(RBOOT_ROM1_ADDR)) \

Is there an easy to get them from the hardware configuration using one of the python scripts that come with the partitioning? Can we somehow query the JSON hardware configuration without having to install aditional python library as https://github.com/h2non/jsonpath-ng for example?

@mikee47
Copy link
Contributor

mikee47 commented May 31, 2021

@slaff Yes, there is an easy way! If you look in out\Esp32\debug\hwconfig.mk there are corresponding definitions which can be used without resorting to JSON. For example:

RBOOT_ROM0_BIN -> PARTITION_rom0_FILENAME

@slaff slaff deleted the feature/unified-ota branch July 9, 2021 09:03
slaff added a commit that referenced this pull request Sep 27, 2021
Allows the usage of over-the-air updates for Esp8266, Esp32 and can be test on Host. 

Co-authored-by: mikee47 <mike@sillyhouse.net>
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 11, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 12, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 12, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 12, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 13, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
mikee47 pushed a commit to mikee47/Sming that referenced this pull request Mar 13, 2024
Layout changed with the introduction of partition tables in PR SmingHub#2258,
but reverted back to standard default layout in SmingHub#2332.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants