I am not a linux person. I know enough to break things.

I have a pi, MQTT is working perfectly on that I set up all though I do not remember the exact steps (probably a lot of unneeded ones included).

Problem is a serial program I need reboots the pi then it locks it up before it finishes rebooting. I thought it was just my program, but then another (supposedly working) program did the same thing so I started suspecting linux.

I upgraded linux. It never booted again.

So I started fresh. Latest linux (rasbian in all cases) locks up, never finished booting. I dropped back a release. Ok finally, a working Pi again.

Same MQTT program refuses to run and I have tried everything I can think of. Restored an old back up image. Yes, my MQTT clients are fine, but the serial port program is critical.

So it could be many things and I have no idea where to start. What is preventing a working MQTT client from connecting mosquitto mqtt broker? And assuming I am willing to try to same thing I had to do on the OS, drop back a version (or 2 or 3) what command even does that? I looked into apt-get, but apparently old versions are not kept track of on the Pi.

Update: thanks Joan, not quite what I am looking for. I am looking for someone who knows the protocols and what changes have been made in the last 3-4 months that would break a working system. Initial digging looks like a message from the client is now expecting a response, and never receives it. Apparently the same message did not expect a response before (or something like that).

  • To install MQTT an invocation such as sudo apt-get install mosquitto is all you need to do.
    – joan
    Jul 1, 2015 at 23:06
  • "refuses to run" -- are there any messages?
    – TomG
    Jul 3, 2015 at 19:50

1 Answer 1


It's possible that you have an old version of mosquitto installed on your Pi. The version in the raspbian wheezy repository is very old - 0.15, compared to the most recent 1.4.2 release.

If you want to install a more recent version, the best bet is to use the mosquitto debian repository, located at repo.mosquitto.org.

To do this, you could run the following steps (taken from http://jpmens.net/2013/09/01/installing-mosquitto-on-a-raspberry-pi/ ):

curl -O http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
rm mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo curl -O http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo apt-get update


sudo apt-get upgrade


sudo apt-get install mosquitto

If you're not using the wheezy version of raspbian, then replace it with jessie above in the line starting curl

The reason that the old version wouldn't work with a new client is that there is a more recent version of the MQTT protocol (v3.1.1) that the old broker doesn't understand. Because it doesn't understand, it disconnects any clients that are using it.

  • That sounds reasonable. In fact I did try something like this, but I think it might have been a different repo, and it failed. I will try again following this and let you know. thanks much.
    – Spiked3
    Jul 2, 2015 at 19:14
  • That did indeed work. I just checked and that was the one I tried before. I must of mis-fingered something, or failed to restart or something user stupid. thanks again.
    – Spiked3
    Jul 2, 2015 at 19:30
  • sorry, was doing that and got into 3 other things before I finished. Also word of warning, a plain upgrade is what wiped out my Pi to begin with. I would NOT trust the current repo for a full upgrade. I used the install approach (and included mosquitto-clients python-mosquitto)
    – Spiked3
    Jul 2, 2015 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.