MQTT Broker (newbie questions)

Hi Guys, I got problem.

  1. First of all, I cant find MQTT.cfg at all I checked 200 times.
    Nothing, I uninstall MQTT, but I can’t find that. I understand that it’s very important.
    UPDATE: I found that MQTT2 do not have MQTT.cfg even though I am not sure what version I have, if I got my MQTT Broker online do I need that file?

  2. MQTT Broker, if it’s online it’s means I configure my openhab with MQTT?

  3. Can I connect my CH Smart Bulb with Bluetooth bindings?

Thank you.

This is a question which shows that you did not read any of the official openHAB docs before asking in the forum.
Please start reading the basic docs and if something is not clear then ask your specific question here in this forum.

To answer part of your question:
the mqtt.cfg config file is for mqtt verison 1 binding which is outdated. You did not tell us which version of openHAB your are using, but I guess your are using a recent version and therefore assuming you are using mqtt binding version 2. You don’t need a mqtt.cfg for mqtt2.
BUT: setting up your broker has nothing to to with setting up your mqtt binding. Yes, they work together but technically the have nothing in common.
So again, please read all the docs and then come back and ask questions:

https://www.openhab.org/docs/tutorial/configuration.html

Yes sir :slight_smile:

After reading this. I understand that if I am using offical bluetooth bindings all the devices I found are only beacons, and I cant do anything with them? no light or changing colors (the light buld have abilty to do so) I undestand right?
(sorry for my bad english)

So it is hard to install 3rd party bindings?

“In order to function, this binding requires a Bluetooth adapter to be present, which handles the wireless communication.”
If I have do not have Adapter , only the Bluetooth bulb, and raspberry Pi 3, running openhab.
I cant do that. am I right?

My 1 + 2 Quetsion solved.

A RasspberryPi has no means to send or receive Bluetooth messages, without a Bluetooth adapter/dongle… (whatever you call it) you will not be able to use the Bluetooth binding ( a binding is the software package that enables openHAB to do something special).
In other words, although you have a device that “talks” Bluetooth, without a Bluetooth adapter on your RasPi your are stuck.

I see, can you help me up and link me one? or give me the name of a good bluetooth adapter that I need?

I don’t have such a device, sorry!

I got those errors, do you know why?
there is no such folder “/var/lib/openhab2” dose not exist.

2019-04-09 07:41:58.245 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to ‘127.0.0.1’. Next attempt in 10000ms

2019-04-09 07:41:58.248 [WARN ] [r.internal.EmbeddedBrokerServiceImpl] - Embedded broker offline - Reason unknown

2019-04-09 07:41:58.261 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘127.0.0.1’ with clientid embedded-mqtt-broker and file store ‘/var/lib/openhab2/mqtt/127.0.0.1’

2019-04-09 07:41:58.319 [WARN ] [r.internal.EmbeddedBrokerServiceImpl] - Embedded broker offline

org.eclipse.paho.client.mqttv3.MqttException: MqttException

at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[232:org.eclipse.paho.client.mqttv3:1.2.0]

at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) [232:org.eclipse.paho.client.mqttv3:1.2.0]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.net.SocketException: Connection reset

at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:?]

at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:?]

at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:?]

at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:?]

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:975) ~[?:?]

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367) ~[?:?]

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395) ~[?:?]

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379) ~[?:?]

at org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule.start(SSLNetworkModule.java:108) ~[?:?]

at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[?:?]

… 7 more

What makes you think that the folder does not exist? How are you looking for that folder?

The error is coming from the embedded MQTT Broker, which openHAB and MQTT binding Version are you using?

I tried from SSH to locate that folder, I am almost sure she dont exist.

MQTT 2.4
Openhab 2.4

By the way, My broker configured , and I was able to talk from my PaperUi, to MQTT.fx

Meaning: MQTT worked but stopped working, or what?
Please confirm: you have ONLY the embedded MQTT Broker installed (and not additionally the mosquitto Broker).

I have " MQTT Thing Binding By David Graeff"
Version 2.4 installed.

You still did not

1 Like

So yes. I have only that installed.

First thing to do is to fix your broker installation. Try uninstalling and reinstalling.

The embedded broker in OH 2.4 will shutdown because of two reasons:

  • The port is already occupied (mosquitto is maybe running?)
  • You are using too long client-ids (a bug)
1 Like

Fixed thank you.

Please tell us the fix so other users can benefit from it.

1 Like

I uninstalled the MQTT bindings, reboot, and then install it again and it’s works.

** Please note: I’ve tried once to reinstall it and then re boot and it did not worked.
Uninstall, then reboot, then install it again.
That what solved my problem.

Thank you guys.