Posts: 5
Joined: Fri Dec 08, 2017 9:48 am

Frustrations with Stretch and MQTT

Fri Dec 08, 2017 10:25 am

I currently have stretch installed on a Pi Zero W. I'm wanting to install a MQTT Broker to use with Node-red and a few ESP8266 around the house. I was originally going to use Mosquitto, but I ran into a bunch of issues. I currently have Mosquitto installed on a VM running Xubuntu LTS, but I was wanting the MQTT broker installed on the Pi to have it all contained on one box. It would also allow me to test/build the IOT stuff when I'm not at home and able to access the VM on the server at home. I did some Google searching and found several links to various pages where people are having issues installing Mosquitto on stretch. There is even a long discussion about the issues in this community. viewtopic.php?f=66&t=191027 I have read the post and even still after going through the steps, I was not able to get Mosquitto installed to my liking. I have followed a guide on some of the discussions that i found on github on how to install the older versions of libssl and such, but I didn't like those solutions because it wasn't secure.

I'm going off of memory here, but I believe that apt-get out of the box installs 1.4.10. I have read that using 1.4.10 is a bad idea because it's vulnerable. I have tried installing version 1.4.12 so I can use websockets. I found a wonderful guide on reddit ... pberry_pi/ that explains the issue quite well. I was able to follow the guide completely, but at the end I get an error with the libssl Shared Object Library. I asked for help on reddit, but haven't heard anything back. I do believe that the guide is the most secure way to get Mosquitto installed on stretch... too bad I couldn't get it to work. If anyone could help that would be greatly appreciated.

I got to the point where I said forget Mosquitto and started looking at a different solution. I figured I would try RabbitMQ, since I hard a bunch of good things about it.

Installing RabbitMQ has been frustrating also. I have tried looking for a guide for stretch, but didn't have any luck. I have used the guide that was on Rabbitmq's website, but was not successful.

Here is a bunch of the command line output that I had while I was trying to install RabbitMQ. Maybe someone could point me in the right direction...? This has been really frustrating, as I have tried installing 2 different MQTT brokers on Raspbian and not been able to get it right.

Thanks for all your help!

I broke all the command line output into multiple code blocks to hopefully make it easier to read.

Code: Select all

[email protected]:~/rabbitmq $ dpkg -i rabbitmq-server_3.7.0-1_all.deb
dpkg: error: requested operation requires superuser privilege
[email protected]:~/rabbitmq $ sudo dpkg -i rabbitmq-server_3.7.0-1_all.deb
Selecting previously unselected package rabbitmq-server.
(Reading database ... 122961 files and directories currently installed.)
Preparing to unpack rabbitmq-server_3.7.0-1_all.deb ...
Unpacking rabbitmq-server (3.7.0-1) ...
dpkg: dependency problems prevent configuration of rabbitmq-server:
 rabbitmq-server depends on erlang-nox (>= 1:19.3) | esl-erlang (>= 1:19.3); however:
  Package erlang-nox is not installed.
  Package esl-erlang is not installed.
 rabbitmq-server depends on socat; however:
  Package socat is not installed.

