[Solved] App doesn't work; diagnostics don't help

#1

I created an app with a simple set of intents and a simple TTS action as a snippet. When the app runs on the Snips-Base platform, I get no sound even though the sample Temperature app works fine. The diagnostics says a component has timed out, but doesn’t say which one. Please advise. Here’s the output of the dialog.

pi@snips-base : ~ $ snips-watch -vvv

[19:58:07] Watching on localhost:1883 (MQTT)

[19:58:25] [Hotword] detected on site default , for model default

[19:58:25] [Asr] was asked to stop listening on site default

[19:58:25] [Hotword] was asked to toggle itself ‘off’ on site default

[19:58:25] [Dialogue] session with id ‘f3994569-ae1c-481a-b322-43b2fa574182’ was started on site default

[19:58:25] [AudioServer] was asked to play a wav of 41.1 kB with id ‘1bf7348c-d57c-415d-b213-9d151abab797’ on site default

[19:58:26] [AudioServer] finished playing wav with id ‘1bf7348c-d57c-415d-b213-9d151abab797’

[19:58:26] [Asr] was asked to listen on site default

[19:58:28] [Asr] captured text " what do whales eat " in 2.0s

[19:58:28] [Asr] was asked to stop listening on site default

[19:58:28] [AudioServer] was asked to play a wav of 93.1 kB with id ‘80d2f55f-7dcf-4bcb-bf22-63334e238edf’ on site default

[19:58:30] [AudioServer] finished playing wav with id ‘80d2f55f-7dcf-4bcb-bf22-63334e238edf’

[19:58:30] [Nlu] was asked to parse input “what do whales eat”

[19:58:45] [Dialogue] session with id ‘f3994569-ae1c-481a-b322-43b2fa574182’ was ended on site default . The session was ended because one of the component didn’t respond in a timely manner

[19:58:45] [Asr] was asked to stop listening on site default

[19:58:45] [Hotword] was asked to toggle itself ‘on’ on site default

#2

The timed out component is the snips-skill-server.
Take a look at:
sam service log snips-skill-server (or what ever the non-sam version is ;P)

#3

Phillipp,

I am having trouble with SAM and permissions.

However, I can ssh into the Pi and get things to work nicely.

From the logs I can see, it looks like the snips-skill-server is hanging up because I did not connect the relay, see log transcript below even though that service runs after my action (rsheffield99.VAL.py).

Should I delete the assistant and start over?

pi@snips-base:~ $ sudo systemctl restart snips-skill-server

pi@snips-base:~ $ journalctl -f -u snips-skill-server

– Logs begin at Thu 2016-11-03 17:16:42 GMT. –

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snips-skill-respeaker

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/snips-skill-respeaker/action-app_respeaker”

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snips-app-sht31

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/snips-app-sht31/action-app_sht31.py”

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/rsheffield99.VAL

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/rsheffield99.VAL/action-rsheffield99-WhaleDiet-rsheffield99.VAL.py”

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snips-app-relay-switch

Mar 20 22:21:32 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/snips-app-relay-switch/action-app_relay_switch.py”

Mar 20 22:21:33 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: [app_relay_switch][err] ./action-app_relay_switch.py:45: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.

Mar 20 22:21:33 snips-base snips-skill-server[2690]: INFO:snips_skill_server_lib::runner: [app_relay_switch][err] GPIO.setup(self.relay_pin, GPIO.OUT)

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#4

thats only the information message - if a programm is failing there is a message like “restarted 3 times - stopping skill”

have you triggered the voice command during that log?

#5

Philipp,

Yes, I get the wake word to respond and then ask a question “what do whales eat?” In my intent.

The first log showed that working, but it also says there is a component (snips-skill-server?) which has timed out.

Looks like from the summary log that the action to read my text reply is found and processed (?), but never plays through the TTL as the log moves on to try to find the relay switch and fails.

Maybe if I had the path to the snips-skill-server log, I could read that directly?

