Satellite Configuration

Last updated 2 months ago

Introduction

This part explains how you can use satellites (multi-room dialog) with your master device. For instance if you want your master device and have a satellite in your kitchen and/or one in your bedroom and so on.

  • Master: The main Snips device on which the whole platform is installed.

  • Satellite: The slave Snips device which is placed into different rooms.

Hardware requirements

Satellite will only run part of Snips platform (audio-server or audio-server & hotword-server), so all devices that can run Snips whole platform are good to be used in satellite mode.

Moreover, since a satellite is mostly capturing voice queries and playing audio feedback without doing any ASR or NLU, a smaller device such as the Raspberry Pi Zero is efficient enough.

The following tutorial will be using the Raspberry Pi Zero & ReSpeaker 2-Mic HAT.

Choose your configuration

Depending on the different components running, there are mainly two configurations:

Configuration

Components running

Advantages

A

snips-audio-server

snips-skill-server (Opt.)

  • Easy to setup

  • Low performance requirements

B

snips-audio-server

snips-hotword-server

snips-skill-server (Opt.)

  • Different personal wake word

  • Reduce the payload

The two different configurations are shown in Figure 3.1

Figure 3.1.A Configuration A
Figure 3.1.B Configuration B

Regardless of the configuration you choose, you must have already flashed the latest Raspbian Stretch Lite and connected to your Raspberry Pi via SSH.

If you do not know how to flash the image, please check this page.

If you do not know how to setup network connection, please read this section.

Configuration A setup

1. Installation of Snips components

This configuration will only require snips-audio-serverto be installed

$ sudo apt-get update
$ sudo apt-get install -y dirmngr
$ sudo bash -c 'echo "deb https://raspbian.snips.ai/$(lsb_release -cs) stable main" > /etc/apt/sources.list.d/snips.list'
$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys D4F50CDCA10A2849​
$ sudo apt-get update
$ sudo apt-get install -y snips-audio-server

2. Installation of the sound card driver

git clone https://github.com/respeaker/seeed-voicecard
cd seeed-voicecard
sudo ./install.sh
sudo reboot

3. Sound card configuration

Edit /etc/asound.conf file:

$ sudo nano /etc/asound.conf

Change slave.pcm "dmixed" to slave.pcm "hw:1,0"

Change slave.pcm "array" to slave.pcm "hw:1,0"

A correct asound.conf file should looks like:

defaults.pcm.rate_converter "samplerate"
pcm.!default {
type asym
playback.pcm "playback"
capture.pcm "capture"
}
pcm.playback {
type plug
slave.pcm "hw:1,0"
}
pcm.capture {
type plug
slave.pcm "hw:1,0"
}
pcm.dmixed {
type dmix
slave.pcm "hw:seeed2micvoicec"
ipc_key 555555
}
pcm.array {
type dsnoop
slave {
pcm "hw:seeed2micvoicec"
channels 2
}
ipc_key 666666
}

4. Snips configuration

There are two parts that needs to be configured to make the platform work with the new configuration.

4.1. Satellite devices

Edit /etc/snips.toml file:

$ sudo nano /etc/snips.toml

Uncomment mqtt = "localhost:1883" under [snips-common] section, then change it to mqtt = "YOUR_BASE_IP/HOST_NAME:1883". For example we changed to mqtt = "livingroomdev.local:1883", because the hostname of our master device is "livingroomdev".

Uncomment bind = "default@mqtt" under [snips-audio-server] section, then change it to bind = "YOUR_DEVICE_NAME@mqtt". For example we changed to bind = "kitchen@mqtt", because we named this satellite device as "kitchen". This name is also called "siteId" if you refer to the Hermes protocol.

After edit, the changed part should look like:

[snips-common]
mqtt = "livingroomdev.local:1883"
[snips-audio-server]
bind = "kitchen@mqtt"

4.2. Master device

Edit /etc/snips.toml file:

$ sudo nano /etc/snips.toml

