Sir FICO
Posts: 35
Joined: Sat Nov 07, 2015 11:34 pm

updated mosquitto not working

Sun Mar 19, 2017 4:09 pm

I had mosquitto running as a broker on my rpi. All was running just fine. A couple of hours ago to ensure I was up to date I did the apt-get update and apt-get dist-apdate stuff and it seems to update the mosquitto to 1.4.11.

Now the mosquitto service does not work. I can see a mosquitto service running (and i have rebooted since the update) but I get a Error: Connection refused message when I do a subscribe from a terminal window (i.e. $ mosquitto_sub -d -t hello/world)

When if I start mosquitto in the foreground in one terminal window and subscribe in another then all works OK (as does a publish in another terminal window.) When starting mosquitto from a terminal I get the following:
1489938989: Using default config.
1489938989: Opening ipv4 listen socket on port 1883.
1489938989: Opening ipv6 listen socket on port 1883.

However, when I look at the running mosquitto service (when the foreground process has not bee started) I see the following
$ ps -ef | grep mosquitto
pi 2890 783 0 16:04 pts/0 00:00:00 grep --color=auto mosquitto
and nothing about listening sockets etc.

So after the update something must have changed in the auto startup service of mosquitto I guess.

I'm a noob in all this stuff and wonder if anyone could give a suggestion as to what to look at.

Thanks

User avatar
DougieLawson
Posts: 39877
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: updated mosquitto not working

Sun Mar 19, 2017 4:20 pm

What's in your mosquitto config? My mosquitto 1.4.11 system runs with just

Code: Select all

# 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
nothing else.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Sir FICO
Posts: 35
Joined: Sat Nov 07, 2015 11:34 pm

Re: updated mosquitto not working

Sun Mar 19, 2017 4:27 pm

Hi Dougie,

my mosquitto.conf file is exactly as your example. I also checked the conf.d directory and that only contained a file called README which indicated that files in this directory would also be read on startup, but no other files are present.

User avatar
DougieLawson
Posts: 39877
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: updated mosquitto not working

Sun Mar 19, 2017 4:44 pm

Then it should come up and run on port 1883 by default.

What do you get from sudo netstat -tlnp | grep 1883?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Sir FICO
Posts: 35
Joined: Sat Nov 07, 2015 11:34 pm

Re: updated mosquitto not working

Sun Mar 19, 2017 5:06 pm

Hi Dougie

Well well, I though I would delete the mosquitto log file and reboot so as not to confuse the entries with the background and foreground services. On reboot the logfile showed

' 1489941227: mosquitto version 1.4.11 (build date Mon, 20 Feb 2017 22:47:27 +0000) starting '

and that was it.

Sometime later I then did your suggestion of sudo netstat -tlnp | grep 1883 and I got
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 424/mosquitto
tcp6 0 0 :::1883 :::* LISTEN 424/mosquitto

so that looked promising and a re-examination of the log then showed
1489941227: mosquitto version 1.4.11 (build date Mon, 20 Feb 2017 22:47:27 +0000) starting
1489941227: Config loaded from /etc/mosquitto/mosquitto.conf.
1489941227: Opening ipv4 listen socket on port 1883.
1489941227: Opening ipv6 listen socket on port 1883.

And mosquitto is working again - albeit after a very long 'starting' phase.

But my woes are not over yet. I see another service, the z-way-server service that connects to my raspberryZwave board is showing as a ? and whist I can log in to my local zwave web page I can no longer see the zwave devices.

Something horrible is going on, but I hav'nt a clue what it could be. I thank you kindly for your suggestions on the mosquitto stuff.

User avatar
DougieLawson
Posts: 39877
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: updated mosquitto not working

Sun Mar 19, 2017 5:14 pm

Look at logs /var/log/daemon.log /var/log/messages and /var/log/syslog

Try running your "Zwave" server from a command line.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Sir FICO
Posts: 35
Joined: Sat Nov 07, 2015 11:34 pm

Re: updated mosquitto not working

Sun Mar 19, 2017 5:46 pm

Thanks for the pointer to the logs directory, its now registered in my crib sheet for rpi. :D

The messages file shows
Mar 19 17:33:38 p2zwave kernel: [ 363.413371] w1_master_driver w1_bus_master1: Family 0 for 00.e00000000000.e9 is not registered.

So the rpi update did something. I was looking at some other internet posts on this and see this has cropped up in the past and I think this must have a bearing on the zwave board, but have not yet got a pointer on what to do to resolve this. Any noob type pointers would be gratefully received.

User avatar
DougieLawson
Posts: 39877
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: updated mosquitto not working

Sun Mar 19, 2017 5:55 pm

Ah, the 1-wire driver can be a fickle thing.

Take a look in /boot/overlays/README where there's lots of docs for w1-gpio.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Return to “Troubleshooting”