Skip to content

Commit

Permalink
Merge pull request #57 from canonical/autoconnect-avahi-bluez
Browse files Browse the repository at this point in the history
Explain auto/manual interface connections
  • Loading branch information
jpm-canonical authored May 30, 2024
2 parents 2333f09 + 412e797 commit dfa2987
Showing 1 changed file with 37 additions and 21 deletions.
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).

0 comments on commit dfa2987

Please sign in to comment.