Where is the polled message from the Friend Node stored?

Using the Low Power node example with the light switch server example. 

The LP Node successfully polls messages from the friend node. 

I am struggling to figure out, WHERE the polled messages are located. Can someone tell me in which data structure the polled messages are stored? 

  • Hi Hypn, 

    As far as I know, there isn't a buffer specifically for message from friend node. The packets from friend node are received the same way as normal mesh packet. So it's transparent to the transport and access layer if the packet is received from a friend node or it receive from a relay node (like normal non LPN node) 
    Could you let me know what's the exact issue you are dealing with ? 

  • Hello, 

    Thank you for your reply. 

    I am currently testing the Low Power node example with the light switch server from the Light switch example

    SDK: 17.02

    Mesh: 5.0

    Hardware: nRF52840DK 

    Overall the example works fine. When I press the ON or the OFF Button on the LPN node, the LED on the Server Nodes turn on or off. 

    It is also possible to establish a friendship with one of the servers. However, in my understanding, the LPN node should react on polled messages from its friend node. (If i press Button1 on the friend node, the LED state on the friend node changes and this information should be forwarded to the befriended low power node). 

    Unfortunately I do not receive such a status update at the LP node. The only messages I see, when the LPN established a friendship are the following: 

    <t: 2112622>, main.c, 481, Friend poll procedure complete
    <t: 2423083>, main.c, 481, Friend poll procedure complete
    <t: 2733507>, main.c, 481, Friend poll procedure complete
    <t: 3043956>, main.c, 481, Friend poll procedure complete
    <t: 3354407>, main.c, 481, Friend poll procedure complete

    Shouldn't I see a LED status update at the LPN node if the LED status at the server node changed? 

    In the main.c of the lpn code, the following callback is implemented: 

    /* Generic OnOff client model interface: Process the received status message in this callback */
    static void app_generic_onoff_client_status_cb(const generic_onoff_client_t * p_self,
                                                   const access_message_rx_meta_t * p_meta,
                                                   const generic_onoff_status_params_t * p_in)
    {
        if (p_in->remaining_time_ms > 0)
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "OnOff server: 0x%04x, Present OnOff: %d, Target OnOff: %d, Remaining Time: %d ms\n",
                  p_meta->src.value, p_in->present_on_off, p_in->target_on_off, p_in->remaining_time_ms);
        }
        else
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "OnOff server: 0x%04x, Present OnOff: %d\n",
                  p_meta->src.value, p_in->present_on_off);
        }
    }

    I think this function should be called at the lpn node when the server led status changed. 

    Maybe I did something wrong when provisioning the hardware with my app? 

    The Publish Adress of the Generic On/OFF Server of the Light Switch is set to the Unicast Adress of the LPN Node. 

    The Subscribed Adress of the Generic On/OFF Server of the Light Switch is set to the Group Adress 0xC002. 

    The Publish Adress of the Generic ON/OFF Client of the LP Node is set to the Group Adress 0xC002. 

    The Generic ON/OFF Client of the LP Node is not subscribed to the group adress. 

  • Hi hypn, 

    I found that if you set the publication address of the server node to the LPN node (the LPN node has 2 elements, the first one is only health and configuration, the second one is the generic on off client, so you need to point the server to the 2nd element (address +1)) I can receive the call back : 

    Note that there is a timer that automatically send a OFF packet after you click ON. 

    Explanation for that is that the friend only register the LPN address as the subscription address. So if you want to define a group address to use instead of the unicast address, you need to add to the LPN the address you want to subscribe to, add to the light server the address you want to public to. Then reestablish friendship, then after that you should receive the status from the server on the LPN.

    Another option is to send acknowledge set, then you should receive callback. Note that you would need to define app_gen_onoff_client_transaction_status_cb if you want to send reliable message, the same as in the light switch client example. 

  • Thank you for your answer.

    So you say I have to change the subscription adress of the nRF5x Mesh Light Node to the ELEMENT Adress, in which the Generic ON/OFF Model is saved in the LP Node? By using the App?

    I tried this, however, I still don't get any messages in the RTT output of the LP Node. 

    Here you see the three Nodes in my App: 

    The LP Node with its Elements and its Elements Adresses: 

    The Setting I am using for the Generic ON OFF Client of the LP node:

    It publishes to the Group 0xC002 and is not subscribed to anything. 

    Then the elements of the light server with the corresponding adresses: 

    The Setting of the Generic On Off Server of the Light Server Node:

    (The Light Server publishes directly to the LPN Node Element with adress 0x001C and is subscribed to the Group 0XC002). 

    Sorry I am very confused and I have no clue where the problem is. 

    Regarding your statetement: 

    Note that there is a timer that automatically send a OFF packet after you click ON. 

    I noticed this behaviour. Whats the purpose of this behaviour? This should be mentioned in the Low power example documentation page since I thought there might be a problem with the provisioning process or something and I spent some time to figure this out. 

    Kind Regards, 

  • Hi, 
    In my test here I just need to set the publication address of the Light Switch Server to the LPN node and it works. In your case it's 0x001C. Please make sure to reestablish the friendship after that. (In my test the friend node and the light switch server is the same node).

    Please set the publication address of the LPN light switch client to the unicast address of the light switch server, in this case 0x001D.

Related