System MQTT Broker in 3.1

Hi,

Just looking at moving from 2.x to 3.1. Thought I’d start with fresh install and slowly redo it in 3.1 to learn better. So made a new openhab3 on my linux server and installed it there. So can turn off 2, play with 3 and switch back/forward until I’m ready. Totally happy with that.

However seem to be stuck at basic MQTT binding. On my 2.x I have the System MQTT broker and 90% of all my OH goes thu that. But then I install the same binding in 3.1 it doesn’t seem to work like the 2.x one?

I have no mosquito installed. It just worked on 2.

What am I doing wrong?

This is what you need to fix.

You do not want to have any System Broker Thing in OH3 because that is to do with the OH2 “embedded” mqtt broker, which is not available in OH3 (because it cannot be supported in future).

1 Like

Getting a bogged down here.

Tried as @rossko57 said, and installed Mosquitto on my old system. Currenty Debian Woody.

But mosqutto seems an old version. It works, but the devices show this trying to connect;

Invalid protocol “MQTT” in CONNECT

Google, hints is dur to being an older version.

So I thought I’d try to compile latest from source. But get this making it…

/usr/local/src/mosquitto-2.0.13/apps/db_dump# make
cc db_dump.o print.o memory_mosq.o memory_public.o packet_datatypes.o packet_mosq.o persist_read.o persist_read_v234.o persist_read_v5.o property_mosq.o send_disconnect.o stubs.o time_mosq.o topic_tok.o utf8_mosq.o -o mosquitto_db_dump
time_mosq.o: In function mosquitto_time': /usr/local/src/mosquitto-2.0.13/apps/db_dump/../../lib/time_mosq.c:46: undefined reference to clock_gettime’
collect2: error: ld returned 1 exit status
make: *** [mosquitto_db_dump] Error 1

I can’t really change server from woody version right now, as I’ve lots of other things on it and just dont have time do upgrade all those right now.

Any suggestion? Or am I stuck on 2.x OH until I move past woody?

You might want to review the concept of how MQTT works. You need a broker of some kind. This broker can live anywhere on your network, where anything can connect to it.

You seem to have had a working broker using the “embedded broker” add-on for OH2, which your devices and OH2 connected to in order to exchange messages.
You can set up a new unrelated OH3 on the same or a different box, and also have that set up to connect to the same broker your devices are already using.

I do get that. It’s just my server is the only host that is on 24/7, hence why it was the MQTT host on OH2. I was hoping I could keep it the MQTT broker host on OH3 too, without introducing another box on 24/7 just to be MQTT broker.

Would have been good to get either;

  1. Current MQTT broker to work without the “Invalid protocol “MQTT” in CONNECT” error
  2. Be able to compile a working newer version of MQTT broker.

Adding another box just for that, is a distant 3rd.

You can.

Okay, you said this comes from your mystery devices. What are they trying to connect to?

This I have no idea about. Most folk download and install some broker service (usually Mosquitto) without compiling.

Do you really mean this? Debian Woody, as in the one released in 2002, and superseded in 2005?!

1 Like