Problems with mosquitto and MQTT

Tags: #<Tag:0x00007f616ff4fd58>
  • Platform information:
    • Hardware: _CPUArchitecture/RAM/storage_RasberryPi
    • OS: _what OS is used and which version_openhasbian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:2
  • Issue of the topic:

Why cant I seem to link mosquito to openhab, i have been at it for 6 hours i feel, I even think I know what the problem is and i just cant fix it.

It seems like the URL is incorrect in my setup. I remember hours ago i was setting it up, and I was in openhab ui, and i was entering all of this information. i remember copying:

mqtt:localBroker.url=tcp://localhost:1883

and not

tcp://localhost:1883

into the URL field.

But now i dont know how to change it back, or how to get back where i was.
so i tried going through the samba share, to the config file, and i put this

Define your MQTT broker connections here for use in the MQTT Binding or MQTT

Persistence bundles. Replace with an ID you choose.

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

mosquito.tcp://localhost:1883

hoping that it would make the correct change.

It didnt. I feel like im going crazy. Do i even need to run mosquito on my windows pc, when there is an embedded one in openhab? am i doing that part wrong? or is it the fact that it wouldnt be that URL, localhost, because my mosquito i installed on my windows pc, and it is looking for it on the pi? here is what im running into:

I need more help than this, but i will make another thread for a different issue. thank you

!

im only allowed one image, heres another, the more important one: http://prntscr.com/tc7jqi

I see two System Brokers, which are intended for use with embedded broker (moquette), neither is any use for mosquitto.

Bin those, and add a Bridge broker Thing to your MQTT binding.

the second one is the mosquito one i added, i know it is because it is even spelled wrong in the screenshot…

So what is the smoothest way to go, with the embedded one?

Oh, I did install mosquito through the rasberry pi, by selecting the option in the config screen to add mosquito.

ok im starting to follow., they are both system ones, and not “outside” ones.

But I think im fine with using the system one, or should i not? (keep in mind i am only automating my room in this house, there is a lot of stuff, but its only ever going to be one room, in one house, and one person)

Should i be using the config menu on the pi to install mosquito? or delete the one that isnt working, and use the one that is… and move on to trying to actually get my lights to appear correctly with the right settings…

I started all of this 3 days ago when I did a tuya convert of all my plugs and lights, then i was kinda stuck with a bunch of URLs i could go to and control individual items. home assistant wasnt seeing anything after i used tasmota on them, so i started down the openhab route, i havent been able to control anything besides through individual urls for like 4-5 days, starting to get frustrated when usually i love tinkering with this kinda stuff

ty

I cant find “bridge broker” anywhere. there is a screenshot below of my mqtt binding options… Yes they are both system ones, but one of them I selected to install through the system “install extra stuff menu” and i selected mosquito on there…

Sorry i forgot to directly reply in my above posts. I hope you come back now that i did!!!

I would uninstall the embedded broker as it’s no longer supported and use mosquitto. This is what I have when selecting MQTT from PaperUI > Binding

ok, and is it ok to install mosquito through the config menu on my pi?

thats what i did, and intended to do because i read about the embedded one not having a future, but im not sure where i went wrong… I think I installed mosquito AS a system broker and not just a broker? where is that option when installing it?

If referring to the openhabian-config tool then yes.

After that you only need to install MQTT from PaperUI > Addons > Bindings then you can configure the rest.

ok, im deleting everything, and trying that. hopefully i was just reading too many tutorials at once before and got mixed up somehow

thanks. if you dont hear a reply back, im onto the next problem, and you are the best!!!

Lol… Heres what I got when I deleted the two I had and tried mosquito through the config menu

!

And

I’m trying to uninstall and reinstall the binding and going to try again…

Edit, nope, same

@H102

ok, even witth the errors, i have these in my inbox now, which one do i want? I know something is wrong because it is spelled mosquito, incorrectly, how i normally spell it, but I did everything through the config menu, i never entered anything.

Also should it say system broker? because it was installed by the config menu… or is system broker wrong because the system broker is going away…

Im just pausing here to hopefully hear back before I choose, or i guess i should add the top one, because i know i dont want the bottom one, but im 99% sure it wont work because this is my original issue.

It now says I cant make anymore replies on my first day… I think i know what i did wrong,somehow i was editing in the items menu, which doesnt exist now? idk…

cant make new posts… @rossko57… Im not choosing systemBroker, trust me. I am just selecting in the config menu "
install mosquitto" under optional components… I will go look at the log and see if it makes sense

@H102 ok, ill try that thanks… this sucks i cant make any new posts for 22 hours… i know i will need help later…

@H102 i found my issue, i had been in config-services-mqtt menu before and had wrong info in there…

Can’t say it much more plainly. Don’t use systemBroker with mosquitto. “Add a Thing” to MQTT binding. Add a “broker” Thing, point that at your mosquitto. Look in your openhab.log for messages about it connecting (I think it will connect even before you add “generic Things” representing your devices.

1 Like

Uninstall all MQTT related stuff you have in PaperUI then stop OH, clean the cache and restart. After a few minutes when OH is back up and fully restarted then add the MQTT binding.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

If you do not want to clean the cache then you can try a few restarts of OH and see if that will clear up what you have.

sudo systemctl restart openhab2