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

Larger KEEPALIVE not working as expected #9

Open
rahulps2021 opened this issue Aug 18, 2021 · 0 comments
Open

Larger KEEPALIVE not working as expected #9

rahulps2021 opened this issue Aug 18, 2021 · 0 comments

Comments

@rahulps2021
Copy link

rahulps2021 commented Aug 18, 2021

Hi,

We are working on a google IoT based native android application. Currently App is sending Keep alive every 1 min. We are trying to increase this period.
We are using Paho library for Native development. When we use the KEEPALIVE for default 60 seconds, it works fine. When we try to increase the time (5/10/15 mins), device get disconnected periodically and takes time to connect back

When we tried 5 mins, 10 mins & 15 mins KEEPALIVE values, then we never see PINGREQ in IoT server logs
We are seeing 2 errors regard to the disconnects:
a: The connection broke or was closed by client
b: SERVER: The connection was closed because there is another active connection with the same device ID.

Note: We don't have the duplicate device listed in IoT core when we receive the "connection closed due to same device ID" error.

QoS value: Default channel is available with IoT registry, but we are publishing the messages from Server to Devices as command. So no QoS being set from device side while making MQTT connection.

Note:

    With 15 mins keep alive
1. Client app sent a PINGREQ, say at 00 Hrs. This PINGREQ never reaches to IoT Core server
2. For IoT core server, MQTT idle time (without heartbeat or message) is 20 mins. As IoT core Server never receive PINGREQ from client app (we are not seeing the PINGREQ in device registry log), it closes the connection after 0020 Hrs
3. Client app, after sending PINGREQ at 00 Hrs, waiting for PINGRESP. It never receives the PINGRESP from server, and closes the connection at 0030 Hrs.
4. Client app tries to reconnect again immediately after 0030 Hrs.
5. Client app never gets any disconnect message from server when server disconnect the MQTT connection at #2

With 10 mins keep alive
1. Disconnects every 20 mins & then takes 5 mins to connect back
2. Not seeing any PINGREQ in IoT core
3. Paho library at client throws error "Client timed out while waiting for a response from the server. The server is no longer responding to keep-alive messages." and then connects back again.
4. When server disconnects the client, client never gets notified.

Client app is using the IotCoreClient class to manage the connection/reconnection. The connection/reconnection logic is being done by IotCoreClient class which is in cloud-iot-core-androidthings' library.

Any suggestions?

Thanks,
Rahul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant