Mosquitto binding issue (I think)

Hello all,

How should I troubleshoot Mosquitto binding?

I like the new forum. I need some fresh eyes to help troubleshoot my Problem.

I think that I may have a problem with MQTT binding. I used to run MQTT with RFM69HW with little to no problems. But now I’m having issues while trying to setup a new ESP node. The ESP indicates that it cannot connect to the broker. I’ve tested Mosquitto with the following commands as well as a simple andriod app (MyMQTT).

1st step. Confirm MQTT is working

Terminal 1
mosquitto_sub -v -t ‘test/topic’

Terminal 2
mosquitto_pub -t ‘test/topic’ -m ‘helloWorld’

Both terminal 1 and the Android App respond properly with “helloWorld”

2nd step. (Check permissions) I admit that I’m not sure what I’m looking at here.

pi@RasPi /tmp/mymosquitto $ ls -l
total 4
drwxr-xr-x 2 pi pi 4096 Sep 27 19:22 openHAB-tcplocalhost1883

pi@RasPi /tmp/mymosquitto/openHAB-tcplocalhost1883 $ ls -l
total 0

Here is the setup.
Raspberry Pi B+
Openhab distribution-1.7.1

--------------------------------- OpenHAB openhab.log --------------------------------------

2015-09-27 19:22:50.544 [INFO ] [o.i.t.m.i.MqttBrokerConnection] - Starting MQTT broker connection ‘mymosquitto’

--------------------------------- OpenHAB MQTT Transport --------------------------------------

# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with a id you choose.

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a default one is generated.

--------------------------------- OpenHAB Items --------------------------------------
Switch MQTTLED (test) {mqtt=">[mymosquitto:/demo/gpio/2:command:ON:1],>[mymosquitto:/demo/gpio/2:command:OFF:0]"}

--------------------------------- Generic ESP8266 --------------------------------------
System Info
Uptime: 20 minutes
Build: 20
Unit: 16
STA MAC: 18:fe:34:fe:60:5d
AP MAC: 1a:fe:34:fe:60:5d
ESP Chip ID: 16670813
ESP Flash Size: 524288
Free Mem: 25448

Main Settings
Name: demo
Admin Password: pass
WPA AP Mode Key: configesp
Unit nr: 16
Protocol: OpenHAB MQTT
Controller IP:
Controller Port: 1883
Sensor Delay: 60
Message Delay (ms): 1000
Sleep Mode: 0
Optional Settings
Fixed IP Octet:
ESP Subnet:
Syslog IP:
Syslog Level: 0
UDP port: 0
Serial log Level: 3
Web log Level: 3
Baud Rate: 115200

I have confirmed the issue is with ESPEasy after plugging in my old Mosquitto gateway and RFM69HW.

side note: I’ve found out that my OpenHab on Raspberry Pi loads and runs better by limiting addons to the one actually used.

You are trying to run it per this example?

ESPEasy Tutorial OpenHAB Switch


The issue is with the default Mosquitto repository incompatible with ESP. Credit goes to this post

I uninstalled the existing broker.

sudo /etc/init.d/mosquitto stop 
sudo apt-get --purge remove mosquitto mosquitto-clients python-mosquitto

To use the new repository you should first import the repository package signing key:

sudo apt-key add mosquitto-repo.gpg.key

Then make the repository available to apt:

cd /etc/apt/sources.list.d/

Then one of the following, depending on which version of debian you are using: (I used wheezy)

sudo wget
sudo wget

Then update apt information:

apt-get update

And discover what mosquitto packages are available:

apt-cache search mosquitto

Or just install:

apt-get install mosquitto

And the sweet result:

INIT : Booting Build nr:18
WIFI : Connecting…
MQTT : Connected to broker
INIT : Boot OK

The answer is yes. I was using the ESPEasy Tutorial.