Uncomment bind = "default@mqtt" under [snips-audio-server] section, then change it to bind = "YOUR_DEVICE_NAME@mqtt". For example we changed to bind = "livingroom@mqtt", because we named this master device "livingroom". This name is also called "siteId" if you refer to the Hermes protocol.

Uncomment audio = [+@mqtt] under [snips-hotword] section, then change it to audio = ["YOUR_BASE_NAME@mqtt", "YOUR_SAT_NAME@mqtt"]. For example we changed to audio = ["livingroom@mqtt", "kitchen@mqtt"], because the hostname of our base device is "livingroom", the new satellite is called "kitchen".

After edit, the changed part should look like:

[snips-hotword]
audio = ["livingroom@mqtt", "kitchen@mqtt"]
[snips-audio-server]
bind = "livingroom@mqtt"

If you have more than one satellite, simply added all of them to audio = [" "] list following the formate "YOUR_BASE_NAME@mqtt".

Configuration B

1. Installation of Snips components

This configuration will need to install snips-audio-serverand snips-hotword.

$ sudo apt-get update
$ sudo apt-get install -y dirmngr
$ sudo bash -c 'echo "deb https://raspbian.snips.ai/$(lsb_release -cs) stable main" > /etc/apt/sources.list.d/snips.list'
$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys D4F50CDCA10A2849​
$ sudo apt-get update
$ sudo apt-get install -y snips-audio-server
$ sudo apt-get install -y snips-hotword

On your master device, copy the /usr/share/snips/hotword directory to your satellite at the same location (Replace <satellite_IP/Hostname> by your own):

$ scp -r /usr/share/snips/hotword pi@<satellite_IP/Hostname>:/usr/share/snips/hotword

2. Installation of sound card driver

This part is identical to configuration A, please refer to here.

3. Sound card configuration

This part is identical to configuration A, please refer to here.

4. Snips configuration

There are two parts needed to be configured to make the platform work with the new configuration. The main difference with configuration A is the [snips-hotword] section.

4.1. Satellite device

Edit /etc/snips.toml file:

$ sudo nano /etc/snips.toml

Uncomment mqtt = "localhost:1883" under [snips-common] section, then change it to mqtt = "YOUR_BASE_IP/HOST_NAME:1883". For example we changed it to mqtt = "livingroomdev.local:1883", because the hostname of our base device is "livingroomdev".

Uncomment bind = "default@mqtt" under [snips-audio-server] section, then change it to bind = "YOUR_DEVICE_NAME@mqtt". For example we changed it to bind = "kitchen@mqtt", because we named this satellite device "kitchen". This name is also called "siteId" if you refer to the Hermes protocol.

Uncomment model = "/usr/share/snips/hotword" under [snips-hotword] section.

Uncomment audio = ["+@mqtt"] under [snips-hotword] section, then change it to audio = ["YOUR_DEVICE_NAME@mqtt"]. For example we changed it to audio = ["kitchen@mqtt"].

After your changes, the changed part should look like:

[snips-common]
mqtt = "livingroomdev.local:1883"
[snips-audio-server]
bind = "kitchen@mqtt"
[snips-hotword]
model = "/usr/share/snips/hotword"
audio = ["kitchen@mqtt"]

If you would like to use a personal wake word, simple modify the model address to your own. If you want to learn how to make your own wake word, read this section.

4.2. Master device

Edit /etc/snips.toml file:

$ sudo nano /etc/snips.toml

Uncomment bind = "default@mqtt" under [snips-audio-server] section, then change it to bind = "YOUR_DEVICE_NAME@mqtt". For example we changed it to bind = "livingroom@mqtt", because we named this base device to "livingroom". This name is also called "siteId" if you refer to the Hermes protocol.

Uncomment audio = [+@mqtt] under [snips-hotword] section, then change it to audio = ["YOUR_BASE_NAME@mqtt"]. For example we changed it to audio = ["livingroom@mqtt"], because the hostname of our master device is "livingroom".

After your changes, the changed part should look like:

[snips-hotword]
audio = ["livingroom@mqtt"]
[snips-audio-server]
bind = "livingroom@mqtt"