By Guest on Sunday, 02 February 2020
Posted in General
Replies 2
Likes 0
Views 2.4K
Votes 0
I have a problem connecting to mosquitto MQTT server using authentication (without TLS and without websockets). I use the client the following way (I modified the Client demo):

MQTT.Client := WSClient;

txtParameters.Text := '/';
chkTLS.Checked := False;
MQTT.Authentication.Enabled := False;
MQTT.Authentication.Username := 'openhabian';
MQTT.Authentication.Password := 'mypassword';
MQTT.MQTTVersion := mqtt311;
txtHost.Text := '192.168.211.51';
txtPort.Text := '1883';
chkTLS.Checked := False;
chkOverWebSocket.Checked := False;

When I connect the Client displays immediately:

#connected
#disconnected
#exception: Connection Closed Gracefully.

The mosquitto log displays only:

1580681116: New connection from 192.168.211.99 on port 1883.

What am I doing wrong? Connections to this IP using MQTT-Explorer using the same connection settings work correctly. The "Client" connects correctly to test.mosquitto.org but without authentication but not to my mosquitto server on raspbian.
If you need authentication, enable Authentication property (in your code is set to false).


MQTT.Authentication.Enabled := True;
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
It works correctly, thank you! I have obviously overlooked this property
·
4 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post