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

[shell] Shell app is not able to receive the incoming message after refactor #7519

Closed
yufengwangca opened this issue Jun 10, 2021 · 1 comment · Fixed by #7544
Closed

[shell] Shell app is not able to receive the incoming message after refactor #7519

yufengwangca opened this issue Jun 10, 2021 · 1 comment · Fixed by #7544
Assignees

Comments

@yufengwangca
Copy link
Contributor

yufengwangca commented Jun 10, 2021

Problem

We found the Shell app was not able to receive the incoming message after moving common shell commands to core library.

#6765

> ping 192.168.86.171
IP address: 192.168.86.171
CHIP:IN: TransportMgr initialized
CHIP:IN: TransportMgr initialized
CHIP:DL: writing settings to file (/tmp/chip_counters.ini.tmp)
CHIP:DL: failed to rename (/tmp/chip_counters.ini.tmp), Operation not permitted (1)
CHIP:IN: local node id is 0x000000000001b669
CHIP:IN: New pairing for device 0x0000000000bc5c01, key 0!!
Establish secure session succeeded

Send echo request message with payload size: 32 bytes to Node: 12344321
CHIP:IN: Secure message was encrypted: Msg ID 1
CHIP:IN: Sending msg from 0x000000000001b669 to 0x0000000000bc5c01 at utc time: 41723455 msec
CHIP:IN: Sending secure msg on generic transport
CHIP:IN: Secure msg send status No Error
No response received

Send echo request message with payload size: 32 bytes to Node: 12344321
CHIP:IN: Secure message was encrypted: Msg ID 2
CHIP:IN: Sending msg from 0x000000000001b669 to 0x0000000000bc5c01 at utc time: 41724456 msec
CHIP:IN: Sending secure msg on generic transport
CHIP:IN: Secure msg send status No Error
No response received

Send echo request message with payload size: 32 bytes to Node: 12344321
CHIP:IN: Secure message was encrypted: Msg ID 3
CHIP:IN: Sending msg from 0x000000000001b669 to 0x0000000000bc5c01 at utc time: 41725456 msec
CHIP:IN: Sending secure msg on generic transport
CHIP:IN: Secure msg send status No Error
No response received
Done

Proposed Solution

<suggested fix, suggested enhancement>

@gjc13
Copy link
Contributor

gjc13 commented Jun 11, 2021

This is caused by the sleep in the ping client blocking the stack's event loop.

In https://github.com/project-chip/connectedhomeip/pull/6765/files#diff-496ba0c0f1f6757d9f58a66cd245c61b28f327c03872e45a44125780eb177189R255 , the handling of the shell tasks are posted to the stack's main loop rather than handled in the shell task now.

Modifying it back to processing in the shell task will unblock the ping but I believe it's not the correct thing to do for various reasons:

  • CHIP objects and APIs are never thread-safe
  • Calling CHIP APIs on the shell task requires another deep stack which is a burden on embedded systems.

My proposal is to modify the echo client to make it async, thoughts? @yufengwangca

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 a pull request may close this issue.

2 participants