Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] No pingreqs

Hi Joe,

pings should occur by default.  You can have the client library display the MQTT packets it's sending and receiving by setting the environment variables:

export MQTT_C_CLIENT_TRACE=ON
export MQTT_C_CLIENT_TRACE_LEVEL=PROTOCOL

and the output of the stdinpub sample program becomes:

[icraggs@oc0024870786 samples]$ LD_LIBRARY_PATH=.. ./stdinpub x --host iot.eclipse.org
Using topic x
=========================================================
                   Trace Output
Product name: Paho Synchronous MQTT C Client Library
Version: 1.0.3
Build level: Thu Feb 18 12:12:13 GMT 2016
/proc/version: Linux version 2.6.32-573.14.1.el6.x86_64 (mockbuild@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Thu Dec 17 14:49:33 EST 2015

=========================================================
Connecting
20160218 121354.779 3 publisher -> CONNECT cleansession: 1 (0)
20160218 121354.899 3 publisher <- CONNACK rc: 0
20160218 121405.902 3 publisher -> PINGREQ (0)
20160218 121406.005 3 publisher <- PINGRESP
20160218 121417.017 3 publisher -> PINGREQ (0)
20160218 121417.120 3 publisher <- PINGRESP
20160218 121428.131 3 publisher -> PINGREQ (0)
20160218 121429.236 3 publisher <- PINGRESP

This is what happens when the keepalive interval is set to 10.


Ian

On 02/18/2016 12:07 PM, Joseph Harte wrote:

Hello,

 

I’m developing a  MQTT client using the C version 1.0.3 for a linux platform. I noticed that my broker does not receive any PINGREQS from the client so the broker disconnects the client. Does the client need to manually send the message, or is there a way to ‘turn on’ this feature that I’ve missed.

 

This is the printout from my broker.

 

20160218 115220.284152: C 20.27 to S: Connects(DUP=False, QoS=0, Retain=False, ProtocolName=MQTT, ProtocolVersion=4, CleanSession=True, WillFlag=False, KeepAliveTimer=10, ClientId=20.27, usernameFlag=False, passwordFlag=False)

Hex:  ['0x10', '0x11', '0x0', '0x4', '0x4d', '0x51', '0x54', '0x54', '0x4', '0x2', '0x0', '0xa', '0x0', '0x5', '0x32', '0x30', '0x2e', '0x32', '0x37']

String:  b'\x10\x11\x00\x04MQTT\x04\x02\x00\n\x00\x0520..27'

 

20160218 115220.287514: S to C 20.27: Connacks(DUP=False, QoS=0, Retain=False, Session present=False, ReturnCode=0)

Hex:  ['0x20', '0x2', '0x0', '0x0']

String:  b' \x02\x00\x00'

20160218 115235.314276 client 20.27 connection closing

 

 

Kind Regards,

Joe Harte

B+B SmartWorx has become Advantech B+B SmartWorx. To learn more, visit: http://advantech-bb.com/company/

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


Back to the top