Where might that be stored?

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#6

Hi,
I just installed Snips on my Rpi3 using the manual setup (https://docs.snips.ai/articles/raspberrypi/manual-setup) and i installed the “snips-platform-demo” as well.
Aplay and Arecord work fine without issues, I also check “snipps-watcher -vvv” and all seems to work fine but I get no sound at all… I mean, i say “Hey Snips”, then I ask the question and i hear a chime “ding-dong” but then i hear nothing at all…
I get:
[00:51:10] [Dialogue] session with id ‘58443f09-9e25-4540-8ee2-ee6c6bbe397c’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner

---- Complete log ----

[00:50:50] Watching on localhost:1883 (MQTT)
[00:50:57] [Hotword] detected on site default, for model hey_snips
[00:50:57] [Asr] was asked to stop listening on site default
[00:50:57] [Hotword] was asked to toggle itself ‘off’ on site default
[00:50:57] [Dialogue] session with id ‘58443f09-9e25-4540-8ee2-ee6c6bbe397c’ was started on site default
[00:50:57] [AudioServer] was asked to play a wav of 41.1 kB with id ‘f78973bd-d3b9-46b3-bea0-cdb990060b2d’ on site default
[00:50:58] [AudioServer] finished playing wav with id ‘f78973bd-d3b9-46b3-bea0-cdb990060b2d’
[00:50:58] [Asr] was asked to listen on site default
[00:51:03] [Asr] captured text “what will be the weather tomorrow in new york” in 5.0s
[00:51:03] [Asr] was asked to stop listening on site default
[00:51:03] [AudioServer] was asked to play a wav of 93.1 kB with id ‘4b45ca0c-fda6-48d5-9d9d-1e68fa84ec38’ on site default
[00:51:05] [AudioServer] finished playing wav with id ‘4b45ca0c-fda6-48d5-9d9d-1e68fa84ec38’
[00:51:05] [Nlu] was asked to parse input “what will be the weather tomorrow in new york”
[00:51:05] [Nlu] detected intent searchWeatherForecast with confidence score 0.962 for input “what will be the weather tomorrow in new york”
Slots ->
forecast_country -> new york (confidence: 1.000)
[00:51:05] [Dialogue] New intent detected searchWeatherForecast with confidence 0.962
Slots ->
forecast_country -> new york (confidence: 1.000)
[00:51:10] [Dialogue] session with id ‘58443f09-9e25-4540-8ee2-ee6c6bbe397c’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner
[00:51:10] [Asr] was asked to stop listening on site default
[00:51:10] [Hotword] was asked to toggle itself ‘on’ on site default

#7

Hi @vascojdb!

The skills are missing.

All sessions will end with a timeout if there is no action code to end the session.

try sam install demo to install the skill repository needed for that.

If you cannot use sam, you need to:

  • clone snips-skill-weather-tts
  • copy it into /var/lib/snips/skills
  • execute the setup.sh into the snips-skill-weather-tts folder
  • restart the snips-skill-server sudo systemctl restart snips-skill-server

A patch is incoming to fix the documentation.

#8

Charles,

This was helpful in finding the snips-skills folder that holds my action.

It does appear to exist as you note, but still does not do a tts action.

What am I missing?

pi@snips-base:/var/lib/snips/skills $ ls

rsheffield99.VAL snips-app-sht31

snips-app-relay-switch snips-skill-respeaker

pi@snips-base:/var/lib/snips/skills $ cd rsheffield99.VAL

pi@snips-base:/var/lib/snips/skills/rsheffield99.VAL $ ls

action-rsheffield99-WhaleDiet-rsheffield99.VAL.py requirements.txt venv

config.ini setup.sh

README.md spec.json

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#9

Thanks for the help SakanaSan,

I uninstalled everything and installed again but using sam. I did install the demo you wrote about, and i can hear voice to my question about the weather, so great as thats expected!

But I also went online to my Snips Console, and added an app that was already made, i added the “Greetings” app, and I can see it has few Intends and Actions, on the actions i can see python code that is supposed to speak as answer to my messages:

import random

say = ['hello', 'howdy', 'hi', 'greetings']
result_sentence = random.choice(say)
current_session_id = intentMessage.session_id
hermes.publish_end_session(current_session_id, result_sentence)

But when I deploy the assistant via sam install assistant -i proj_xxxxxxxxx, all goes fine with the deployment:

Downloading assistant

NLU training done
ASR training done
✔ Deploying assistant to magicmirror1.local...
Checking for actions
Python skill vascojdb.Greetings has 1 snippet:
        SirBuildsALot7
Python skill vascojdb.Today has 1 snippet:
        Likhitha
Running setup.sh & generating virtual environment for snips-skill-weather-tts
setup.sh output:
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: hermes_python==0.* in ./venv/lib/python3.5/site-packages (from -r requirements.txt (line 1)) (0.4.0)
Requirement already satisfied: future in ./venv/lib/python3.5/site-packages (from hermes_python==0.*->-r requirements.txt (line 1)) (0.17.1)
Requirement already satisfied: six in ./venv/lib/python3.5/site-packages (from hermes_python==0.*->-r requirements.txt (line 1)) (1.12.0)

Checking actions for end-user parameters
Relaunching snips-skill-server
✔ Snips assistant is now running. Say hey_snips to start!
i Run sam watch to see the logs

But when I speak I get no answer, on sam watch i get the following:

[21:48:43] Watching on localhost:1883 (MQTT)
[21:48:45] [Hotword] detected on site default, for model hey_snips
[21:48:45] [Asr] was asked to stop listening on site default
[21:48:45] [Hotword] was asked to toggle itself 'off' on site default
[21:48:45] [Dialogue] session with id 'e353d3d4-1aa4-450e-a60e-a1ed5161afd2' was started on site default
[21:48:45] [AudioServer] was asked to play a wav of 41.1 kB with id '9176abee-4563-4aa8-83e5-8804eaf04a69' on site default
[21:48:46] [AudioServer] finished playing wav with id '9176abee-4563-4aa8-83e5-8804eaf04a69'
[21:48:46] [Asr] was asked to listen on site default
[21:48:47] [Asr] captured text "hello" in 1.0s
[21:48:47] [Asr] was asked to stop listening on site default
[21:48:47] [AudioServer] was asked to play a wav of 93.1 kB with id '4ce54b86-0f40-4bb3-8859-71d7e93adddf' on site default
[21:48:49] [AudioServer] finished playing wav with id '4ce54b86-0f40-4bb3-8859-71d7e93adddf'
[21:48:49] [Nlu] was asked to parse input "hello"
[21:48:49] [Nlu] detected intent SirBuildsALot7:hello with confidence score 0.972 for input "hello"
              Slots ->
                 hello -> hello (confidence: 0.934)
[21:48:49] [Dialogue] New intent detected SirBuildsALot7:hello with confidence 0.972
              Slots ->
                 hello -> hello (confidence: 0.934)
[21:48:54] [Dialogue] session with id 'e353d3d4-1aa4-450e-a60e-a1ed5161afd2' was ended on site default. The session was ended because one of the component didn't respond in a timely manner
[21:48:54] [Asr] was asked to stop listening on site default
[21:48:54] [Hotword] was asked to toggle itself 'on' on site default

Question is, If i can see that the apps have actions (action from the Greetings app below), why isn’t the assistant using the TTS to speak the answer?

This is what I get on my journal:

[i said: hey snips]

Mar 22 22:54:11 magicmirror1 snips-hotword[646]: INFO:snips_hotword_hermes        : Hotword detected: site_id:default model:hey_snips (149ms ago)
Mar 22 22:54:11 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Mar 22 22:54:11 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [3a289279-d2e4-41c2-95d5-041126f5be2f]: The session has been created because the site "default" is free
Mar 22 22:54:11 magicmirror1 snips-audio-server[634]: INFO:snips_audio_portaudio      : Playing "f72d345c-2f7c-426d-a56c-010ade994aca" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
Mar 22 22:54:11 magicmirror1 snips-hotword[646]: INFO:snips_hotword_lib::audio    : Audio thread for site default stopped.
Mar 22 22:54:12 magicmirror1 snips-audio-server[634]: INFO:snips_audio_portaudio      : Playing of "f72d345c-2f7c-426d-a56c-010ade994aca" finished
Mar 22 22:54:12 magicmirror1 snips-tts[631]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id 'f72d345c-2f7c-426d-a56c-010ade994aca'. Ignoring it.
Mar 22 22:54:12 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Listening
Mar 22 22:54:12 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0       entered AsrRunner::run
Mar 22 22:54:12 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+0.000 capture started

[i said: hello]

Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.722 endpoint detected (rule:4) frame:155 samples:39680 signal_time:2.48 rtf:0.708
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : Source thread stop on push: "Disconnected(..)"
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.730 capture ended
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.755 decoder finalized
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.782 lookup and post-processing done
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "hello", likelihood: 0.97147715, tokens: Some([Token { value: "hello", confidence: 0.97147715, time: (0.0, 2.2441123), range: 0..5 }]) }]
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Cleanup
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Preparing decoder
Mar 22 22:54:15 magicmirror1 snips-audio-server[634]: INFO:snips_audio_portaudio      : Playing "d063372c-0421-4890-82ff-04afba162392" using output "default", wav spec: WavSpec { channels: 2, sample_rate: 22050, bits_per_sample: 16, sample_format: Int }
Mar 22 22:54:15 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Idle
Mar 22 22:54:16 magicmirror1 snips-audio-server[634]: INFO:snips_audio_portaudio      : Playing of "d063372c-0421-4890-82ff-04afba162392" finished
Mar 22 22:54:16 magicmirror1 snips-tts[631]: INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id 'd063372c-0421-4890-82ff-04afba162392'. Ignoring it.

