Connection to MQTT server doesn't happen

Hi everybody,

I have a docker container running rhasspy version 2.4.20. It looks like this is the newest version available as container as far as I can tell (even though version 2.5 is mentioned on the start page).

I have managed to get audio working and defined some intents which are recognized. But I expect it to broadcast the results to an (external) MQTT server. That server is fully functional, many other systems are connecting to it.

However it looks like it’s not connecting. The server has no mention of Rhasspy’s IP address. And in Rhasspy’s log I cannot find any mention of MQTT.

In addition on the webpage of Rhasspy this is under problems:
HermesMqtt FileNotFoundError

Could this have anything to do with it?

Does anybody have an idea on how to proceed with troubleshooting?

This is the MQTT config. Could the certificate have the wrong format (may it asks for a filepath instead):

Ca certs should be a filename.

But please try Rhasspy 2.5. It’s the rhasspy/rhasspy Docker image, as explained in the documentation:

https://rhasspy.readthedocs.io/en/latest/installation/

In addition to koan: it is a file path indeed.
Hence the error: FileNotFoundError

I had actually already tried to upgrade the container to v 2.5 yesterday with
docker pull rhasspy/rhasspy

That had seemingly worked, but the version number on the config webpage is now at 2.4.20 (I believe it was lower before, so some upgrade was done). I just tried to update it again:

pi@raspberrypi11:/etc/ssl/certs $ docker pull rhasspy/rhasspy
Using default tag: latest
latest: Pulling from rhasspy/rhasspy
Digest: sha256:7ad16678074d1431872f12e1010961d5134d0af658fb6bac3a1c33ce18cb09be
Status: Image is up to date for rhasspy/rhasspy:latest
docker.io/rhasspy/rhasspy:latest
pi@raspberrypi11:/etc/ssl/certs $

That feels like the offered container image isn’t at 2.5…

About the CA certificate / file:
I’m quite firm with Linux, but don’t really use Docker myself at all other than for Rhasspy. Where do I put the CA file? I’ve put it somewhere in the host’s filesystem, that didn’t work. I then remembered it’s docker, and the container probably can’t see that path.
Then I copied it inside the container:

pi@raspberrypi11:/etc/ssl/certs $ docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                      NAMES
33ce64ae6710        synesthesiam/rhasspy-server:latest   "/run.sh --user-profâ¦"   4 months ago        Up 9 hours          0.0.0.0:12101->12101/tcp   serene_shockley
pi@raspberrypi11:/etc/ssl/certs $ docker cp /home/pi/root_cert_base64.crt 33ce64ae6710:/

Now using “/root_cert_base64.crt” as path isn’t working either.

Do you guys have an idea why this keeps failing (version 2.5 upgrade and the CA file path)?

For the update:

After pulling the latest Rhasspy image, your Rhasspy container is still based on the old image. So to apply the update to your running Rhasspy instance, you also have to:

  • Stop the container: docker stop rhasspy

  • Remove the container: docker rm rhasspy

  • Create the container again with your original docker run command.

After this, the Rhasspy container is running from the newest image you downloaded with the docker pull command.

For the CA certificate:

You can put it in your $HOME/.config/rhasspy/profiles, which is mounted on /profiles in the container. Then you can refer to the file as /profiles/root_cert_base64.crt.

Thanks! But I’m afraid neither is working…

pi@raspberrypi11:/etc/ssl/certs $ docker pull rhasspy/rhasspy
Using default tag: latest
latest: Pulling from rhasspy/rhasspy
Digest: sha256:7ad16678074d1431872f12e1010961d5134d0af658fb6bac3a1c33ce18cb09be
Status: Image is up to date for rhasspy/rhasspy:latest
docker.io/rhasspy/rhasspy:latest
pi@raspberrypi11:/etc/ssl/certs $ docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                      NAMES
33ce64ae6710        synesthesiam/rhasspy-server:latest   "/run.sh --user-profâ¦"   4 months ago        Up 15 hours         0.0.0.0:12101->12101/tcp   serene_shockley
pi@raspberrypi11:/etc/ssl/certs $ docker stop 33ce64ae6710
33ce64ae6710
pi@raspberrypi11:/etc/ssl/certs $ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
pi@raspberrypi11:/etc/ssl/certs $ docker rm 33ce64ae6710
33ce64ae6710
pi@raspberrypi11:/etc/ssl/certs $ docker run -d -p 12101:12101       --restart unless-stopped       -v "$HOME/.config/rhasspy/profiles:/profiles"       --device /dev/snd:/dev/snd       synesthesiam/rhasspy-server:latest       --user-profiles /profiles       --profile de
fb1be7da38a24d740507af351b7c8bd79b00fa8b48ef323ef39a2d9c5d7acda6
pi@raspberrypi11:/etc/ssl/certs $ docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                      NAMES
fb1be7da38a2        synesthesiam/rhasspy-server:latest   "/run.sh --user-profâ¦"   46 seconds ago      Up 29 seconds       0.0.0.0:12101->12101/tcp   hopeful_stonebraker
pi@raspberrypi11:/etc/ssl/certs $ cd ~/.config/rhasspy/
pi@raspberrypi11:~/.config/rhasspy $ cd profiles/
pi@raspberrypi11:~/.config/rhasspy/profiles $ ls -l
total 4
drwxr-xr-x 7 root root 4096 Jul  6 19:54 de
pi@raspberrypi11:~/.config/rhasspy/profiles $ sudo cp /home/pi/root_cert_base64.crt .
pi@raspberrypi11:~/.config/rhasspy/profiles $ ls -l
total 8
-rw-r--r-- 1 root root 3976 Sep 18 13:59 root_cert_base64.crt
drwxr-xr-x 7 root root 4096 Jul  6 19:54 de
pi@raspberrypi11:~/.config/rhasspy/profiles $ ls -l
total 8
-rw-r--r-- 1 root root 3976 Sep 18 13:59 root_cert_base64.crt
drwxr-xr-x 7 root root 4096 Jul  6 19:54 de

