This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Regarding BLE Mesh Model Publish & Subscribe

Hello Developers,

  I have just started playing around with BLE Mesh Zephyr examples on my recently purchased nRF52840-PDK board.

Anyways, I am bit stuck with one fundamental concept of Publish & Subscribe. Any insight to this will be highly appreciable!

I have following two questions..

Question #1)  I want to understand basic difference between sending a message & publishing a message in BLE Mesh context. Let me explain what I mean, with a  very basic example of OnOff Light.

I understand, there would be Generic OnOff client model which will  *SEND* some message (Get/Set) about light state(ON or OFF) to a remote node, which has Generic OnOff Server Model. In case of  Set, after Server state is toggled,  Server *SEND* an unacknowledged status message reporting its current state and other information.

I am confused, whether this *SEND*  thing is equal to *PUBLISH* or it is different? Is *SENDING* a message is same as *PUBLISHING* a message? If it is different, please help me understand how?

Question#2) In Mesh Profile specification, I have noticed that, both Generic OnOff Client & Server Model support both Publish & Subscribe both.

I am unable to understand, in which case, Generic OnOff client would need Subscription & in which case Generic OnOff Server would need Publication?

Normally, it is easy & natural for me to think, *client support publish* & *server support subscribe*. May be I am missing some use cases!

Looking for some quick reply, so that I can proceed with my node configurations more meaningfully! Thank You very much!

BR,

  • Hi Joakim,

     Thanks for the clarification. One last question based on the below example.

    Example:

    1. Generic OnOffclient sets light state ON to OFF to the Generic OnOff Server.

    2. Generic OnOff Server sends Unicast status to Generic OnOff client.

    3. Generic OnOffServer publishes unsolicited *status* to the publish address

    In step#3, If the publication is set in the Generic OnOffServer,

    - Does it become mandatory to publish the unsolicited *status* messages by the server?

    - Does it become mandatory to publish the unsolicted *status* messages periodically as per publication period? 

  • I'm not really sure if I understand the question here.

    If you have configured periodic publishing, it should publish the message at the given, defined period.
    I want to emphasise that you don't have to use periodic publication if you only want to send messages on, i.e user interaction.

    Br,
    Joakim

Related