Mar 22 22:54:21 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [3a289279-d2e4-41c2-95d5-041126f5be2f]: closing session which was active: Timeout
Mar 22 22:54:21 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Mar 22 22:54:21 magicmirror1 snips-hotword[646]: INFO:snips_hotword_lib::audio    : Audio thread for site default started.

I find it strange that the message Playing of "d063372c-0421-4890-82ff-04afba162392" finished which is the ending chime, gets referenced in the TTS on the next line as INFO:snips_tts_hermes: Received a play finished message from audio server with an unknown id 'd063372c-0421-4890-82ff-04afba162392'. Ignoring it., is it just me or this does not make sense?

Also, if i manually force hermes to speak via mosquito client command, I can hear the voice saying what I wrote:
mosquitto_pub -h localhost -p 1883 -t hermes/tts/say -m "{\"text\":\"This is a test\",\"siteId\":\"default\"}"

#10

I decided to disable the audio feedback (chimes) and here is the output of my journalctl, my session closes after 5 seconds because of timeout:

Mar 22 23:04:47 magicmirror1 snips-hotword[646]: INFO:snips_hotword_hermes        : Hotword detected: site_id:default model:hey_snips (135ms ago)
Mar 22 23:04:47 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Mar 22 23:04:47 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [202fafa9-b54b-4228-bd10-940f579d4651]: The session has been created because the site "default" is free
Mar 22 23:04:47 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Listening
Mar 22 23:04:47 magicmirror1 snips-hotword[646]: INFO:snips_hotword_lib::audio    : Audio thread for site default stopped.
Mar 22 23:04:47 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0       entered AsrRunner::run
Mar 22 23:04:47 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+0.002 capture started
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.182 endpoint detected (rule:4) frame:129 samples:33024 signal_time:2.064 rtf:0.637
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : Source thread stop on push: "Disconnected(..)"
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.197 capture ended
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.208 decoder finalized
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : T0+2.219 lookup and post-processing done
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_lib::asr        : decoded: [Recognition { decoded_string: "hello", likelihood: 1.0, tokens: Some([Token { value: "hello", confidence: 1.0, time: (0.0, 1.89), range: 0..5 }]) }]
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Cleanup
Mar 22 23:04:49 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Preparing decoder
Mar 22 23:04:50 magicmirror1 snips-asr[673]: INFO:snips_asr_hermes          : Idle
Mar 22 23:04:55 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [202fafa9-b54b-4228-bd10-940f579d4651]: closing session which was active: Timeout
Mar 22 23:04:55 magicmirror1 snips-dialogue[635]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Mar 22 23:04:55 magicmirror1 snips-hotword[646]: INFO:snips_hotword_lib::audio    : Audio thread for site default started.
#11

