Does Snips actually work on Ubuntu?

#1

I’m new to Snips and I’ve been working for about 3 weeks now to get Snips up an running as a base on Ubuntu with a Pi Zero as a satellite.

I have hotword detection on the satellite, I’ve had minimal success with skills on the base though.
I can’t even get the demo installed.

I don’t know if I’m running into Python errors or permissions errors but I am certainly hitting a wall.
I’m happy to keep plugging away if there is some hope of getting it to work but right now I don’t know if that is possible.

#2

Hi,

We don’t support all the Linux distros officially. On pi0 the best is to stick to the raspbian stretch to avoid issues.

#3

By the way, you can also launch your scripts without the skill server, it is just a helper looking for scripts in a folder and launching them for you.

#4

@SakanaSan

Is there a Linux Distro that is supported? Because if there is I’ll use it.
I am running Raspbian on my pi0.

#5

Raspbian stretch on the pi0 is the supported linux distribution, it is best to use the lite version url: https://downloads.raspberrypi.org/raspbian_lite_latest

The latest ubuntu does not run on the rpi0 and original raspberry pi, both are ARMv6 and are not supported by the latest ubuntu image … ref: https://wiki.ubuntu.com/ARM/RaspberryPi and https://www.ubuntu.com/download/iot

#6

Sorry I should have mentioned that I am attempting to run the Base on a VM on my ESXi server with the goal to have multiple pi0 satellites in the house.

I am running into issues getting the skills installed with sam on the base, which is Ubuntu 18.04.1 running in a VM.
I’m more than happy to switch to a different distro if there a recommended on for the base.

#7

sam is meant to be use with the raspberry, I am not so surprised that it does not work properly on your base (Ubuntu 18.04.1 running in a VM)

you just need to install the snips-skill-servers manually on your vm.

I would suggest starting from a vm on which you have not tried to use sam to setup the platform …

you can setup you vm using those instruction : Run and Deploy on Ubuntu local device

1 Like
#8

@marc

So I spun up a new VM last night and I just got the opportunity to get snips installed.
I did not install Sam.

So with my base being setup on a VM and not being used for hot-word detection I removed “snips-audio-server”.

I started editing my snips.toml file. Did I miss anything?

[snips-common]
 bus = "mqtt"
 mqtt = "192.168.1.116:1883"
 audio = ["living-room@mqtt"]
 assistant = "/usr/share/snips/assistant"
 user_dir = "/var/lib/snips"

## MQTT authentication
 mqtt_username = "username"
 mqtt_password = "password"

[snips-hotword]
audio = ["living-room@mqtt"]

If my snips.toml file is correct the next step is to manually install the skills correct?

Are these the correct steps to manually install:

Download Assistant from Console
Move to Base
sudo rm -rf /usr/share/snips/assistant/
sudo unzip <assistant.zip> -d /usr/share/snips/
sudo systemctl restart ‘snips-*’

2 questions about these steps.
Do I need to do the “sudo rm -rf /usr/share/snips/assistant/” every time I download a new assistant from the console? I’m not clear if the download contains all the assistants added? I’ve only tried 1 at a time.

2nd with Sam and maybe this was a source of my issues, I only ever deleted the files/folders located in /var/lib/snips/skills/.

