MQTT-Client-Framework
MQTT-Client-Framework copied to clipboard
v0.15.2 MQTTSessionManager can not connect
Hello, When i use the v0.15.2 MQTTSessionManager to connect service ,it was error for this error:Error Domain=MQTT Code=-8 "Server has closed connection without connack." UserInfo={NSLocalizedDescription=Server has closed connection without connack.}.But, the demo which is using same parameter is good.
here below is the code:
[self.manager connectTo:@"192.168.1.109" port:1883 tls:NO keepalive:60 clean:NO auth:true user:@"user" pass:@"user123" will:NO willTopic:@"offline topic" willMsg:[@"offline" dataUsingEncoding:NSUTF8StringEncoding] willQos:MQTTQosLevelAtLeastOnce willRetainFlag:YES withClientId:clientId securityPolicy:nil certificates:nil protocolLevel:MQTTProtocolVersion311 connectHandler:^(NSError *error) {
}];
@9527kevin if you set will to NO, you should set willTopic to nil, willMsg to nil, willQos to MQTTQosLevelAtMostOnce (=0) and willRetainFlag to NO
How do we get error message from MQTTSessionManager for unauthorised user?
Have you solved the problem??
In my case, the port of broker that support websocket only.if you are the same solution you use MQTTWebsocketTransport class to create a transport for a MQTTSession.
I have the same problem
I have the same problem
now I solved my problem with set "auth" YES. because I have userName and password.