Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT cannot connect #5340

Open
weidongliu opened this issue May 16, 2024 · 4 comments
Open

MQTT cannot connect #5340

weidongliu opened this issue May 16, 2024 · 4 comments
Labels
bug Something isn't working iot Issues related to the IoT SDK pending-community-response Issue is pending response from the issue requestor

Comments

@weidongliu
Copy link

Describe the bug
Disconnected and then connected multiple times with no response. Appears at specific time:
2024/05/16 09:20:37:849 I connected mqtt but there was no response, then I disconnected at 2024/05/16 09:20:58:648
2024/05/16 09:22:44:309 I connected mqtt but there was no response, then I disconnected at 2024/05/16 09:29:54:527
2024/05/16 09:30:11:509 I connected mqtt but there was no response, then I disconnected at 2024/05/16 09:36:42:382
According to the above time point, I found that when connecting to mqtt, the log prints Websocket is created and opened until I disconnect, there is no log in the middle, which is different from the normal connection log.
image

Areas of the SDK you are using (AWSMobileClient, Cognito, Pinpoint, IoT, etc)?
AWSIOT
AWSMobileClient

Environment(please complete the following information):

  • SDK Version: 2.33.10
  • Dependency Manager: Cocoapods
  • Swift Version :5.x
  • Xcode Version: xcode15

Device Information (please complete the following information):

  • Device: iphone11
  • iOS Version: iOS16.6.1

Logs
mqttlog.txt

@thisisabhash thisisabhash added bug Something isn't working iot Issues related to the IoT SDK labels May 16, 2024
@thisisabhash
Copy link
Member

Thank you for posting this. Our team will investigate and post updates to the ticket.

@weidongliu
Copy link
Author

Have you found the reason? @thisisabhash

@phantumcode
Copy link
Contributor

@weidongliu Can you help clarify what is the expected behavior and what is the behavior you're observing?

@phantumcode phantumcode added the pending-community-response Issue is pending response from the issue requestor label May 28, 2024
@weidongliu
Copy link
Author

At 2024/05/15 15:57:46, the app is started and iotDataManager?.connectUsingWebSocket(withClientId: uuid, cleanSession: true, statusCallback: mqttEventCallback) is called to connect successfully. Then at 2024/05/15 15:58:14, the app enters the background, and until 2024/05/16 09:19:20, the app is opened. At this time, the application process is not killed by the system, and the iot sdk will automatically reconnect to mqtt. At 2024/05/16 09:19:24, the callback connection is successful. At 2024/05/16 09:19:30:765, iotDataManager?.disconnect() is called to disconnect successfully. Then at 2024/05/16 09:20:37, I called iotDataManager?.connectUsingWebSocket(withClientId: uuid, cleanSession: true, statusCallback: mqttEventCallback) but there was no callback for successful connection. Until 2024/05/16 09:20:58, I called otDataManager?.disconnect() to disconnect. The subsequent connections were unsuccessful. Please help me find the reason from the log. @phantumcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iot Issues related to the IoT SDK pending-community-response Issue is pending response from the issue requestor
Projects
None yet
Development

No branches or pull requests

3 participants