After quite a bit of tinkering with the SAM update and permissions on my local .ssh and .config files, I got SAM to work enough to download the weather demo.
I get no audio when asking for the weather.
When I do the SAM watch, I get the same output as Vasco.

The “component didn’t respond”.

[22:08:27] Watching on localhost:1883 (MQTT)

[22:08:49] [Hotword] detected on site default, for model hey_snips

[22:08:49] [Asr] was asked to stop listening on site default

[22:08:49] [Hotword] was asked to toggle itself ‘off’ on site default

[22:08:49] [Dialogue] session with id ‘cd553bb7-4207-4f69-bad0-c65e1c9519ac’ was started on site default

[22:08:49] [AudioServer] was asked to play a wav of 41.1 kB with id ‘52c16a1f-1f59-4fab-8124-e8bf4b4ab95c’ on site default

[22:08:49] [AudioServer] finished playing wav with id ‘52c16a1f-1f59-4fab-8124-e8bf4b4ab95c’

[22:08:49] [Asr] was asked to listen on site default

[22:08:52] [Asr] captured text “weather” in 2.0s

[22:08:52] [Asr] was asked to stop listening on site default

[22:08:52] [AudioServer] was asked to play a wav of 93.1 kB with id ‘d2d0ff4e-76eb-4f94-8810-0240d39191f2’ on site default

