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
mqtt:mymosquitto.url=tcp://localhost:1883

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

--------------------------------- 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
IP: 192.168.2.189
GW: 192.168.2.1
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
SSID: MYSSID
WPA Key: MYPASSWD
WPA AP Mode Key: configesp
Unit nr: 16
Protocol: OpenHAB MQTT
Controller IP: 192.168.2.125
Controller Port: 1883
Sensor Delay: 60
Message Delay (ms): 1000
Sleep Mode: 0
Optional Settings 0.0.0.0
Fixed IP Octet: 0.0.0.0
ESP IP: 0.0.0.0
ESP GW: 0.0.0.0
ESP Subnet: 0.0.0.0
Syslog IP: 0.0.0.0
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

SOLVED

The issue is with the default Mosquitto repository incompatible with ESP. Credit goes to this post
h**p://mosquitto.org/2013/01/mosquitto-debian-repository/

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:

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.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 http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

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
INIT : I2C
WIFI : Connecting…
.
.
.
.
.
.
.
MQTT : Connected to broker
INIT : Boot OK
Boot
gpio,2,0
gpio,2,1
gpio,2,0

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