Firefox cannot establish connection with 192.168.1.7:12101

Hey,

I configure a docker container with this :

docker run -p 12101:12101
-p 12183:12183
-v “$HOME/.config/rhasspy/profiles:/profiles”
-v “/etc/localtime:/etc/localtime:ro”
-d --restart unless-stopped
–device /dev/snd:/dev/snd
–name rhasspy
rhasspy/rhasspy
–user-profiles /profiles
–profile fr

When i try to connect Rhasspy using local host (form an other computer), the port seems to be unreacheable.
I have a connection with ssh between my computer and the RPi, so the local address is good.
Thank you
Damien

prob better to try some of the docker utils docker ps lists running containers as really if that is running and the pi IP is as above it should work.

Thanks, here my command with docker ps (i stoped, removed, relaunched docker container rhasspy) :

pi@raspberrypi:~ $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3a61b325de0f rhasspy/rhasspy “bash /usr/lib/rhass…” About a minute ago Up About a minute 0.0.0.0:12101->12101/tcp, :::12101->12101/tcp, 0.0.0.0:12183->12183/tcp, :::12183->12183/tcp rhasspy

1 Like

Docker can be a bit daunting until you know just 2 commands.
1st the above and 2nd docker exec -it <container name> /bin/bash

That allows you to connect to the docker container just as you would SSH to your pi but just run from the host.
Everything is needed to reside in the container asound.conf to installed apps and also the journal is there.
Or in the docker run you have create an explicit share in source:destination fashion as -v “/etc/localtime:/etc/localtime:ro” did from the above run.

Ok, you propose to log inside docker to check what’s wrong ?
Sorry, i don’t undestand your mind :
1- the docker ps shows ports 12101 and 12183 are available
2- i can connect to the rpi (via SSH) on 192.168.1.7
So if the IP is available and the ports open, why 192.168.1.7:12101 isn’t available ?

pi@raspberrypi:~ $ sudo netstat -antp
Connexions Internet actives (serveurs et établies)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 493/sshd
tcp 0 0 0.0.0.0:12183 0.0.0.0:* LISTEN 807/docker-proxy
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 372/cupsd
tcp 0 0 0.0.0.0:12101 0.0.0.0:* LISTEN 828/docker-proxy
tcp 0 208 192.168.1.7:22 192.168.1.100:52519 ESTABLISHED 1340/sshd: pi [priv
tcp6 0 0 :::22 :::* LISTEN 493/sshd
tcp6 0 0 :::12183 :::* LISTEN 815/docker-proxy
tcp6 0 0 ::1:631 :::* LISTEN 372/cupsd
tcp6 0 0 :::12101 :::* LISTEN 837/docker-proxy

If this can help, ther first bug report when installing with -it (seems mosquitto is wrong, but why such a message in a docker instance ?) :

[DEBUG:2021-06-06 17:24:00,440] rhasspydialogue_hermes: Connecting to 192.168.1.7:1883
Traceback (most recent call last):
File “/usr/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/usr/lib/rhasspy/rhasspy-dialogue-hermes/rhasspydialogue_hermes/main.py”, line 108, in
main()
File “/usr/lib/rhasspy/rhasspy-dialogue-hermes/rhasspydialogue_hermes/main.py”, line 92, in main
hermes_cli.connect(client, args)
File “/usr/lib/rhasspy/rhasspy-hermes/rhasspyhermes/cli.py”, line 93, in connect
client.connect(args.host, args.port)
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 937, in connect
return self.reconnect()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 1071, in reconnect
sock = self._create_socket_connection()
File “/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/paho/mqtt/client.py”, line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File “/usr/lib/python3.7/socket.py”, line 727, in create_connection
raise err
File “/usr/lib/python3.7/socket.py”, line 716, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Not to log in the docker container but the logs are in the docker container and the container journal can often be a source of info.

Dunno why its not connecting you sure you don’t have a firewall running? As not sure Damien why only 12101 isn’t available ? :confused:

Thanks, and sorry for my heaviness, with sudo journalctl CONTAINER_NAME=rhasspy i have :

juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,106] rhasspyasr_kaldi_hermes: Loading Kaldi model from /profiles/fr/kaldi/model (g
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,109] asyncio: Using selector: EpollSelector
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,117] rhasspyasr_kaldi_hermes: Connecting to 192.168.1.7:1883
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,135] asyncio: Using selector: EpollSelector
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,138] asyncio: Using selector: EpollSelector
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,146] rhasspywake_raven_hermes: Listening for keyword Bienchessoi (probability_thre
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,146] rhasspywake_raven_hermes: Connecting to 192.168.1.7:1883
juin 08 21:13:21 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:21,154] asyncio: Using selector: EpollSelector
juin 08 21:13:25 raspberrypi 2987bd8ea03e[912]: [DEBUG:2021-06-08 21:13:25,388] rhasspyserver_hermes: Connecting to 192.168.1.7:1883 (retries: 0/10)

For the firewall, i think, if one works, then i couldn’t connect in SSH to the RPi. Considering your question, I’m probably wrong… :frowning:

And my command docker :

docker run -p 12101:12101
-p 1883:1883
-v “$HOME/.config/rhasspy/profiles:/profiles”
-v “/etc/localtime:/etc/localtime:ro”
-d --restart unless-stopped
–device /dev/snd:/dev/snd
–name rhasspy
rhasspy/rhasspy
–user-profiles /profiles
–profile fr

I never noticed that but why 2 ports?

docker run -d -p 12101:12101 \
      --name rhasspy \
      --restart unless-stopped \
      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      -v "/etc/localtime:/etc/localtime:ro" \
      --device /dev/snd:/dev/snd \
      rhasspy/rhasspy \
      --user-profiles /profiles \
      --profile en

but still confused @ 192.168.1.7:1883? I presume that is the websever not the mqqt

@synesthesiam @romkabouter

You can expose the port 12183 on Docker to be able to connect outside the docker container.
12183 is used for internal MQTT if settings in Rhasspy are internal (the default)

If you do not need it, I suggest using the docker command from the docs:
https://rhasspy.readthedocs.io/en/latest/installation/

docker run -d -p 12101:12101 \
      --name rhasspy \
      --restart unless-stopped \
      -v "$HOME/.config/rhasspy/profiles:/profiles" \
      -v "/etc/localtime:/etc/localtime:ro" \
      --device /dev/snd:/dev/snd \
      rhasspy/rhasspy \
      --user-profiles /profiles \
      --profile fr

Thanks everybody for yours advices !

My goal is to reach the internal MQTT broker from outside Docker (why install an other broker if Rhasspy propose one?).

In the Rhasspy docs, i have :

If you’re running Rhasspy inside Docker, make sure to add -p 12183:12183 to expose this port

It’s what i expect to do in my first post : expose two ports (@rolyan_trauts). One for Rhasspy web interface (12101), and one for MQTT interface (12183 @romkabouter).

Unfortunately I can reach none of them.

Then i tried the 1883 in order to listen a MQTT Topic (french) :

Snips - Ecouter un topic MQTT - Coxprod DIY

So, the problem is still there :

  • I can connect to 192.168.1.7 via SSH
  • connection failed with http://192.168.1.7:12101/
    I’m very confused, with my problem, but Until I tried to open 2 ports, everythings was working…
    I uninstall image and instances of rhasspy, even uninstall docker (windows practice :frowning: ).
    I hope my question is clear…