This isn’t really an Openhab question directly, as it’s with mosquitto configuration but I know there are a lot of users here. I am struggling to get it to even run. I’ve been all over the web looking for install/troubleshooting help and now fear I have conflicting information in files across my system.
My latest, when checking the service status is a return of:
Loaded: loaded (/etc/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (result:exit-code) since Sun 2019-08-04 14:49:31 CDT; 32min ago
Process: 2287 ExecStart=/usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=203/EXEC)
Main PID:2287 (code=exited, status=203/EXEC)
Aug 04 14:49:31 ubuntu_server systemd: mosquitto.service: Service hold-off time over, scheduling restart
Aug 04 14:49:31 ubuntu_server systemd: mosquitto.service: Scheduled restart job, restart counter is at 5.
Aug 04 14:49:31 ubuntu_server systemd: Stopped Mosquitto MQTT Broker.
Aug 04 14:49:31 ubuntu_server systemd: mosquitto.service: Start request repeated too quickly.
Aug 04 14:49:31 ubuntu_server systemd: mosquitto.service: Failed with result 'exit-code'.
Aug 04 14:49:31 ubuntu_server systemd: Failed to start Mosquitto MQTT Broker.
I’m looking at the MQTT binding documentation I’m reading I need a broker; I’m not reading anything about an imbedded OpenHAB broker??? I have no other need on this computer for an external MQTT broker (just need it for WiFi devices) so an embedded solution would be ideal.
I’ve uninstalled and purged Mosquitto (and of course rebooted several times!) but when I reinstall keep getting similar messages. I’m convinced there’s something amiss with the .conf file but can’t find a solution.
No, I’ve not done any of that. I can’t get to the point where Mosquitto even runs stably.
When I first installed it I checked its operation and it was working, but when I went to enable it to start on boot it went south.
Are there specific Mosquitto logs? Log files are something I’m not adept at interpreting (or even finding…).
I have not been able to work on this but with winter pending, I need to get a few temperature devices up and running.
I’ve installed MQTT Embedded Broker service and beyond setting the Embedded user brokername (MQTT temporarily during testing) and password I haven’t made any setting changes.
I also have the MQTT system broker connection service and as far as I can tell, don’t need to make any setting changes.
My test device is a Sonoff TH16 with Si7021 temperature sensor that’s been reprogrammed with Tasmota firmware. The Sonoff seems to be working just fine, I can log into it via my web browser, screen shot of the MQTT configuration below.
The Sonoff isn’t connecting to the MQTT broker; the blue indicator light continues to flash and the log reading:
“19:48:55 MQT: Connect failed to 127.0.0.1:1883, rc -2. Retry in 10 sec”
continues to log.
Question: Is 127.0.0.0 the correct connection address? I don’t see this setting in the MQTT broker.
Ok, great news. Entering the appropriate IP address of my host computer did the trick. I can see the Sonoff is connected by using MQTT.fx. One step down!
Now, onto the .things and .items configuration. The youtube videos are little help as I can’t see what they’re entering and their web sites have no good info (at least the videos I’ve seen). I’ve been following this guide:
but am unsure of what terms all need to match, between the Sonoff configuration, the myMQTTBroker thing properties and the .things and .items entries. Does anyone have a good example I can follow?
I’m also using a TH16 with an Si7021 sensor, and am not quite sure those values are right (I can find no examples that use this particular temp/humidity sensor).
Thanks, Peter. I am seeing some other details that will help me later but it is not helping my current problem.
I am thinking it is something to do with the Client ID (or at least that is one problem). I’ve seen a number of different names used in .items files but I continue to get an error with any entry I provide:
Session does not exist. CId=openhab
for example when I list clientID=“openhab”
Is this client ID entered somewhere else? The only other place I see it listed is in the MQTT broker configurations, but it’s not allowing me to enter a value there. Also does this correspond to a setting on the Sonoff?
Within the MQTT Broker thing, some text beneath the Client ID setting states:“Use a fixed client ID. Defaults to empty which means a user ID is generated for this connection.” So that must be hapening because when deleting the clientID within the Bridge statement of the .things file, I get the following error:
Session does not exist. CId=paho51621326352350
So now I have to believe something else is holding this up. Perhaps something in the “MQTT Embedded Broker” service or the “MQTT system broker connection” service? There aren’t much for settings in those services however…