[22:08:53] [AudioServer] finished playing wav with id ‘d2d0ff4e-76eb-4f94-8810-0240d39191f2’

[22:08:53] [Nlu] was asked to parse input “weather”

[22:08:53] [Nlu] detected intent searchWeatherForecast with confidence score 1.000 for input “weather

[22:08:53] [Dialogue] New intent detected searchWeatherForecast with confidence 1.000

[22:08:59] [Dialogue] session with id ‘cd553bb7-4207-4f69-bad0-c65e1c9519ac’ was ended on site default. The session was ended because one of the component didn’t respond in a timely manner

[22:08:59] [Asr] was asked to stop listening on site default

[22:08:59] [Hotword] was asked to toggle itself ‘on’ on site default

A look at sam status reveals the snips-skill-server is not running.

So, I ssh’d into the RPi and restarted the snips-skill-server.

Now, sound output is working.

We’ll see if I can now get my app to download and execute properly.

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#12

I managed to make it work (although not using actions)

I just installed hermes_python and wrote a python script with the following as example:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from hermes_python.hermes import Hermes

MQTT_IP_ADDR = "localhost"
MQTT_PORT = 1883
MQTT_ADDR = "{}:{}".format(MQTT_IP_ADDR, str(MQTT_PORT))

def intent_received(hermes, intent_message):
    sentence = ''

    if intent_message.intent.intent_name == 'SirBuildsALot7:hello':
        sentence += "Hello! How are you doing?"
    else:
        sentence += "Sorry, I can't help you with that"

    hermes.publish_end_session(intent_message.session_id, sentence)

with Hermes(MQTT_ADDR) as h:
    h.subscribe_intents(intent_received).start()

Running the script and speaking, will actually make the voice speak. Great, so now i can at least make an app with several intents and use the Python script to order to do whatever I want.

