I wasn’t sure where to post, and I’ve been at this for last several hours and not to frustrated to continue tonight and will try and again tomorrow. But I cant’ seem to get Mosquitto configured correctly. At least I don’t think so. This on a Ubuntu 14.04LTS server VM.
On my Ubuntu setup, I installed Mosquitto mainly following the steps from the Mosquito website, but I can not get seem to get anything to connect to it. To try and show.
This is my etc/mosquitto/conf.d/mosquitto.conf file Yes, I have it in the conf.d file. Believe that is the recommended location.
listener 1883 localhost listener 8883 localhost persistence true persistence_location /var/lib/mosquitto/ persistence_file mosquitto.db log_dest syslog log_dest stdout log_dest topic log_type error log_type warning log_type notice log_type information connection_messages true log_timestamp true allow_anonymous false password_file /etc/mosquitto/passwd
As you can see I have ports 1883 and 8883 listening. And I did make an owntracks user and password at /etc/mosquitto/paswd as well as follows
mosquitto_passwd -c /etc/mosquitto/passwd owntracks
When I start mosquitto, I get this
root@Ubuntu-Server:~# mosquitto -c /etc/mosquitto/conf.d/mosquitto.conf 1467769510: mosquitto version 1.4.9 (build date Fri, 17 Jun 2016 15:43:08 +0100) starting 1467769510: Config loaded from /etc/mosquitto/conf.d/mosquitto.conf. 1467769511: Opening ipv6 listen socket on port 1883. 1467769511: Opening ipv4 listen socket on port 1883. 1467769511: Opening ipv6 listen socket on port 8883. 1467769511: Opening ipv4 listen socket on port 8883.
So it appears to be running. But when I opening a second terminal and try and connect it fails.
# mosquitto_pub -h localhost -p 1883 -t 'owntracks/test' -m 'hello world' Error: Connection refused
In another example, I did this to work and appears to connect. But it uses _sub?
~# mosquitto_sub -h localhost -p 8883 -v -t 'owntracks/#' -u owntracks -P MYPASSWORD
I’ve also tried with the program MQTT.fx program to connect to the machine and it fails as well. And I also can’t get the owntracks app to connect with that same username and password.
Does anyone have any clear steps or instructions to maybe purge mosquitto and start over? I’ve up to long tonight messing this and will try again tomorrow. It could be something obvious and maybe I’m just not seeing it tonight.