aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.03k stars 548 forks source link

MQTT can't reconnect when switch the network #364

Closed HunterAuras closed 6 years ago

HunterAuras commented 6 years ago

To help us solve your problem better, please answer the following list of questions.

If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application by using Mobile Hub.

bxpan commented 6 years ago

Hi HunterH0me,

Could you elaborate on how you were switching wifi ? Could you attach adb logs from the device?

Thanks.

HunterAuras commented 6 years ago

Hey bxpan: Thanks for your reply, simply to change the phone's wifi AP the issue will occur. Once if the error message appear the MQTT will nerver reconnect. The logs as below:

`11-08 09:57:54.190 11903-14605/com.test.home I/System.out: =====onMQTTMessageArrived $aws/things/us-east-1:76e1b330-6663-406c-81af-73cd6e7461f2_5d17a261-eada-4ef7-84a7-94ba26ec7950/shadow/update/documents {"previous":{"state":{"desired":{"power":0,"schedule":[]},"reported":{"power":1,"schedule":[]}},"metadata":{"desired":{"power":{"timestamp":1510106274},"schedule":[]},"reported":{"power":{"timestamp":1510105347},"schedule":[]}},"version":68},"current":{"state":{"desired":{"power":0,"schedule":[]},"reported":{"power":0,"schedule":[]}},"metadata":{"desired":{"power":{"timestamp":1510106274},"schedule":[]},"reported":{"power":{"timestamp":1510106275},"schedule":[]}},"version":69},"timestamp":1510106275,"clientToken":"69ce17d0"}

11-08 09:58:02.564 11903-14847/com.test.home W/InstanceID/Rpc: No response

11-08 09:58:10.997 11903-11903/com.test.home I/home-test: Network connection changed:1

11-08 09:58:10.997 11903-11903/com.test.home I/home-test: Network connection changed(isLogin):true

11-08 09:58:13.136 11903-14700/com.test.home E/ClientState: us-east-1:8e4085d5-803b-4751-a085-ab22b5ae190c_337: Timed out as no activity, keepAlive=10,000 lastOutboundActivity=1,510,106,283,131 lastInboundActivity=1,510,106,274,188 time=1,510,106,293,131 lastPing=1,510,106,283,131

11-08 09:58:19.196 11903-11903/com.test.home W/InstanceID/Rpc: Missing callback for 3 `

Thanks

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 6 years ago

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