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? 

Parents
  • 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. 

Reply
  • 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. 

Children
  • 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. 

Related