I have two instances of mosquitto, need help removing @root

I had my Pi3 originally with mosquitto MQTT. Now I have taken the leap and installed HA via ALL-IN-ONE installer. So, now it is in the virtual environement. how do I remove the one at root without disrupting for HA?

Then I have to work on properly configuring it to work within HA. Thankfully, that has been done already here; Mosquitto setup

mosquitto is not a python program, so it has nothing to do with virtual environments, which are purely to do with the versions of python dependencies.

Are you sure you have two versions of mosquitto installed? I would think that the AIO installer would just try and install from apt-get, which is what you would have done, and will not result in any change.

What symptoms are you getting?

And how did you install mosquitto previously?

sudo apt-get install mosquitto mosquitto-clients
everything worked well (mosquitto_pub, moquitto_sub)

Then, I installed the HA AIO. Now the same pub/sub commands don’t work.

So what errors do you get? It could be aio installed a different config file and changed the username or password.

Thank you as well for offering assistance. My apologies… I thought I sent error codes as well: here

I even tried this command: sudo mosquitto_passwd /etc/mosquitto/pwfile pi
So I’m assuming now when I pub/sub… I have to type credentials each time?

I just looked at the /etc/mosquitto/mosquitto.conf file and commented out


Saved the file and rebooted the pi. still no dice.

wait… I just found another instance of mosquitto.conf.
/fabric-home-assistant/mosquitto.conf

Hmmmm. Now I get it. I was wrong… It looks more like I have 2 instances of home-assistant.
Now I remember I had issues installing HA manually. It asked for a user name, password. Nothing seemed to work, So I then followed the HA All-In-One install and that worked.

So, this is what I was thinking. Maybe a fresh SD install and configure Raspbian-stretch, then reinstall HA. I am sooo confused. there are so many HA install methods. what is the most up-to-date? HA AIO, HASSio, HASBIAN? The AIO install worked. Should I just stick with that? And then go back to configuring mosquitto?

No, I don’t think I even have to go there. Modified the configuration.yaml in /home/homeassistant/.homeassistant

Just changed the home titlte to make sure it was the right file. We’re good. What is fabric-home-assistant? I think that was from the manual install.

Your thoughts, advice are greatly appreciated. Nick

I’ve not heard of that.

The output of sudo service mosquitto status shows the configuration file being used is /etc/mosquitto/mosquitto.conf. which is normal. For comparison, here is mine

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

I don’t use username/password. Something may be installed in files in /etc/mosquitto/conf.d which will also be used.

what’s the worst thing that could happen if I remove the “fabric-home-assistant” directory?
Worst case scenario is I reformat the sd with new rasbian-stretch and redo the all-in-one install.

Going for it!

Reading through the mosquitto.conf file, a lot of trial and error, I was able to turn off authentication and via ssh: turn on/off my mqtt outlet. YAY. Progress and a little better understanding of Linux.

Now to add it to the assistant “desktop” “home” or whatever you call it

YES!!! My 1st Module added.

1 Like

Quick question,… After editing and saving the YAML file. Do I need to reboot the pi each time or is there a better option that I missed.

Thanks. Nick

From the command line, this documentation says it is

sudo systemctl restart home-assistant.service

I specify the documentation, because this seems to be different service name from the hassbian set up that I use. If it doesn’t work, look in /etc/systemd/system and there should be a file with a name including home assistant and .service. Just use this filename in the above command.

From the front end, use the Developer tools service section and select homeassistant domain and restart service.

It does take a minute or so to restart, so don’t panic. It takes even longer when you get a large database, but you can search in the forum for threads about how to fix that.

Right here on this page (just under the 1st green warning)

curl -O https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && sudo chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh