Android Question MQQT broker from simple chat - with user name and pass

Pepebis

Member
Licensed User
Longtime User
Dear all ,
When I add a user name and pass into code and trying to start server app is showing error: Error connecting ( MqttSecurityExeption: Bad user name or password (4))

B4X:
Sub Service_Create
    broker.Initialize("", port)
    broker.SetUserAndPassword ("admin","admin")
    broker.DebugLog = False
    users.Initialize   
    autodiscover.Initialize("autodiscover",discoverPort , 8192)
    BroadcastTimer.Initialize("BroadcastTimer", 1000)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
Dim mo As MqttConnectOptions
mo.Initialize(user, password)
mqtt.Connect2(mo)
 
Upvote 0

Pepebis

Member
Licensed User
Longtime User
Who is connected to this broker? You need to connect with MqttClient.Connect2 and pass a MqttConnectOptions with the username and password.
This is actually what I want to do. But I can't create a server .,app is showing an error and not letting to create serwer.
 
Upvote 0
Top