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

Explain auto/manual interface connections #57

Merged
merged 2 commits into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 37 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,23 @@ This snap has been tested on amd64/arm64 architectures for WiFi/Ethernet/DNS-SD/
sudo snap install chip-tool
```

Connect the [`avahi-observe`](https://snapcraft.io/docs/avahi-observe-interface) interface to allow DNS-SD based discovery:
```bash
sudo snap connect chip-tool:avahi-observe
```
When installing from the Snap Store, the following interfaces auto-connect:
- [`avahi-observe`](https://snapcraft.io/docs/avahi-observe-interface) to allow DNS-SD based discovery.
- [`bluez`](https://snapcraft.io/docs/bluez-interface) for device discovery over Bluetooth Low Energy (BLE).

> **Note**
> DNS-SD and Bluetooth depend on Avahi and Bluez.
> To install:
> - Ubuntu: `sudo apt install bluez avahi-daemon`
> - Ubuntu Core: `sudo snap install avahi bluez`

Connect the [`bluez`](https://snapcraft.io/docs/bluez-interface) interface for device discovery over Bluetooth Low Energy (BLE):
```bash
sudo snap connect chip-tool:bluez
```

Connect the [`process-control`](https://snapcraft.io/docs/process-control-interface) interface for system-wide process management. This is needed to grant Chip Tool access to make [sched_setattr](https://man7.org/linux/man-pages/man2/sched_setattr.2.html) system calls. This may improve the reliability of the operations (see https://github.com/canonical/chip-tool-snap/issues/8).
You may connect the [`process-control`](https://snapcraft.io/docs/process-control-interface) interface to allow system-wide process management.
This is needed to grant Chip Tool access to make [sched_setattr](https://man7.org/linux/man-pages/man2/sched_setattr.2.html) system calls. This may improve the reliability of the commissioning and control operations (see [#8](https://github.com/canonical/chip-tool-snap/issues/8)).
```bash
sudo snap connect chip-tool:process-control
```

> **Note**
> On **Ubuntu Core**, the `avahi-observe` and `bluez` interfaces are not provided by the system.
>
> These interfaces are provided by other snaps, such as the [Avahi](https://snapcraft.io/avahi) and [BlueZ](https://snapcraft.io/bluez) snaps.
> To install the snaps and connect to the interfaces, run:
> ```bash
> sudo snap install avahi bluez
> sudo snap connect chip-tool:avahi-observe avahi:avahi-observe
> sudo snap connect chip-tool:bluez bluez:service
> ```
>

### Commissioning into IP network
Discover using DNS-SD and pair:
```bash
Expand Down Expand Up @@ -103,6 +93,32 @@ Build remotely for all supported architectures:
snapcraft remote-build
```

### Install the built snap

Install the local snap:
```bash
sudo snap install --dangerous *.snap
```

Connect the following interfaces:
```bash
sudo snap connect chip-tool:avahi-observe
sudo snap connect chip-tool:bluez
```

> **Note**
> On **Ubuntu Core**, the `avahi-observe` and `bluez` interfaces are not provided by the system.
> These interfaces are provided by other snaps, such as the [Avahi](https://snapcraft.io/avahi) and [BlueZ](https://snapcraft.io/bluez) snaps.
> To install the snaps and connect the interfaces, run:
> ```bash
> sudo snap install avahi bluez
> sudo snap connect chip-tool:avahi-observe avahi:avahi-observe
> sudo snap connect chip-tool:bluez bluez:service
> ```


Continue the [setup](#setup).

## Test

Refer to [tests](./tests).
Loading