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

The Android IoT SDK disconnects when a message arrives on a get/accepted topic. #1539

Closed
jarvis32123 opened this issue Apr 2, 2020 · 5 comments
Labels
closing soon Issue will auto-close if there is no additional activity within 7 days. iot Issues with the AWS Android SDK for Internet of Things (IoT) pending-community-response Issue is pending response from the issue requestor

Comments

@jarvis32123
Copy link

jarvis32123 commented Apr 2, 2020

This wasn't happening until recently but I get a "connection is Lost" message from mqtt after I push a "get" on a topic. It says "message arrived on topic: [my-topic]" but then the connection is lost. mqtt then reconnects. However, this keeps happening sort of in a loop. This is because I get a topic when mqtt connects. So one causes the connection lost and then it reconnects, gets again and once more connection is lost.

Has something changed here in mqtt? Maybe some backend settings?

@jarvis32123 jarvis32123 changed the title Android IoT 2.2.13 SDK removes acknowledge callback that is fired when you successfully subscribe to a topic. The Android IoT SDK disconnects when a message arrives on a get/accepted topic. Apr 2, 2020
@jpignata jpignata added iot Issues with the AWS Android SDK for Internet of Things (IoT) Pending Triage labels Apr 3, 2020
@jarvis32123
Copy link
Author

It looks like this happens in AWSIotMqttNewMessageCallback().onMessageArrived()

@desokroshan
Copy link
Contributor

@jarvis32123 Thanks for reaching out. I am unable to reproduce this on the latest version of the SDK. I tried the following to reproduce the issue :

  • connect client to the broker
  • subscribe to $aws/things/<thingName>/get/accepted and $aws/things/<thingName>/get/rejected
  • publish an empty message to $aws/things/<thingName>/get

I get state information on the $aws/things/<thingName>/get/accepted and the device remains connected.

Screen Shot 2020-04-24 at 12 46 02 AM

Can you please provide the following :

  • Additional steps, if any, required to reproduce the issue
  • Version of SDK that you are using. It looks like you are using an antiquated version(2.2.13) of the SDK. I would suggest updating to the latest version 2.16.11 of the SDK and check if the issue persists
  • You mentioned that you see loss of connection in AWSIotMqttNewMessageCallback().onMessageArrived(). Can you possiblly share the stack trace?

@desokroshan desokroshan added pending-community-response Issue is pending response from the issue requestor and removed Pending Triage labels Apr 24, 2020
@desokroshan desokroshan added the closing soon Issue will auto-close if there is no additional activity within 7 days. label May 6, 2020
@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed May 13, 2020
@RoustamManookian
Copy link

I have the same issue,
it's reconnecting only when I add any even simple logic like update textView.text in collBack success.
by the way, aws-android-iot SDK version I use is 2.16.28

the interesting thing is that it works perfectly in kotlin.

@RoustamManookian
Copy link

The solution is "Coroutines"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing soon Issue will auto-close if there is no additional activity within 7 days. iot Issues with the AWS Android SDK for Internet of Things (IoT) pending-community-response Issue is pending response from the issue requestor
Projects
None yet
Development

No branches or pull requests

4 participants