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

Add network bind plug for interactive server #19

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

MonicaisHer
Copy link
Contributor

@MonicaisHer MonicaisHer commented Oct 23, 2023

This PR will resolve #18

To install and configure the snap with the changes introduced by this PR, follow these steps:

$ sudo snap install chip-tool --channel=edge/pr-19

$ sudo snap connect chip-tool:avahi-observe
$ sudo snap connect chip-tool:bluez
$ sudo snap connect chip-tool:process-control

$ snap connections chip-tool 
Interface        Plug                       Slot              Notes
avahi-observe    chip-tool:avahi-observe    :avahi-observe    manual
bluez            chip-tool:bluez            :bluez            manual
network          chip-tool:network          :network          -
network-bind     chip-tool:network-bind     :network-bind     -
process-control  chip-tool:process-control  :process-control  manual

After installation, the interactive mode command should run without any errors:

$ sudo chip-tool interactive server
$ sudo chip-tool interactive start 
...
>>> pairing onnetwork 110 20202021
>>> onoff toggle 110 1

@MonicaisHer MonicaisHer requested a review from farshidtz October 23, 2023 14:17
@MonicaisHer
Copy link
Contributor Author

@ihidchaos Could you please test the snap from channel edge/pr-19 as described above to see if it resolves the issue you reported? Thanks.

@ihidchaos
Copy link

@ihidchaos Could you please test the snap from channel edge/pr-19 as described above to see if it resolves the issue you reported? Thanks.

Okay, I'm testing it.

@ihidchaos
Copy link

ihidchaos commented Oct 23, 2023

image

It shows error: requested a non-existing branch on latest/edge for snap "chip-tool": pr-19

@canonical canonical deleted a comment from ihidchaos Oct 23, 2023
@farshidtz
Copy link
Member

@ihidchaos It had been released only for amd64, but you were trying to install it on an arm64 platform.

Please try again using the same command. I just built and uploaded it for arm64.

sudo snap install chip-tool --channel=latest/edge/pr-19

@ihidchaos
Copy link

@ihidchaos It had been released only for amd64, but you were trying to install it on an arm64 platform.

Please try again using the same command. I just built and uploaded it for arm64.

sudo snap install chip-tool --channel=latest/edge/pr-19

Thanks for pointing this out, after testing this fix works and I can now successfully launch interactive mode.

Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. The server can now open a port:

$ sudo netstat -tulpn | grep 5550
udp        0      0 0.0.0.0:5550            0.0.0.0:*                           7646/chip-tool      
udp6       0      0 :::5550                 :::*                                7646/chip-tool

But the history in the interactive mode isn't preserved across reboots because the file is written at /tmp/chip_tool_history. For preserving the history, the path can be replaced with a persisted one.

@farshidtz farshidtz changed the title Add network bind plug Add network bind plug for interactive server Oct 24, 2023
@farshidtz farshidtz merged commit 388b028 into canonical:main Oct 24, 2023
@MonicaisHer MonicaisHer deleted the fix-interactive-mode branch October 24, 2023 15:46
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 this pull request may close these issues.

interactive server command listen failed
3 participants