Its not what I was hoping to do with “actions” but its good enough for me!

1 Like
#13

I am still unable to get my action snippet to run.
I really want this to work as I’m looking at using this in a production environment.

Having a set of tools that are easy and reliable to work with are more important than just producing audio.

Oddly, after loading the demo and reloading my app with SAM, I don’t see my action code being called as before, see below.

I did a SAM status to determine that the Snips-skill-server was stopped, so I restarted.

Then, I triggered the app with the wake word.

I’ve also noticed that the LEDs do not work the same as before downloading the Demo.

I don’t think I should be seeing the weather-tts action being invoked at all.

BTW, I use the “Chappie” wake word so I will know that my app is starting, not the Demo.

pi@snips-base:~ $ sudo systemctl restart ‘snips-*’

pi@snips-base:~ $ journalctl -f -u snips-skill-server

– Logs begin at Fri 2019-03-22 19:17:02 GMT. –

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/.cache

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snips-app-relay-switch

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/snips-app-relay-switch/action-app_relay_switch.py”

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snips-skill-weather-tts

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: found action “/var/lib/snips/skills/snips-skill-weather-tts/action-weatherIntentTtsParser-weather.py”

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: [app_relay_switch][err] ./action-app_relay_switch.py:45: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.

Mar 22 22:18:24 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: [app_relay_switch][err] GPIO.setup(self.relay_pin, GPIO.OUT)

Mar 22 22:18:43 snips-base snips-skill-server[7531]: INFO:snips_skill_server_lib::runner: [weatherIntentTtsParser-weather][out] searchWeatherForecast

Mar 22 22:46:41 snips-base systemd[1]: Stopping Snips Skill Server…

Mar 22 22:46:41 snips-base systemd[1]: Stopped Snips Skill Server.

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#14

Charles,

Any help with this issue?

I still get the snips-skill-server hanging up with no idea why.

Writing python code as Vasco does to bypass the snips-skill-server is not a good answer.

It seems to me that something is causing the snips-skill-server to hang up.

I would suspect my action code if; it weren’t so simple and if others had not encountered the same problem.

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#15

Hi @Rod,

So to sum up,

  • You can see that the hotword is trigged
  • Your intent is detected
  • The action code callback does not hook to the intent to produce some actions

We can try to retrieve more logs to check what’s going on the snips-skill-server.

shutdown the service and start it manually with more verbosity.

sudo systemctl stop snips-skill-server
sudo -u _snips-skills snips-skill-server -vvv

Also, it is good to know that you can launch your action scripts without the snips-skill-server to ease the debug.

to do so:

cd /var/lib/snips/skills/your/skill/path
source your-venv/bin/activate
python your-script.py

A common mistake is to forget to add the complete intent name if you forked the app. (e.g for me, the weatherForecast intent become SakanaSan:weatherForecast)

Check snips-watch -vvv output to ensure that the intent id you provide in your script fit the one returned by the NLU.

#16

Hi @vascojdb,

I am just curious about,

What do you like to achieve?

#17

Charles,

More verbosity helped.

[15:53:14.681752] INFO :snips_skill_server_lib::runner: [rsheffield99-WhaleDiet-rsheffield99.VAL][err] IndentationError: unindent does not match any outer indentation level

It does look like I have the wrong action name, but I’m not sure how to change it.

Suggestions?

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#18

Charles,

I tried to launch the action w/o the snips-skill-server.

I got the indentation error and Googled that.

I appear to have errant ‘tabs’ in the snippet.

Any idea how I can resolve this?

I tried clearing tabs out in the Snips Console as follows (I also looked at the file in nano and can see that perhaps I don’t need line 1):

I downloaded the new action using the sam install actions command.

I get the following when I do that; not sure it is truly updating properly.

Setting up Python actions

Running setup.sh & generating virtual environment for rsheffield99.VAL

