project-alice-assistant / HermesLedControl

Provides an easy way to control your leds in an Hermes environment
GNU General Public License v3.0
83 stars 41 forks source link

MQTT port broken since v2.0.13 #100

Closed urbatecte closed 2 years ago

urbatecte commented 3 years ago

Do not remove fields, answer them, otherwise your bug will be reported as invalid and closed

How I did start SLC, with what arguments Default launch ExecStart=/home/pi/hermesLedControl_v2.0.13/venv/bin/python3 main.py --hermesLedControlConfig=/home/pi/.config/hermesLedControl/configuration.yml

Led device name "ReSpeaker 2" and or "ReSpeaker 2"

The bug new Rhasspy.py file change MQTT port to 12183 that may match to the internal Rhasspy MQTT one but not for external one. I had to change it manually to get back to the 1883. Another issue I've find out is, still in the Rhasspy.py file the Rhasspy profile is hard coded and by the way is pointing to a english profile where as the link to the Rhappy profile is asked during HLC config. After updating both MQTT port and link to Rhasspy profile (form my case /home/pi/.config/rhasspy/profiles/fr/profile.json) everything work flawlessly !

Debug output Unfortunatly I don't have this output anymore but 1st issue n debug was the link to Rhasspy profile that lead to an error. 2nd one was the MQTT port that lead to unable join MQTT server error.

To Reproduce Steps to reproduce the behavior In the Rhasspy config, set a external MQTT with port different than 12183. In Rhasspy as well, select a profle different than 'en'

Psychokiller1888 commented 3 years ago

Ok, I need some explanation here, as I have never used Rhasspy...

If you have some non common params, why don't you override the port with the arguments?

urbatecte commented 3 years ago

The profle.json give the Rhasspy params. The Rhasspy.py in HLC parse it to get the appropriate param (instead of launchng HLC with dedicated param). I rely on the issue I've open on Rhasspy side to get back to you with a PR (t will be my 1st one ! In between I will have a look regarding the profile path hardcoded instead of usng the requested path during HLC config. Cheers

kevinbischof commented 3 years ago

I'm facing the same issue in point of mqtt server. I'm also using rhasspy. My MQTT port is also 1883 and not 12183. It would be good if a custom port could be set for example in the configuration.yml.

Chreece commented 3 years ago

I'm facing the same issue in point of mqtt server. I'm also using rhasspy. My MQTT port is also 1883 and not 12183. It would be good if a custom port could be set for example in the configuration.yml.

I hope you have already resolved this, since there is an option to add Mqtt Port in configuration.yml But I haven't yet figured out why the port given in rhasspy isn't the one that HermesLedControl is using. @Psychokiller1888 can you find out why mqtt user and password are extracted from profile.json but not the port? I also use a non en profile in rhasspy...

Chreece commented 3 years ago

ok the problem is on rhasspy's site... I just saw that there wasn't any port saved in profile.json but in the web ui there was the 1883 standing... Maybe that's the default for rhasspy and not needed to be saved in profile.json?

Psychokiller1888 commented 3 years ago

I cannot find it out, I'm not using Rhasspy.... But 1883 is the default mqtt port. My problem is that the guy that implemented Rhasspy configs, implemented it with another default port:

configs['mqttPort'] = conf['mqtt'].get('port', 12183) as seen here https://github.com/project-alice-assistant/HermesLedControl/blob/master/models/engines/Rhasspy.py

So, what does Rhasspy use?

donburch888 commented 3 years ago

I have seen Rhasspy use both 1883 and 12183.

Rhasspy documentation for the Docker install method shows port 12183 opened.

I don't see advantage to adding extra processing on a dedicated low-powered satellite, so I have personally done the Debian install method (not their recommended Docker install - this probably makes a difference), and noticed: (a) Rhasspy installs and enables mosquitto service (on port 12183) at the beginning of its initial configuration; (b) In Rhasspy's web interface under MQTT section, the MQTT port field by default displays value 1883 - but it doesn't get written to profile.json unless it is changed. (c) the local mosquitto service remains enabled even after the user changes to use an External MQTT server.

I have manually added Port: 1883 to mqtt section in Rhasspys ~/.config/rhasspy/profiles/en/profile.json

    "mqtt": {
        "enabled": "true",
        "host": "192.168.1.98",
        "port": "1883",
        "username": "rhasspy"
        "password": "passwd",
        "site_id": "sat-2",
    },

which has fixed the issue.