I running an MQTT Client application using MC60 GPRS module. My question is simple. Since there is no particular AT command for sending an MQTT PING in MC60 MQTT library, I want to know if there is any other way through which we can send PINGREQ and receive the response as PINGACK. I’m quite sure there is some way by which we can send MQTT PINGREQ as the flow chart in the GSM_MQTT Application Note makes a mention of the client sending a PINGREQ packet. Looking forward for a solution from someone.
Could you share why you want to use MQTT PING command ? For MQTT application, there have no special AT command to set it, if you want to keep alive the connection, you can try the following command. Thanks!
@Kyson , As I said I’m running a client application which is an MQTT Client, I want to periodically send an MQTT PING command at the application layer for the purpose of monitoring the network health with the broker.
I want to know does assigning a value of keep alive time automatically sends a PINGREQ after that time is elapsed or does it mean that an activity has to happen within the time specified in order to avoid a graceful disconnect ?
Please check the explanation about keep alive time. Thanks!
For your application, you can try to use the keepalive function or send data to server periodic. Thanks!
I understand what a keep alive timer is. What my real questions was how has the keep alive timer been used in the stack implementation of MQTT for MC60 module. Some stacks use the value for keep alive timer to send a PINGREQ thereby fulfilling the criteria for maintaining the connection whereas some stacks just run a timer for the value of keep alive and it’s responsibility of the application to ensure an activity within the said time.
As far as I can understand from your response, MC60 has no provision for sending an MQTT PING request whatsoever and in order to monitor network health i should rather use the PUBLISH command and validate based on its successful response.
Please correct me if I’m wrong.
if MQTT keep-alive-interval is set, MQTT stack send PING-REQUEST …
Set time and see PING-RESPONSE on broker
If broker not receive PING 1.5 of keep-alive time will close the connection