Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] disconnect on python library

Hi,

if your loop is running (which should be the case, since you receive messages), the on_disconnect callback should be called after at least 2*keepalive.

If not done, could you try to enable log and see if something useful is logged:

import logging
logging.basicConfig(level=logging.DEBUG)
[...]
client.enable_logger()

Regards,

Pierre


Le 29/03/2019 à 15:28, Niccolo Battezzati a écrit :

Hi all,

 

I’m trying to use the paho-mqtt python library to communicate with an embedded device.

The embedded device is running a custom Linux version with a mosquitto broker (v 1.4.14) and several applications that communicate with this local broker.

The embedded applications are using the mosquitto C++ library.

 

On a test machine (running Windows 8 and Python 2.7.14) I’ve implemented a very simple application that connects to the embedded device, subscribes to a topic and prints out the received messages.

Everything is working properly, but when it comes to the on_disconnect() callback, it is never called.

I’d like to use the on_disconnect() callback to understand when the embedded device has finish to shutdown (and thus the mosquitto broker is not reachable any more), but since the on_disconnect() callback is never called I cannot tell this apart.

 

I’ve tried both with a keep_alive time of 60 seconds and 5 seconds in the connect() method.

 

Do you have any suggestion why I cannot get the disconnection?

 

Thank you very much,

Niccolo`


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

Back to the top