@MS2000 wrote:
Migrating from Hassbian, I decided to go the venv route with Raspbian Lite and install HA v0.101.3 (not Hassio). HA is working fine, however, after setting up Mosquitto MQTT locally I hit a wall.
For info, I installed Mosquitto using the following method:
sudo apt-get install mosquitto -y
sudo apt-get install mosquitto-clients -y
Edited the configuration file:
sudo nano /etc/mosquitto/mosquitto.conf
Removed the whole ‘include_dir’ line, and replaced with:
allow_anonymous false password_file /etc/mosquito/pwfile listener 1883
Created the password file:
sudo mosquitto_passwd -c /etc/mosquitto/pwfile UserMQTT
and gave a password.Then I edited the auto-start script for HA to add the service in:
sudo nano /etc/systemd/system/home-assistant@homeassistant.service
In the [Unit} section changed the second line to read as:
After=network-online.target mosquitto.service
Saved and ran:
systemctl status mosquitto.service
And at first, it worked -said it was running.Then I ‘sudo rebooted’ and the problems started. After logging in I tested the install with:
sudo systemctl status mosquitto
And it came up with an error:
I tried:
sudo systemctl start mosquitto
and got:
Job for mosquitto.service failed because the control process exited with error code.
See “systemctl status mosquitto.service” and “journalctl -xe” for details.When I tried the log:
mosquitto -c /etc/mosquitto/mosquitto.conf
1573511140: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.
journalctl -u mosquitto
I also tried to reinstall it over itself but this didn’t change the conf. So the service won’t run from either an auto start or manually. I’m not sure what I’ve done wrong?
Is it that the broker must be installed inside the venv?
Is it a permissions thing?
Or have I missed something obvious?Any help is much appreciated
Posts: 3
Participants: 3