Raspi 2 B with latest OH and MQTT server installed through openhabian-config (this is an old pi I had lying around, there is currently no stock of any pi 3 or 4’s at any retailer I’ve checked so it’s a temp solution)
I’ve tried all sorts of combinations of localhost, localhost:1883, the pi’s IP address with no luck, I’m getting a configuration error in the MQTT thing and the following error:
2020-07-02 22:56:57.355 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘localhost’ with clientid 48c3ff57-cf90-4e41-9341-57fe6896a2c7
2020-07-02 22:57:57.364 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to ‘localhost’. Next attempt in 60000ms
I have MQTT lens installed and after installing the broker I could see a tasmota saying something about the current time when I had subscribed to # on the pi’s IP address but that went offline, I still have an active connection and subscription to localhost though there’s no activity on #
The docs and tutorials I found all seem to be point towards MQQT v1 because their menus and settings differ from what I have available.
Totally confused about what to change and where, do I change to my own ID? is this the broker ID it keeps looking for? What is client Id mentioned above from the log? Where do i set that?
What is the MQTT broker that has been installed? Is it Mosquitto, or openHAB’s Moquette?
Mosquitto I believe, installed through optional software menu in openhabian-config
How are you configuring things? Via PaperUI or configuration files?
I’ve tried both, first through config files as per documentation then after I found the options in Paper UI
And what MQTT devices have you got setup? Did you have this working previously?
I have 1x Tasmota flashed Sonoff as a test, once the system is working i’ll flash another 20 or so sonoffs to tasmota.
And ultimately, what are you trying to achieve? Control a single Tasmota-flashed device via MQTT through openHAB?
I’m attempting to move from eWeLink to openhab to control lighting in the house, I have moved a trial installation of openhab from my pc to a raspi 2B while I wait for a Pi 4B to become available, moving forward I wanted to get the lighting working.
I’ve noticed now that it seems that mosquitto is not running on the pi, it doesn’t give a reason, I noticed the error when i tried to reinstall the broker o the pi and add a password to try get a connection. I’l post the error code now
Looks like you’ve isolated the main issue - have you tried restarting the pi itself? Mosquitto is a 3rd party program, so you’re best off Googling for the errors! One thing you could check is to make sure nothing else on your pi is trying to access the same port: that will make Mosquitto cry.
Once you get Mosquitto up and running, do double check your openHAB stuff to make sure that you haven’t defined stuff twice: once in paperUI, once in configuration files - that never ends well!
Did the installation on your PC work fine with MQTT?
EDIT: if you haven’t got this setup on your PC, I’d try getting it all working on there first - just a bit easier than (presumably) SSHing into the pi. If you configure using files, you then only need to copy them over to the pi, and ensure you have the correct bindings and transforms installed.
I never got to installing Mqtt on my pc, so I’m not sure.
I think you’ve raised some good points about configuring in 2 places and the port usage though.
I’ll have a look with a fresh mind this afternoon and possibly refresh everything, otherwise I think I must stick to my original plan and use an old laptop.
I deleted the config files and all settings in PaperUI, added them again fresh and only set location as localhost (not localhost:1883, that gave an error)
openhabian as username - no password. Unfortunately still cannot install new mosquitto through openhabian-config though.
Went into puTTY and typed sudo mosquitto and boom there’s a connection in the logs and a connection from 127.0.0.1 under the sudo mosquitto command I typed in.