Does Serial LTE Modem support will message function?

Hi all,

I am working on nRF-9160 and nRF-9151, and I wanna know does Serial LTE Modem support will message function for MQTT connection or other connection?

I've asked AI about this, and got a replied telling that parameter "retain" of  AT#XMQTTPUB=<topic>[,<msg>[,<qos>[,<retain>]]] might be what I need.

But to what was documented on the page, I'm not sure if this is equivalence to will message function, also I'm not sure about whether I could set/clear the "persistently stored" message with this. Like if I PUB multiple times, will the message stacked up or only modified?

Parents Reply
  • Hello, 
    To what I've read (this article)
    the will message function I was looking for, should be acting like:
    Publishing a message to broker just like normal PUB, but instead of instantly sending the message to all the topic subscriber, the message would only be send if the client was unnormally disconnected.

    I am wishing this function for use case like SOS message / last gasp message for example.

    I have tested the retained parameter, but it doesn't act like what I need, it would store the message to that topic, and every subscriber would get the message as soon as they subscribe the message.

Children
  • Hello, based on the article, you want to have a message sent from the broker in case your device disconnects the broker/server i.e. "<device> disconnected broker, please reconnect"?

    I mean it does state in the article: the client can register a Will Message on the server when connecting. Where The Will Message is part of the server session state, and when the session ends, the Will Message cannot continue to exist separately. i.e. as long as the network connection is closed without the server receiving a DISCONNECT packet with a Reason Code of 0x00, the server needs to send the Will Message.

    And what you are asking for is that the Serial LTE Modem supports: The Will Message is specified when the client initiates a connection, and it is included in the CONNECT packet sent by the client along with fields such as Client ID and Clean Start.

    Is this correct?

    Kind regards,
    Øyvind

  • Hi,

    Yes, the statement meets the function I need. Server kept a message for client,  and that message will send to subscribers if the client was disconnected with out sending disconnect packet.

    I'm not sure how the will message function should be implemented, but according to MQTTX PC app I'm testing, the will message sure is designed to be configured in the same step of other settings like client-ID、Username、Password、Hostname... etc.

  • Ok, thanks for confirming! 

    There is currently no support in our Serial LTE Modem for Last Will Topic (LWT). But I can add this as a feature request. 

    Kind regards,
    Øyvind

  • Hi,

    Thanks for clarifying the information!

    Looking forward to the implement of the function!

  • Hello, happy to help! 

    I will update you as soon as I hear anything. My guess is that this won't be available until next release of nRF Connect SDK, at least. 

    Kind regards,
    Øyvind

Related