I assume the steps at (https://docs.snips.ai/articles/console/actions/deploying-your-skills#deploy-manually-without-sam) take the Assistant(s) installed earlier and create the files/folders in /var/lib/snips/skills/ ?

#9

Ok so I’ve tried to install an assistant using the manual method found here (https://docs.snips.ai/articles/console/actions/deploy-your-assistant)
I added Joke, en-weather, and timestables to my apps, I downloaded the zip file. unzipped it to the /usr/share/snips directory.
Once extracted I looked in the assistant/snippets and there was only a config.ini file.
When I run

snips-template render

as per the steps on (https://docs.snips.ai/articles/console/actions/deploying-your-skills#deploy-manually-without-sam)

I get

[00:55:17.330403] INFO :snips_actions_templates_engine_lib: parsing snippets for app "/usr/share/snips/assistant/snippets/Snips.TimesTables_EN"
[00:55:17.330717] INFO :snips_actions_templates_engine_lib: parsing snippets for app "/usr/share/snips/assistant/snippets/maxiguillim.Weather-en"
[00:55:17.330838] INFO :snips_actions_templates_engine_lib: parsing snippets for app "/usr/share/snips/assistant/snippets/coorfang.Joke"

and when I check /var/lib.snips/skills/ there is nothing there.

Then I tried this:

git clone https://github.com/CoorFun/snips-skill-joker.git
cd snips-skill-joker ./setup.sh
./action-askJoke.py

I first got a hermes_python missing error which I resolved with pip install hermes-python

Then I tried the ./action-askJoke.py and it hangs and I have to ctrl+c to stop it. When I cancel I get this output:

^CTraceback (most recent call last):
  File "./action-askJoke.py", line 20, in <module>
    h.subscribe_intent("coorfang:askJoke", fetch_joke) \
  File "/home/bert/.local/lib/python3.6/site-packages/hermes_python/hermes.py", line 307, in start
    self.loop_forever()
  File "/home/bert/.local/lib/python3.6/site-packages/hermes_python/hermes.py", line 317, in loop_forever
    sleep(.1)
1 Like
#10

I am very interested to see how you make out with this. I am working on this very same setup.

#11

try
snips-skill-server install_skills --clean

#12

Alright so I’m making some headway. Yay progress!

So I wiped my system of Assistants and installed Greetings by SirBuildALot7.
The manual install went well, I got an assistant folder in /var/lib/snips/skills which is something running the ./setup.sh files for previous assistants hadn’t done.
But when I tried the assistant I got the Hotword detection and then nothing.

Then @ozie suggested the snips-skill-server install_skills --clean command. So I ran that and restarted my Snips base and I got this for the output when I said “Hey Snips”.

[16:14:50] [Hotword] detected on site living-room, for model hey_snips
[16:14:50] [Asr] was asked to stop listening on site living-room
[16:14:51] [Hotword] was asked to toggle itself 'off' on site living-room
[16:14:51] [Dialogue] session with id 'b2717124-bba6-4755-9e80-a4c2a34bc03a' was started on site living-room
[16:14:51] [AudioServer] was asked to play a wav of 41.1 kB with id '8ca7482b-0ec5-4476-b107-2f4d1cd89515' on site living-room
[16:14:51] [Hotword] detected on site living-room, for model hey_snips
[16:14:51] [AudioServer] finished playing wav with id '8ca7482b-0ec5-4476-b107-2f4d1cd89515'
[16:14:51] [Asr] was asked to listen on site living-room
[16:14:55] [Asr] captured text "hello" in 3.0s
[16:14:55] [Asr] was asked to stop listening on site living-room
[16:14:55] [AudioServer] was asked to play a wav of 93.1 kB with id 'aee3b8a6-ce5b-47ad-ab1d-ff1f4740b4e9' on site living-room
[16:14:56] [AudioServer] finished playing wav with id 'aee3b8a6-ce5b-47ad-ab1d-ff1f4740b4e9'
[16:14:56] [Nlu] was asked to parse input "hello"
[16:14:56] [Nlu] detected intent SirBuildsALot7:hello with confidence score 0.987 for input "hello"
              Slots ->
                 hello -> hello (confidence: 1.000)
[16:14:56] [Dialogue] New intent detected SirBuildsALot7:hello with confidence 0.987
              Slots ->
                 hello -> hello (confidence: 1.000)
[16:15:01] [Dialogue] session with id 'b2717124-bba6-4755-9e80-a4c2a34bc03a' was ended on site living-room. The session was ended because one of the component didn't respond in a timely manner
[16:15:01] [Asr] was asked to stop listening on site living-room
[16:15:01] [Hotword] was asked to toggle itself 'on' on site living-room

So I noticed 2 things,
There seems to be double hotword detection, I thought I had the setup so that the satellite was the one detecting the hotword and the base doing the command.

Apparently a component didn’t respond, how do I find out what component?

Here is the same time entries from syslog:

May 14 16:14:40 heimdall snips-tts[21523]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id '02b5f30b-c71d-4361-8517-9a2ce4d76220'. Ignoring it.
May 14 16:14:40 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [86595f40-6664-427d-8352-8f99cd4f1817]: closing session which was active: IntentNotRecognized
May 14 16:14:40 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [living-room]: reset site -> turn off ASR and turn on Hotword
May 14 16:14:40 heimdall snips-hotword[21540]: INFO:snips_hotword_lib::audio    : Audio thread for site living-room started.
May 14 16:14:51 heimdall snips-hotword[21540]: INFO:snips_hotword_hermes        : Hotword detected: site_id:living-room model:hey_snips (-14ms ago)
May 14 16:14:51 heimdall snips-hotword[21540]: INFO:snips_hotword_lib::audio    : Audio thread for site living-room stopped.
May 14 16:14:51 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [living-room]: reset site -> turn off ASR and turn off Hotword
May 14 16:14:51 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [b2717124-bba6-4755-9e80-a4c2a34bc03a]: The session has been created because the site "living-room" is free
May 14 16:14:51 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [865d6741-a160-469d-97b7-543d898f9bf9]: The session has been dropped because the site "living-room" is busy
May 14 16:14:51 heimdall snips-tts[21523]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id '8ca7482b-0ec5-4476-b107-2f4d1cd89515'. Ignoring it.
May 14 16:14:51 heimdall snips-asr[21524]: INFO:snips_asr_hermes          : Listening
May 14 16:14:51 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0       entered AsrRunner::run
May 14 16:14:51 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0+0.000 capture started
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0+3.417 endpoint detected (rule:4) frame:208 samples:53248 signal_time:3.328 rtf:0.053
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : Source thread stop on push: "Disconnected(..)"
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0+3.424 capture ended
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0+3.425 decoder finalized
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : T0+3.426 lookup and post-processing done
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "hello", likelihood: 1.0, tokens: Some([Token { value: "hello", confidence: 1.0, time: (0.0, 3.1499999), range: 0..5 }]) }]
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_hermes          : Cleanup
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_hermes          : Preparing decoder
May 14 16:14:55 heimdall snips-asr[21524]: INFO:snips_asr_hermes          : Idle
May 14 16:14:56 heimdall snips-tts[21523]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id 'aee3b8a6-ce5b-47ad-ab1d-ff1f4740b4e9'. Ignoring it.
May 14 16:15:01 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [b2717124-bba6-4755-9e80-a4c2a34bc03a]: closing session which was active: Timeout
May 14 16:15:01 heimdall snips-dialogue[21519]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [living-room]: reset site -> turn off ASR and turn on Hotword
May 14 16:15:01 heimdall snips-hotword[21540]: INFO:snips_hotword_lib::audio    : Audio thread for site living-room started.

Now a huge problem is that I can’t hear Snips right now as I am at work and using TTS to trigger and test Snips. But it seems from the output that Snips is detecting the ‘command’ trying to do something but that bit not responding.