:heavy_multiplication_x: Error setting up virtualenv, one or more actions might not be able to run. Reason :

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

Running setup.sh & generating virtual environment for snips-app-relay-switch

:heavy_multiplication_x: Error setting up virtualenv, one or more actions might not be able to run. Reason :

You are using pip version 18.1, however version 19.0.3 is available.

You should consider upgrading via the ‘pip install --upgrade pip’ command.

Running setup.sh & generating virtual environment for snips-app-sht31

:heavy_multiplication_x: Error setting up virtualenv, one or more actions might not be able to run. Reason :

You are using pip version 18.1, however version 19.0.3 is available.

You should consider upgrading via the ‘pip install --upgrade pip’ command.

Running setup.sh & generating virtual environment for snips-skill-respeaker

setup.sh output:

make: Nothing to be done for ‘all’.

compile done

Running setup.sh & generating virtual environment for snips-skill-weather-tts

setup.sh output:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Requirement already satisfied: hermes_python==0.* in ./venv/lib/python3.5/site-packages (from -r requirements.txt (line 1)) (0.4.0)

Requirement already satisfied: future in ./venv/lib/python3.5/site-packages (from hermes_python==0.*->-r requirements.txt (line 1)) (0.17.1)

Requirement already satisfied: six in ./venv/lib/python3.5/site-packages (from hermes_python==0.*->-r requirements.txt (line 1)) (1.12.0)

Checking actions for end-user parameters

i Action snips-app-relay-switch contains end-user parameters that need to be configured

? Please enter a value for the parameter [mqtt_host] localhost

? Please enter a value for the parameter [mqtt_port] 1883

? Please enter a value for the parameter [site_id] default

i You can change these values later by editing the file located at /var/lib/snips/skills/snips-app-relay-switch/config.ini

:heavy_multiplication_x: cp: cannot create regular file ‘/var/lib/snips/skills/snips-app-relay-switch/config.ini’: Permission denied

:heavy_check_mark: Snips assistant is now running. Say chappie to start!

BTW, I did run pip update previously and get the following:

(venv) pi@snips-base:/var/lib/snips/skills/rsheffield99.VAL $ pip install --upgrade pip

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Requirement already up-to-date: pip in ./venv/lib/python2.7/site-packages (19.0.3)

(venv) pi@snips-base:/var/lib/snips/skills/rsheffield99.VAL $ python action-rsheffield99-WhaleDiet-rsheffield99.VAL.py

File “action-rsheffield99-WhaleDiet-rsheffield99.VAL.py”, line 37

current_session_id = intentMessage.session_id

                                            ^

IndentationError: unindent does not match any outer indentation level

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

#19

Hi Rod,

Hum, this one is tricky. Indeed is seems that a tab or a space is hiding somewhere.

Did you tried to edit the file directly on your Pi to check how it is formatted?

nano /var/lib/snips/skills/<your_skill_folder>/action-rsheffield99-WhaleDiet-rsheffield99.VAL.py

Maybe the best is just to restart anew in a new python 3 blank snippet.

Also, I noticed this on your sam logs:

cp: cannot create regular file ‘/var/lib/snips/skills/snips-app-relay-switch/config.ini’: Permission denied

It seems that the rights setting in you skills folder is incorrect and _snips or _snips-skills user is not allowed to do the operations needed.

The simplest way to fix that is to remove the folder, uninstall/reinstall the skill server.

rm -rf /var/lib/snips/skills
sudo apt remove snips-skill-server
sudo apt install snips-skill-server

If you are using the makers kit, and you’d like to have back the default action code check this repository.

About the deprecation warnings,

You should switch to python3 snippets. Python 2 support end in few months.
At some point the python2 support will be also removed from the console.

#20

Charles,

Thanks,

I reinstalled the snips-skills-server, re-entered the snippet as python3, and reinstalled the code.

Works! Getting TTS for my reply now.

Rod Sheffield

760-443-0103

rsheffield@zygodigital.com

1 Like