Skip to content

Zephyr UpdateHub sample issues #69297

@RafalHalik

Description

@RafalHalik

I've been working with the OTA updatehub sample built for mimxrt1060_evk.

I've come across some issues with json parse in the mcuboot updatehub agent. When a package is uploaded for a rollout using updatehub-ce in a docker container. The device does a check to pull the update down i get the following error in a minicom terminal window...
minicom -D /dev/ttyACM0

[00:00:02.503,000] <inf> main: UpdateHub sample app started
[00:00:02.503,000] <inf> main: Confirming the boot image
[00:00:02.503,000] <inf> main: Network disconnected
[00:00:04.527,000] <inf> main: Network connected
[00:00:04.527,000] <inf> main: Starting UpdateHub polling mode
[00:00:04.527,000] <inf> updatehub: SHA-256 verification on download and from flash
[00:00:04.532,000] <inf> updatehub: Probe metadata received
[00:00:04.532,000] <err> updatehub: Could not parse json
[00:01:04.536,000] <inf> updatehub: Probe metadata received
[00:01:04.537,000] <err> updatehub: Could not parse json
[00:02:04.541,000] <inf> updatehub: Probe metadata received
[00:02:04.541,000] <err> updatehub: Could not parse json
[00:03:04.546,000] <inf> updatehub: Probe metadata received
[00:03:04.546,000] <err> updatehub: Could not parse json

However the update would not fail imedietly but after a minute (interval to check for an update again) it would try pull the meta data about the update once again and fail in the same way.
I decided to by-pass the cleanup that happens if the json parse fails and now all checks to do with meta data from the json parse fail and print their error messages...

 <err> updatehub: Could not parse json 
 <err> updatehub: Could not parse json 
 <err> updatehub: SHA256 size is invalid 
 <err> eth_mcux: ENET_GetRxFrameSize return: 4001 

and with this change the update fails and doesn't try again after the minute.

To Reproduce
-Following the steps from https://docs.zephyrproject.org/latest/samples/subsys/mgmt/updatehub/README.html
The only difference being building for a mimxrt1060_evk board.

  • Run docker container for updatehub-ce
    docker run -it -p 8080:8080 -p 5683:5683/udp --rm updatehub/updatehub-ce:latest
  • In browser connect to localhost:8080 or local ip
  • Create package using uhu from signed image as per the examples intructions
  • Upload package zephyr-update.pkg on the updatehub dashboard
  • Create rollout and the update never fails nor completes
  • For update to fail with previously mentioned errors lines 878, 884, 893, 906, 922
    need to be commented out, can be found at ~zephyproject/zephyr/subsys/mgmt/updatehub/updatehub.c

I have also check using uhu if my metadata is valid:

image

Expected behaviour

  • Update never completing, fail at a json parse which can be seen through a minicom -D /dev/ttyACM0
  • If code commented out update failing and reporting back to updatehub that it failed

Impact
Due to this issue I haven't been able to continue on with working with this sample

Environment

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Zephyr version 3.5.0

Metadata

Metadata

Assignees

Labels

area: UpdateHubUpdateHubbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions