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

[Darwin-tool BUG] DelayedActionTime field not showing in OTA-Requestor App #27953

Closed
liamgonyea opened this issue Jul 14, 2023 · 4 comments · Fixed by #29169
Closed

[Darwin-tool BUG] DelayedActionTime field not showing in OTA-Requestor App #27953

liamgonyea opened this issue Jul 14, 2023 · 4 comments · Fixed by #29169
Labels

Comments

@liamgonyea
Copy link
Contributor

liamgonyea commented Jul 14, 2023

Reproduction steps

When performing an OTA transfer using Darwin-framework-tool, the DelayedActionTime parameter is not being set for the OTA-Requestor to wait between attempts to query the image. Instead, the default 120 seconds is being used instead of the DelayedActionTime=180 seconds value set.

Reproduce:

Build Darwin-framework-tool on Mac using newer SHA c7d9a11

  1. scripts/examples/gn_build_example.sh examples/darwin-framework-tool examples/darwin-framework-tool/out/debug

Build OTA-Requestor app on RasPi using SHA 5a21d17

  1. scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/ota-requestor-app chip_config_network_layer_ble=false chip_code_pre_generated_directory=\"/home/ubuntu/sve2/connectedhomeip/zzz_pregenerated\"

Download 2 sample files to your Downloads folder.

  • Sample_OTA-R_file_and_JSON_config.zip

  • hello_OTA_v2 is a dummy OTA-R file using a simple C hello world program

  • sample_mac_ota_config_hello_OTA_v2.json is a sample JSON config file used in Command 5 below

  • Edit otaURL path in sample_mac_ota_config_hello_OTA_v2 to point to the hello_OTA_v2 dummy OTA-R file below:

{
    "deviceSoftwareVersionModel": [
        {
            "vendorId": 65521,
            "productId": 32769,
            "softwareVersion": 2,
            "softwareVersionString": "2.0",
            "cDVersionNumber": 19,
            "softwareVersionValid": true,
            "minApplicableSoftwareVersion": 0,
            "maxApplicableSoftwareVersion": 100,
            "otaURL": "/Users/<INSERT_YOUR_USER>/Downloads/hello_OTA_v2"
        }
    ]
}

Launch OTA-Requestor app on RasPi:

  1. ./out/ota-requestor-app/chip-ota-requestor-app --discriminator 3841 --autoApplyImage --trace_decode 1

Run the following commands on Mac. Edit Step 5 with the proper path:

  1. ./examples/darwin-framework-tool/out/debug/darwin-framework-tool interactive start --commissioner-nodeId 0x1234
  2. otasoftwareupdateapp candidate-file-path /Users/<INSERT_YOUR_USER>/Downloads/sample_mac_ota_config_hello_OTA_v2.json
  3. pairing code 4321 MT:-24J0IRV01KA0648G00
  4. otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": "0x0000000000001234", "endpoint": 0}]' 4321 0
  5. otasoftwareupdateapp set-reply-params --action 0 --status 1 --consent 0 --consentNeeded 0 --delayedActionTime 180
  6. otasoftwareupdaterequestor announce-otaprovider 0x0000000000001234  65521 0 0 4321 0

Observe Issue in OTA-Requestor app logs

[1689292923.476450][1173:1173] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0001
[1689292923.476530][1173:1173] CHIP:SWU: QueryImageResponse:
[1689292923.476573][1173:1173] CHIP:SWU: status: 1
[1689292923.476640][1173:1173] CHIP:SWU: imageURI: /Users/liamgonyea/Desktop/Liam_Current_Copy/SU_BDX_TestCases/hello_OTA_v2
[1689292923.476685][1173:1173] CHIP:SWU: softwareVersion: 2
[1689292923.476723][1173:1173] CHIP:SWU: softwareVersionString: 2.0
[1689292923.476763][1173:1173] CHIP:SWU: updateToken: 32
[1689292923.476804][1173:1173] CHIP:SWU: Scheduling a retry; delay: 120

In Contrast...

Repeating the same steps above except Step 1, build Darwin-framework-tool on older SHA 3c8b8cf, yields the correct logs on the OTA-Requestor App:

[1689292692.291065][1144:1144] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0001
[1689292692.291168][1144:1144] CHIP:SWU: QueryImageResponse:
[1689292692.291213][1144:1144] CHIP:SWU: status: 1
[1689292692.291272][1144:1144] CHIP:SWU: delayedActionTime: 180 seconds
[1689292692.291313][1144:1144] CHIP:SWU: imageURI: /Users/liamgonyea/Desktop/Liam_Current_Copy/SU_BDX_TestCases/hello_OTA_v2
[1689292692.291354][1144:1144] CHIP:SWU: softwareVersion: 2
[1689292692.291393][1144:1144] CHIP:SWU: softwareVersionString: 2.0
[1689292692.291450][1144:1144] CHIP:SWU: updateToken: 32
[1689292692.291493][1144:1144] CHIP:SWU: Scheduling a retry; delay: 180

Bug prevalence

Always

GitHub hash of the SDK that was being used

c7d9a11

Platform

darwin

Platform Version(s)

No response

Anything else?

Darwin-framework-tool on newer SHA c7d9a11 run against RasPi OTA-Requestor App SHA 5a21d17
DelayedActionTime_Failure_c7d9a11.zip

Darwin-framework-tool on older SHA 3c8b8cf run against RasPi OTA-Requestor App SHA 5a21d17
DelayedActionTime_Success_3c8b8cf968.zip

@bzbarsky-apple
Copy link
Contributor

otasoftwareupdateapp candidate-file-path <Path_to_JSON_Config_File.json>

@liamgonyea what goes in that file?

@bzbarsky-apple
Copy link
Contributor

But those docs are not sufficient to actually set up a working JSON file, unfortunately.

@bzbarsky-apple
Copy link
Contributor

Per offline discussion, this never worked; @liamgonyea was using a build with some local changes initially...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
2 participants