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

chip-tool fails to initiate AnnounceOTAProvider command when subscribed to events on OTA-Requestor Linux app #14848

Closed
ukatira opened this issue Feb 7, 2022 · 7 comments
Assignees

Comments

@ukatira
Copy link

ukatira commented Feb 7, 2022

Problem

  1. Launch and Commission OTA-Provider and OTA-Requestor reference Linux apps
  2. Subscribe events on OTA-R Linux app using chip-tool
  3. Initiate query using AnnounceOTAProvider command from chip-tool

chip-tool fails to initiate AnnounceOTAProvider command with error:
[1644258223657] [3613:3389969] CHIP: [-] ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:248: CHIP Error 0x00000032: Timeout at ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:61
[1644258223657] [3613:3389969] CHIP: [TOO] Run command failure: ../../../examples/chip-tool/commands/common/CHIPCommand.cpp:248: CHIP Error 0x00000032: Timeout

Proposed Solution

This works when AnnounceOTAProvider command is triggered before subscribing events but should work the other way as well so events can be subscribed and received right from the beginning of OTA process.

chiptool_announce_ota.txt
chiptool_event_subscribe.txt
ota-p.txt
ota-r.txt

@bzbarsky-apple
Copy link
Contributor

What exact commands are being run? Are the two chip-tool instances running at the same time, on the same IP address, using the same fabric? If so, they are both going to try to use the same port, and that's not going to work very well....

@ukatira
Copy link
Author

ukatira commented Feb 7, 2022

Command for AnnounceOTAProvider:
chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0
Command to subscribe events on OTA-Requestor app:
chip-tool otasoftwareupdaterequestor subscribe-event state-transition 5 10 1 2 0

Yes the two instances are running at the same time, on the same IP address, using the same fabric.
@bzbarsky-apple Do you know a workaround to try out to make this work in the required sequence?

@bzbarsky-apple
Copy link
Contributor

There's no workaround without code changes right now.

@vivien-apple maybe we should add a way to run chip-tool with a non-default (or even ephemeral) port? Might still break, because the same node running on multiple ports is not really something that's OK per spec.....

The other option would be to have some sort of shell/repl thing in chip-tool so you can issue it commands while it's listening for reports....

@carol-apple
Copy link
Contributor

@bzbarsky-apple I saw mentions of running two Linux all-cluster-app in different docker containers in #14303

Running multiple Linux apps in separate IP namespaces should solve the issue? If so, could you provide instructions on how to do that here?

@bzbarsky-apple
Copy link
Contributor

You'd need the two apps to be on the same fabric (as in, using the same certificate store, etc). I guess as long as they are not both trying to write to it that might work...

IP namespaces might do the trick, but all I don't really know anything about the specifics of how to set it up....

@woody-apple woody-apple added the ota label Feb 8, 2022
@isiu-apple isiu-apple self-assigned this Mar 8, 2022
@isiu-apple
Copy link
Contributor

isiu-apple commented Apr 27, 2022

I ran the sequence of commands as reported in this issue but I do not observe the reported timeout issue. I see that Query Image succeeds and event report generation continues to run even if I am running 2 instances of chiptool.

  1. Launch and Commission OTA-Provider and OTA-Requestor reference Linux apps
  2. Subscribe events on OTA-R Linux app using chip-tool
  3. Initiate query using AnnounceOTAProvider command from chip-tool

Terminal 1
out/apps/ota-provider/chip-ota-provider-app -f ~/Downloads/test2.ota --passcode 20202021 --discriminator 3840 --KVS /tmp/chip_kvs_provider

Terminal 2
out/apps/ota-requestor/chip-ota-requestor-app --discriminator 30 --secured-device-port 5560 --KVS /tmp/chip_kvs_requestor

Terminal 3
out/apps/chip-tool/chip-tool otasoftwareupdaterequestor subscribe-event state-transition 5 10 0x1234567890 0 --timeout 65535

Terminal 4
out/apps/chip-tool/chip-tool otasoftwareupdaterequestor announce-ota-provider 0x00000000ABCD 0 0 0 0x0000001234567890 0

Issue 14848 Chiptool 1 Interactive.txt
Issue 14848 Chiptool 2 Query image.txt
Issue 14848 OTA-P.txt
Issue 14848 OTA-R .txt

@bzbarsky-apple
Copy link
Contributor

Yes, after #16452 chip-tool uses ephemeral ports, so this works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants