[App] Weather + DarkSky (GERMAN)

Query weather from now till +7 days from www.darksky.net

App: https://console.snips.ai/store/de/skill_lyXWObV8NA8

Github actions + manual: https://github.com/patrickjane/snipsweather

1 Like

Hi,

I tried your App but with no positive result.
I have a DarkSky API.

But when I ask snips “Wie wird das Wetter morgen” the Session is ended and the MQTT log show me “The session was ended because one of the component didn’t respond in a timely manner” withoud saying anything. Can you help me?

Thanks in advance
Joachim

Hey thanks for the feedback. When did you install the app? I’ve had a couple of changes yesterday, and in between it might have been in a non-functional state. Can you try to update the app/assistant and see how it works?

Other than that, the following steps might help boiling down the problem, assuming you’re having a standard linux installation:

  1. On your snips-machine, do tail -f /var/log/syslog
  2. In another terminal, on your snips-machine, do sudo systemctl restart snips-skill-server
  3. Check if the skill server complains about my app or not
  4. Speak the command, and see if the skill server complains about my app or not

Even more analysis is possible with manually starting the app, like this (all on your snips-machine):

  1. sudo systemctl stop snips-skill-server
  2. cd /var/lib/snips/skills/snipsweather
  3. source venv/bin/activate
  4. python action-s710-weather.py (this blocks)
  5. speak your command, and check if there is any unexpected output

Afterwards make sure to start the skillserver again (sudo systemctl start snips-skill-server).

Please note that the git repository in /var/lib/snips/skills/snipsweather should be on the latest commit (see https://github.com/patrickjane/snipsweather).

Also I am aware that there might still be glitches in the app, I will try to resolve any problems as soon as I can. Doing the above steps will help me track down the issue and fix it :slight_smile:

Thank you for your answer.

I Installed the app at Friday. I tried to update the app but the result is the same.

The syslog is showing this when I restart the skill server:

Sep 15 19:50:34 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: searching dir for actions: /var/lib/snips/skills/snipsweather
Sep 15 19:50:34 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: found action "/var/lib/snips/skills/snipsweather/action-s710-weather.py"
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err] Traceback (most recent call last):
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "./action-s710-weather.py", line 564, in <module>
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     app = App()
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "./action-s710-weather.py", line 106, in __init__
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     self.start()
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "./action-s710-weather.py", line 127, in start
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     with Hermes(mqtt_options = MqttOptions(broker_address = self.mqtt_host, username = self.mqtt_user, password = self.mqtt_pass)) as h:
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "/var/lib/snips/skills/snipsweather/venv/lib/python3.5/site-packages/hermes_python/hermes.py", line 51, in __enter__
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     return self.connect()
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "/var/lib/snips/skills/snipsweather/venv/lib/python3.5/site-packages/hermes_python/hermes.py", line 59, in connect
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     self.ffi.establish_connection(self.mqtt_options)
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "/var/lib/snips/skills/snipsweather/venv/lib/python3.5/site-packages/hermes_python/api/ffi/__init__.py", line 26, in establish_connection
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     c_mqtt_options = CMqttOptions.from_repr(mqtt_options)
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "/var/lib/snips/skills/snipsweather/venv/lib/python3.5/site-packages/hermes_python/ffi/ontology/__init__.py", line 101, in from_repr
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     repr.tls_client_cert, repr.tls_disable_root_store)
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]   File "/var/lib/snips/skills/snipsweather/venv/lib/python3.5/site-packages/hermes_python/ffi/ontology/__init__.py", line 82, in build
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err]     broker_address = broker_address.encode('utf-8')
Sep 15 19:50:36 SprachPi snips-skill-server[1453]: INFO:snips_skill_server_lib::runner: [s710-weather][err] AttributeError: 'NoneType' object has no attribute 'encode'

Can work with this Informations?

there seems to be issues with the MQTT config.
Is your /etc/snips.toml in place, and does it contain the MQTT details?

It must at least contain the parameter mqtt in the section snips-common.

I don´t find my problem. I looked in the /etc/snips.toml and compared it to the one I found in the documentation, but it looked right. Here is my snips.toml file: Maybe you can find my problem.

[snips-common]
# bus = "mqtt"
# mqtt = "localhost:1883"
# audio = ["+@mqtt"]
# assistant = "/usr/share/snips/assistant"
# user_dir = "/var/lib/snips"

## MQTT authentication
# mqtt_username = ""
# mqtt_password = ""

## MQTT TLS configuration
# mqtt_tls_hostname = ""
# mqtt_tls_disable_root_store = false
# mqtt_tls_cafile = ""
# mqtt_tls_capath = ""
# mqtt_tls_client_cert = ""
# mqtt_tls_client_key = ""

[snips-analytics]

[snips-asr]
# no_fst_map = true
# beam_size = 8
# model = "/usr/share/snips/asr"
# audio = ["+@mqtt"]
# partial = false
# partial_period_ms = 250

[snips-asr-google]
# credentials = "/usr/share/snips/googlecredentials.json"
# audio = ["+@mqtt"]

[snips-audio-server]
# frame = 256
# bind = "default@mqtt"
# mike = "Built-in Microphone"
# disable_playback = false
# disable_capture = false

[snips-dialogue]
# resources = "/usr/share/snips/dialogue"
# session_timeout = 15
# lambda_timeout = 5
# retry_count = 3
# sound_feedback_disabled_default = false

[snips-hotword]
# model = "/usr/share/snips/hotword"
# hotword_id = "default"
# sensitivity = "0.5"
# audio = ["+@mqtt"]
# no_vad_inhibitor = false
# vad_messages = false

[snips-injection]
#asr_model = "/usr/share/snips/asr"
#nlu_engine = "/usr/share/snips/nlu_engine"
#keep_nfirst = 3

[snips-nlu]

[snips-tts]
## Choose one tts provider (defaults to picotts)
# provider = "picotts"
# provider = "makerstts"
# provider = "customtts"
## customtts specific configuration (here configured to use picotts using the e$
## available placeholder variables : %%OUTPUT_FILE%%, %%LANG%%, %%TEXT%%
# customtts = { command = ["pico2wave", "-w", "%%OUTPUT_FILE%%", "-l", "en-US",$

[snips-pegasus]
# address = "0.0.0.0:8443"
## Pegasus TLS configuration
## Self signing certificates are generated with /usr/local/bin/snips-pegasus-tl$
# tls_certificate_chain = "/var/lib/snips/pegasus/tls/server.fullchain"
# tls_private_key = "/var/lib/snips/pegasus/tls/server.key"

Replace # mqtt = "localhost:1883" with mqtt = "localhost:1883" (= remove the leading #).
Then it will work. The # means the line is a comment (= disabled/ignored).

I am currently on holiday, when i am back i will adjust the app so that localhost is used as default when /etc/snips.toml is empty.

For now, the above change will fix your problem.

Thank you very much, now your app is working. Thank you for your support.:+1:

FYI: I’ve just published an update and you should no longer require the (default) configuration of MQTT in your /etc/snips.toml.
The app will however still use it whenever it is present, so that non-default locations of the MQTT server will work.