Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions apps/tedge-agent-idf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,7 @@ if(_EXTRAVERSION)
string(APPEND PROJECT_VER "-${_EXTRAVERSION}")
endif()

# tiny-edge, pinned to a release. The whole repository is fetched, not only
# its ESP-IDF component: the component builds the portable core and the
# shared ports from beside it, which the component manager's git+path
# dependency does not bring along. TINY_EDGE_DIR (environment or -D) uses a
# local checkout instead, to try a client change.
set(TINY_EDGE_VERSION v0.5.0)
if(NOT TINY_EDGE_DIR AND DEFINED ENV{TINY_EDGE_DIR})
set(TINY_EDGE_DIR $ENV{TINY_EDGE_DIR})
endif()
if(NOT TINY_EDGE_DIR)
include(FetchContent)
FetchContent_Declare(tiny_edge
GIT_REPOSITORY https://github.com/thin-edge/tiny-edge.git
GIT_TAG ${TINY_EDGE_VERSION}
GIT_SHALLOW TRUE
# Only the sources: tiny-edge has no top-level project to add.
SOURCE_SUBDIR do-not-add)
FetchContent_MakeAvailable(tiny_edge)
set(TINY_EDGE_DIR ${tiny_edge_SOURCE_DIR})
endif()
message(STATUS "tiny-edge: ${TINY_EDGE_DIR}")
set(EXTRA_COMPONENT_DIRS ${TINY_EDGE_DIR}/ports/freertos/esp-idf/tiny_edge)
# tiny-edge comes from the component manager: main/idf_component.yml.

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(tedge-agent-idf)
18 changes: 8 additions & 10 deletions apps/tedge-agent-idf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ idf.py set-target esp32c6
idf.py build
```

The build fetches tiny-edge at the tag in `CMakeLists.txt`
(`TINY_EDGE_VERSION`). To try a change to the client, point it at a local
checkout:
tiny-edge comes from the ESP-IDF component manager, at the tag in
`main/idf_component.yml`. The component fetches the rest of tiny-edge (the
portable core and the shared port code) into the build directory on the
first build, so that build needs `git` and network access. To try a change
to the client, point it at a local checkout:

```sh
idf.py -D TINY_EDGE_DIR=/path/to/tiny-edge build
```

tiny-edge is fetched as a whole repository, not through the component
manager: its ESP-IDF component builds the portable core from beside it, and
the component manager's `git` + `path` dependency copies only the
component's own directory.

## Flash and set up

Flash the whole image the first time:
Expand Down Expand Up @@ -78,5 +75,6 @@ tiny-edge Smart Functions and DTM definitions:
slots and the rollback, and set-up is `tedge-onboard` over USB instead of
Improv BLE or lab-ztp-provisioner.
- No status LED or identify pattern yet.
- tiny-edge 0.5.0, so the client's parameter sets are `tiny_edge` and
`tiny_edge_remote_access`, not `zephyr_tedge`.
- tiny-edge 0.6.0, so the client's parameter sets are `tiny_edge` and
`tiny_edge_remote_access`, not `zephyr_tedge`, and `tedge-onboard`
registers the device with the image's type, `thin-edge.io-esp-idf-agent`.
10 changes: 10 additions & 0 deletions apps/tedge-agent-idf/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
dependencies:
# tiny-edge, pinned to a release. The component fetches the rest of
# tiny-edge into the build directory on the first build (git and network
# access). To build against a local checkout instead:
# idf.py -D TINY_EDGE_DIR=/path/to/tiny-edge build
tiny_edge:
git: https://github.com/thin-edge/tiny-edge.git
path: ports/freertos/esp-idf/tiny_edge
version: v0.6.0
16 changes: 8 additions & 8 deletions scripts/release/package_idf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,24 +208,24 @@ def main(argv=None):
z.writestr(f"{stem}/flash.json", json.dumps(flash, indent=2) + "\n")
z.writestr(f"{stem}/README.txt", readme)

tiny_edge = bdir / "_deps" / "tiny_edge-src" / "VERSION"
# The rest of tiny-edge, which the component fetches into the build
# directory beside the component the component manager installed.
tiny_edge = next(iter(sorted(bdir.glob("tiny_edge-src-*/VERSION"))), None)
meta = {
**{k: flash[k] for k in ("device", "device_name", "board", "app",
"variant", "version", "firmware_name", "chip",
"flash_size")},
"framework": "esp-idf",
"stem": stem,
"tedge": True,
# No device type for the firmware repository's filter: tedge-onboard
# registers every device as "thin-edge.io", so an entry restricted to
# the image's own type would not be offered in the devices' Firmware
# tab. The firmware name already names the app, variant and board.
"device_type": None,
"image_device_type": cfg.get("APP_DEVICE_TYPE"),
# tedge-onboard (tiny-edge 0.6.0 and later) registers the device with
# the type the image reports, so the firmware repository entry is
# offered to exactly the devices running this app.
"device_type": cfg.get("APP_DEVICE_TYPE") or None,
"features": [k.lower().replace("_", "-") for k in FEATURES
if cfg.get(f"TEDGE_{k}") is True],
"tedge_zephyr_version": (tiny_edge.read_text().strip()
if tiny_edge.is_file() else None),
if tiny_edge else None),
"measured": build.measured,
"signing": SIGNING,
"assets": {p.name: sha256(p) for p in (factory, app_bin, bundle)},
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ manifest:
# CONFIG_TEDGE=y. Pin a release tag; move the pin to pick up a new one.
- name: tiny-edge
remote: thin-edge
revision: v0.5.0
revision: v0.6.0
path: modules/lib/tiny-edge

self:
Expand Down
Loading