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

Cannot receive Push Message due to disconnection (No PINGREQ) #496

Open
1 of 3 tasks
prageeth07 opened this issue Sep 11, 2023 · 0 comments
Open
1 of 3 tasks

Cannot receive Push Message due to disconnection (No PINGREQ) #496

prageeth07 opened this issue Sep 11, 2023 · 0 comments

Comments

@prageeth07
Copy link

prageeth07 commented Sep 11, 2023

Please fill out the form below before submitting, thank you!

  • Bug exists Release Version 1.1.1 (Java Repository Master Branch)
  • Bug exists in Snapshot Version 1.1.2-SNAPSHOT (Android Service Repository Master Branch)
  • Bug is just in the Sample Application.

__Android API Version Bug Seen on: 30

__Android Version Bug Seen on: 11

Please also check that if you have found the bug in the Release version (1.1.1) that you check that it also exists in the Snapshot (1.1.2-SNAPSHOT) before raising a bug.

Description of Bug:

We have developed an Android application using the Paho MQTT Android Library. We have used the Mosquitto Service as the Mqtt Broker.

The Mqtt client options are as below :

mqttVersion = MqttConnectOptions.MQTT_VERSION_3_1_1
isCleanSession = true
isAutomaticReconnect = true

As per our findings, the android application sends a PING within the keepalive period set in the MQTT Client options using the Paho Library. The ping process works as expected as long as the device is connected to a USB cable.

2023-08-28T18:01:25: Received PINGREQ from [ClientId]
2023-08-28T18:01:25: Sending PINGRESP to [ClientId]

When referring the ADB logs later, we found out that as soon as the cable is disconnected, the PING has not occured as expected. There are huge time gaps between each ping and we were able to confirm it through the mosquitto broker logs as below.

When referring to mosquitto logs it seems that the android device (mqtt client) has not sent any PING requests (PINGREQ) to mosquitto. After a short time without any PING requests, mosquitto has disconnected the client.
There are times that the client has been reconnected by Paho mqtt client but the reconnection time interval is not consistent.

2023-08-28T20:30:30: [ClientId] has exceeded timeout, disconnecting.
2023-08-28T20:33:16: New client connected from [IP]:[Port] as [ClientId] (p2, c0, k60, u'example').

Therefore, the PUBLISH messages are not sent to the android application as soon as it is received by mosquitto broker.

According to these findings we have come to the understanding that the PING from the android application is not sent as expected using the Paho MQTT Android Library.

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