The ID of the container has obviously changed, so it must be a new one. But neither has its version changed nor can it find the certificate file.

You wouldn’t happen to have more ideas in your hat? :slight_smile:

You still are running the old docker container since the repository changed.
You need to run rhasspy/rhasspy:latest instead of the old version synesthesiam/rhasspy-server:latest

https://hub.docker.com/r/rhasspy/rhasspy/tags

Additionally you can give your container names which would make it easier to stop/remove/start them.

So your command would be:
docker run -d -p 12101:12101 --name rhasspy --restart unless-stopped -v "$HOME/.config/rhasspy/profiles:/profiles" --device /dev/snd:/dev/snd rhasspy/rhasspy:latest --user-profiles /profiles --profile de

Cool, the was the last component that did the trick. Thanks a lot to all of you!

After that the version was up-to-date and the MQTT connection is also working now (without deviating from the CA file path used earlier…).

The downside: I could cry. Audio recording stopped working after the upgrade :frowning:

pi@raspberrypi11:~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default
mic
speaker
array
channel_1
channel_2
channel_3
channel_4
channel_5
channel_6
channel_7
channel_8
all_channels
sysdefault:CARD=Headphones
bcm2835 Headphones, bcm2835 Headphones
Default Audio Device
dmix:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct sample mixing device
dsnoop:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct sample snooping device
hw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
bcm2835 Headphones, bcm2835 Headphones
Hardware device with all software conversions
sysdefault:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
dmix:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample snooping device
hw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Hardware device with all software conversions
sysdefault:CARD=Device
USB2.0 Device, USB Audio
Default Audio Device
front:CARD=Device,DEV=0
USB2.0 Device, USB Audio
Front speakers
surround21:CARD=Device,DEV=0
USB2.0 Device, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
USB2.0 Device, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
USB2.0 Device, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
USB2.0 Device, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
USB2.0 Device, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
USB2.0 Device, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
USB2.0 Device, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Device,DEV=0
USB2.0 Device, USB Audio
Direct sample mixing device
dsnoop:CARD=Device,DEV=0
USB2.0 Device, USB Audio
Direct sample snooping device
hw:CARD=Device,DEV=0
USB2.0 Device, USB Audio
Direct hardware device without any conversions
plughw:CARD=Device,DEV=0
USB2.0 Device, USB Audio
Hardware device with all software conversions
dmix:CARD=MATRIXIOSOUND,DEV=1
MATRIXIO-SOUND,
Direct sample mixing device
dsnoop:CARD=MATRIXIOSOUND,DEV=1
MATRIXIO-SOUND,
Direct sample snooping device
hw:CARD=MATRIXIOSOUND,DEV=1
MATRIXIO-SOUND,
Direct hardware device without any conversions
plughw:CARD=MATRIXIOSOUND,DEV=1
MATRIXIO-SOUND,
Hardware device with all software conversions

pi@raspberrypi11:~ $ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default
mic
speaker
array
channel_1
channel_2
channel_3
channel_4
channel_5
channel_6
channel_7
channel_8
all_channels
sysdefault:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
dmix:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample snooping device
hw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Hardware device with all software conversions
sysdefault:CARD=MATRIXIOSOUND
MATRIXIO-SOUND,
Default Audio Device
dmix:CARD=MATRIXIOSOUND,DEV=0
MATRIXIO-SOUND,
Direct sample mixing device
dsnoop:CARD=MATRIXIOSOUND,DEV=0
MATRIXIO-SOUND,
Direct sample snooping device
hw:CARD=MATRIXIOSOUND,DEV=0
MATRIXIO-SOUND,
Direct hardware device without any conversions
plughw:CARD=MATRIXIOSOUND,DEV=0
MATRIXIO-SOUND,
Hardware device with all software conversions
pi@raspberrypi11:~ $

The exact same device is configured that I had used with the older version.That was

plughw:CARD=MATRIXIOSOUND,DEV=0

I can use it to make a recording from the command line (as long as the container is stopped; while it is running I get something like device busy) and I can also play the recording on the playback device.

I believe playback is working from within Rhasspy, at least I can have TTS speak something. The beeps however would only be played after the keyword is recognized.

I’ve tested all devices containing “Matrix” in their name (via arecord) as well as tried pyaudio.
When clicking the “test” button next to the recording device I get a timeout for pyaudio and pretty much nothing for arecord (the “testing” message just disappears with neither a positive nor a negative result).

Does anybody have an idea why that is or what may have changed between Rhasspy versions in that regard?

What does this device parameter do?

docker run -d -p 12101:12101 --name rhasspy --restart unless-stopped -v “$HOME/.config/rhasspy/profiles:/profiles” --device /dev/snd:/dev/snd rhasspy/rhasspy:latest --user-profiles /profiles --profile de

The docker documentation says --device Add a host device to the container, but that doesn’t tell me much.

This gives the container access to the device of your host operating system. /dev/snd is actually a directory with device nodes in it, so it gives the Rhasspy container access to all sound devices.

I can’t help you with the issue you are experiencing, though. I don’t have a Matrix device.

I appreciate the responses so far. The original problem is solved. Thanks again to all of you!

Looks like I’m not the only one experiencing the problem in which that particular microphone doesn’t work in version 2.5 or above: Matrix Voice on 2.5.1?

And for those who care - the ca_certs problem is described in detail here: External MQTTS Broker - 8883 using TLS?
It really doesn’t work below 2.5.