Not able to connect with MQTT server using AWSIoT SDK

Viewed 66

I am using AWSIoT sdk to connect with MQTT server But not able to connect

Using method from SDK let uuid = UUID().uuidString

// Connect to the AWS IoT data plane service over websocket

iotDataManager.connectUsingWebSocket(withClientId: uuid, cleanSession: true, statusCallback: mqttEventCallbackWebsocket(_:))

Getting response in debug

2022-06-12 17:31:04:108 IoTSampleSwift[14948:966200] AWSIoTMQTTClient: connecting via websocket. 
2022-06-12 17:31:04:108 IoTSampleSwift[14948:966200] Using AWSCredentials.
2022-06-12 17:31:04:110 IoTSampleSwift[14948:966200] user metadata is : ?SDK=iOS&Version=2.27.9
connection status = 1
Connecting...
2022-06-12 17:31:04:110 IoTSampleSwift[14948:966200] Metrics collection is: Enabled
2022-06-12 17:31:05:743 IoTSampleSwift[14948:966690] Websocket did open and is connected.
2022-06-12 17:31:05:744 IoTSampleSwift[14948:966922] <<<NSThread: 0x281546f80>{number = 42, name = (null)}>> Initializing MQTTEncoder and MQTTDecoder streams
2022-06-12 17:31:05:744 IoTSampleSwift[14948:966922] opening encoder stream.
2022-06-12 17:31:05:744 IoTSampleSwift[14948:966922] opening decoder stream.
2022-06-12 17:31:06:068 IoTSampleSwift[14948:966923] WebSocket closed with code:1001 with reason:Stream end encountered
connection status = 5
Connection Error
2022-06-12 17:31:06:069 IoTSampleSwift[14948:966922] MQTT session error, code: 2
2022-06-12 17:31:06:071 IoTSampleSwift[14948:966922] closing encoder stream.
2022-06-12 17:31:06:071 IoTSampleSwift[14948:966922] closing decoder stream.
2022-06-12 17:31:07:076 IoTSampleSwift[14948:966922] MQTTSessionEventConnectionClosed: MQTT session closed.
connection status = 5
Connection Error
0 Answers
Related