Rhasspy offline voice assistant toolkit

2.17.2? Also, multiple MQTT sites should work (comna separated).

The “Problems” tab is really helpful! I like the way the project is going to, with many improvements in usability.

But is there a way to ‘remove’ a problem message once it is solved? Now a red warning sign stays there while I already solved the problem.

Thanks!

Is the Problems tab gone? The warning sign should only be there if the tab is present, but I may have gotten it wrong. It checks the new (undocumented) /api/problems endpoint, which should have a list of every actor and their associated errors (if any).

The Problems tab is still there, complaining about “Unable to reach your Home Assistant server at http://pow:8123. Is it running?” I fixed the problem with Home Assistant and Rhasspy is now able again to talk to my Home Assistant server, but the problem message stays in the tab.

I have the same warning in the problems tab, but all works ok.
One thing: {tags} are now always returns as lowercase in the eventdata.
Something to keep in mind when things stop working :slight_smile:

I’m GET-ing the /api/ endpoint on Home Assistant to check if it’s up. The “fix” I just pushed adds in all the security stuff to that GET request (Hass.IO token, etc.). It worked fine on mine without that, but maybe your guys’ Home Assistants are more locked down?

The warning disappeared in the newest Docker release.

1 Like

Same here!

I am gonna try porcupine soon!

1 Like

Pocupine sounds very intresting. The biggest problem i had at the moment with snowboy and pocketsphinx were false positives while just talking or listening to radio/tv in the same room. Because of this my girlfriend banned my sattelite back to my office until this is sorted out :smiley:

As war as i understand with x86_64 you can generate a new keyword just using a cronjob every 3 weeks and you should be fine? Does rhasspy then needs a restart if the keyword file changed?

Cant wait to play arround with this.

But can i play it for testing?

It will, yes, because the Porcupine recognizer will have the old file loaded into memory. You could use curl in your cronjob to restart Rhasspy by POST-ing to the /api/restart endpoint and have it completely automated :slight_smile:

curl -X POST 'http://your-rhasspy-ip:12101/api/restart'

I’m not sure I understand exactly what you’re asking. If you upload a WAV file to Rhasspy, it will “play it back” internally as if a voice command was spoken and do all the stuff you would expect (contact your Home Assistant server, output to the websocket, etc.).

Is this what you mean?

Glitch here using playback over MQTT:

Rhasspy will publish WAV data on: hermes/audioServer/matrixvoice,default/playBytes/<REQUEST_ID>

Expected result:

Rhasspy will publish WAV data on:
hermes/audioServer/default/playBytes/<REQUEST_ID>
hermes/audioServer/matrixvoice/playBytes/<REQUEST_ID>

Better yet, why not use:
hermes/audioServer/+/playBytes/<REQUEST_ID>

The devices subscribed to the topic should check the siteID to see if the feedback is for them (or if needed a device can play all audio)

Wildcards can only be used to subscribe to MQTT topics, not to publish them. So your first suggestion is the one we need.

1 Like

Good point :smiley:

Fix should be in :slight_smile:

Had a chance to play with this again, is there a way to test the wake word function from the in-browser mic? I have my intents firing to home assistant and node-red but before I commit to buying some hardware I’d like to play around with the different wake words.

This is bloody awesome work by the way.

1 Like

It works now! And thanks for keeping the Docker image up-to-date too, that saves me a lot of trouble. With Watchtower I automatically get a new release of your Docker image every night if there’s an update, so every morning I can test the new features and/or bugfixes :slight_smile:

I just noticed another error in the latest version when publishing intents:

[ERROR:16890398] HomeAssistantIntentHandler: handle_intent
Traceback (most recent call last):
  File "/usr/share/rhasspy/rhasspy/intent_handler.py", line 104, in in_started
    intent = self.handle_intent(intent)
  File "/usr/share/rhasspy/rhasspy/intent_handler.py", line 145, in handle_intent
    self.forward_intent(event_type, slots)
  File "/usr/share/rhasspy/rhasspy/intent_handler.py", line 160, in forward_intent
    self._logger.debug("POSTed intent to %s with headers=%s" % (post_url, headers))
NameError: name 'headers' is not defined
1 Like

Hi, there seems to be a problem with porcupine and i cant get it to work.
I just updated my docker container, configured rhasspy:

"wake": {
    "porcupine": {
		"library_path": "porcupine/libpv_porcupine.so",
		"model_path": "porcupine/porcupine_params.pv",
		"keyword_path": "porcupine/porcupine.ppn",
		"sensitivity": 0.5
    },
    "system": "porcupine"
},
"rhasspy": {
	"listen_on_start": true
}

But it wont wake, mqtt mic and speaker work fine (snips-audio-server).
Manually waking Rhasspy with the gui shows the following Python error:

[ERROR:80243] PorcupineWakeListener: loading wake handle
Traceback (most recent call last):
  File "/usr/share/rhasspy/rhasspy/wake.py", line 692, in in_started
    self.load_handle()
  File "/usr/share/rhasspy/rhasspy/wake.py", line 749, in load_handle
    sensitivities=self.sensitivities,
  File "/usr/share/rhasspy/porcupine.py", line 69, in __init__
    library = cdll.LoadLibrary(library_path)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /profiles/en/porcupine/libpv_porcupine.so: failed to map segment from shared object

Im running Rhasspy-Server in docker on a linux, amd64 system:

`Linux OMS-THOS-NAS 4.19.0-0.bpo.2-amd64 #1 SMP Debian 4.19.16-1~bpo9+1 (2019-02-07) x86_64 GNU/Linux`

After switching to porcupine wakeword detection rhasspy downloaded the necessary files.

Update:
Found another error while playing WAV files through nodered that did not happen before:

[ERROR:3741387] __main__: 'utf-8' codec can't decode byte 0x80 in position 24: invalid start byte
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask_sockets.py", line 40, in __call__
handler, values = adapter.match()
  File "/usr/local/lib/python3.6/dist-packages/werkzeug/routing.py", line 1786, in match
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1832, in full_dispatch_request
rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1818, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File "app.py", line 370, in api_play_wav
url = request.data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 24: invalid start byte

This occurs while trying to send wav audio to the api using node-red.
im loading the wav file and output to the api is “single buffered object”. This worked before but now creates this error.
Playing the file manually using curl still works:

curl -X POST "http://127.0.0.1:12101/api/play-wav" -H "Content-Type: audio/wav" --data-binary @"/dockerdata/nodered/kitchen-timer.wav"

Hi @ntuseracc, I have been thinking about your problems with hermes-audio-server: are you using TLS for the connection to the MQTT broker?