Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Mosquitto connection disconnection message time

On Mon, May 23, 2016 at 12:02 PM, Rajeev Kumar <rajeev_ku@xxxxxxx> wrote:

> def on_connect(client, userdata, rc):
>     client.will_set("Heart/Lwt", payload=str(datetime.datetime.now())+
>         " Disconnected From Broker", qos=2, retain=False)


You can't set the will after you have connected. It must be set before you call client.connect*().

The code you posted is a start, but it's not a complete example. Please refer to these guides on asking questions and providing examples:

http://stackoverflow.com/help/how-to-ask
http://stackoverflow.com/help/mcve

Cheers,

Roger



Back to the top