Anonymous User
  Sunday, 02 February 2020
  2 Replies
  2.3K Visits
  Subscribe
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.
4 years ago
·
#155
If you need authentication, enable Authentication property (in your code is set to false).


MQTT.Authentication.Enabled := True;
4 years ago
·
#156
It works correctly, thank you! I have obviously overlooked this property :)
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf
· Insert · Remove
  Upload Files (Maximum 10MB)