dpkg: error processing package rabbitmq-server (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ( ...
Processing triggers for systemd (232-25+deb9u1) ...
Errors were encountered while processing:

Code: Select all

[email protected]:~/rabbitmq $ apt-cache show erlang-nox
Package: erlang-nox
Source: erlang
Version: 1:19.2.1+dfsg-2
Installed-Size: 46
Maintainer: Debian Erlang Packagers <[email protected]>
Architecture: all
Depends: erlang-base | erlang-base-hipe, erlang-asn1, erlang-corba, erlang-crypto, erlang-diameter, erlang-edoc, erlang-eldap, erlang-erl-docgen, erlang-eunit, erlang-ic, erlang-inets, erlang-mnesia, erlang-odbc, erlang-os-mon, erlang-parsetools, erlang-percept, erlang-public-key, erlang-runtime-tools, erlang-snmp, erlang-ssh, erlang-ssl, erlang-syntax-tools, erlang-tools, erlang-xmerl
Suggests: erlang, erlang-manpages, erlang-doc
Size: 35348
SHA256: 394e106bde7c18a3cd0d8040106792e23517f0356960e9d580d078538622e0ad
SHA1: f1c7ac3a9419c395104dd966eeccfb14b5f2381e
MD5sum: 336dd9e0117254a3e8fda297330c2227
Description: Erlang/OTP applications that don't require X Window System
 This package is a dummy package which will install all Erlang/OTP
 applications which do not require X Window System to run.
Description-md5: 7a788b312a01454a03fd4262bf827fcd
Tag: devel::TODO, devel::interpreter, role::dummy
Section: interpreters
Priority: optional
Filename: pool/main/e/erlang/erlang-nox_19.2.1+dfsg-2_all.deb

Code: Select all

[email protected]:~/rabbitmq $ apt-cache show esl-erlang
N: Can't select versions from package 'esl-erlang' as it is purely virtual
N: No packages found
[email protected]:~/rabbitmq $ apt-cache show socat
Package: socat
Architecture: armhf
Maintainer: Laszlo Boszormenyi (GCS) <[email protected]>
Installed-Size: 838
Depends: libc6 (>= 2.15), libssl1.1 (>= 1.1.0), libwrap0 (>= 7.6-4~)
Priority: extra
Section: net
Filename: pool/main/s/socat/socat_1.7.3.1-2+deb9u1_armhf.deb
Size: 319816
SHA256: 5d49e0fde70288409ad9578c64b9c655523047052d04d5ab2ffaca130b65d1ef
SHA1: d8f9674647caf340a4d8a46805b8b121d55b41d4
MD5sum: e69136e1e7cceffed0e873ff6ff53143
Description: multipurpose relay for bidirectional data transfer
 Socat (for SOcket CAT) establishes two bidirectional byte streams
 and transfers data between them. Data channels may be files, pipes,
 devices (terminal or modem, etc.), or sockets (Unix, IPv4, IPv6, raw,
 UDP, TCP, SSL). It provides forking, logging and tracing, different
 modes for interprocess communication and many more options.
 It can be used, for example, as a TCP relay (one-shot or daemon),
 as an external socksifier, as a shell interface to Unix sockets,
 as an IPv6 relay, as a netcat and rinetd replacement, to redirect
 TCP-oriented programs to a serial line, or to establish a relatively
 secure environment (su and chroot) for running client or server shell
 scripts inside network connections. Socat supports sctp as of 1.7.0.
Description-md5: 756f78d1d190c48fab624c958dfcb5ab

Code: Select all

[email protected]:~/rabbitmq/erlang $ wget
--2017-12-08 03:03:15--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2017-12-08 03:03:15--
Reusing existing connection to
HTTP request sent, awaiting response... 200 OK
Length: 39913310 (38M) [application/x-debian-package]
Saving to: ‘esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb’

esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb       100%[=====================================================================================================================>]  38.06M   699KB/s    in 51s

2017-12-08 03:04:06 (764 KB/s) - ‘esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb’ saved [39913310/39913310]

Code: Select all

[email protected]:~/rabbitmq/erlang $ sudo dpkg -i esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb
Selecting previously unselected package esl-erlang.
dpkg: considering removing erlang-base in favour of esl-erlang ...
dpkg: no, cannot proceed with removal of erlang-base (--auto-deconfigure will help):
 sonic-pi depends on erlang-base
  erlang-base is to be removed.

dpkg: regarding esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb containing esl-erlang:
 esl-erlang conflicts with erlang-base
  erlang-base (version 1:19.2.1+dfsg-2) is present and installed.

dpkg: error processing archive esl-erlang_20.1.7-1~raspbian~stretch_armhf.deb (--install):
 conflicting packages - not installing esl-erlang
Errors were encountered while processing:

Code: Select all

[email protected]:~/rabbitmq/erlang $ sudo vim /etc/apt/sources.list.d/erlang.list
[email protected]:~/rabbitmq/erlang $ sudo apt-get update
Hit:1 stretch InRelease
Hit:2 stretch InRelease
Ign:3 stretch InRelease
Get:4 stretch Release [3,688 B]
Get:5 stretch Release.gpg [836 B]
Ign:5 stretch Release.gpg
Get:6 stretch/contrib armhf Packages [7,624 B]
Fetched 12.1 kB in 5s (2,277 B/s)
Reading package lists... Done
W: GPG error: stretch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D208507CA14F4FCA
W: The repository ' stretch Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
1 - Pi3
4 - Pi Zero
3 - Pi Zero W

Posts: 39
Joined: Fri Aug 14, 2015 10:36 am

Re: Frustrations with Stretch and MQTT

Thu Dec 14, 2017 5:30 pm


I am similarly frustrated with Stretch and Rabbitmq. I get exactly what you get. I have tried Rabbitmq 3.6.14-1 and get the same again.

On the plus side, I have Rabbitmq 3.6.14-1 running with Pika on Jesse but it's very unreliable; e.g. rejecting credentials one moment and then accepting them and again with connections; rejecting a connection for a dozen tries but then accepting it. Once you get it going it can run for hours before suddenly throwing an exception for no apparent reason.

I will try the new Rabbitmq on Jesse and see what happens.

I am surprised that no-one better experienced/qualified than I has not replied to help you already.


Posts: 39
Joined: Fri Aug 14, 2015 10:36 am

Re: Frustrations with Stretch and MQTT

Thu Dec 14, 2017 8:28 pm


I think that I have made progress that may help you.

I have used Jesse and Rabbitmq 3.6.14-1 because I know these work OK. I am also using Pika. Maybe if you try Stretch and the later Rabbitmq you can get the same installation.

I moved (as you had done so) to the directory which contained the Rabbitmq file.
I tried the same dpkg command that you tried and got the same "Where is erlang etc." response.
So I tried: "sudo apt-get -f install erlang.nox" which failed but suggested:
"sudo apt-get -f install" which again didn't work but suggested: "sudo apt-get update".
I tried that and then re-tried: "sudo apt-get -f install". Hey-presto and it not only installed erlang.nox it installed the rabbitmq and everything else.

I then installed a new user as I think that you will find that "User - User" will only work with "localhost":
$ rabbitmqctl add_user YOUR_USERNAME YOUR_PASSWORD
$ rabbitmqctl set_user_tags YOUR_USERNAME administrator
$ rabbitmqctl set_permissions -p / YOUR_USERNAME ".*" ".*" ".*"

Include the new USER_NAME YOUR_PASSWORD as credentials in the coding.

Set the IP of the sending "pi" in "" and the same sender's IP in the That should run okay.

If you work out how to encode more than one numeric in the "body" and can decode it later let me know!! I have only managed 1 so far.

Bon chance,


Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 28 guests