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

LPN send acknowledged message

Hi,

I am using the low power node example and light switch server example from nRF5 SDK for Mesh v5.0.0.

I have one board as LPN to make friend with one board as light switch server(FN).

If sending unacknowledged message from LPN, the light in FN will switch on.

    uint32_t status = NRF_SUCCESS;
    generic_onoff_set_params_t set_params;
    model_transition_t transition_params;
    static uint8_t tid = 0;

    set_params.on_off = is_state_on;
    set_params.tid = tid++;
    transition_params.delay_ms = APP_ONOFF_DELAY_MS;
    transition_params.transition_time_ms = APP_ONOFF_TRANSITION_TIME_MS;
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);

    /* Demonstrate un-acknowledged transaction, using the client model instance */
    /* In this examples, users will not be blocked if the model is busy */
    status = generic_onoff_client_set_unack(&m_client,
                                            &set_params,
                                            &transition_params,
                                            APP_UNACK_MSG_REPEAT_COUNT);

If sending acknowledged message from LPN, the light in FN has no response.

    uint32_t status = NRF_SUCCESS;
    generic_onoff_set_params_t set_params;
    model_transition_t transition_params;
    static uint8_t tid = 0;

    set_params.on_off = is_state_on;
    set_params.tid = tid++;
    transition_params.delay_ms = APP_ONOFF_DELAY_MS;
    transition_params.transition_time_ms = APP_ONOFF_TRANSITION_TIME_MS;
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);

    /* Demonstrate acknowledged transaction, using 1st client model instance */
    /* In this examples, users will not be blocked if the model is busy */
    (void)access_model_reliable_cancel(m_client.model_handle);
    status = generic_onoff_client_set(&m_client, &set_params, &transition_params);

1. When the LPN sends message to switch light server, why the switch light server can receive unacknowledged message but can not receive acknowledged message? No matter the switch light server is FN or not, it can receive all normal messages such as unacknowledged message and acknowledged message?

2. Can I adjust the timing of receiveDelay and receiveWindow to receive the acknowledgment?

Many thanks.

  • Hi, 

    Have you checked on the access level (on the server ) the packet arrived?

    I would suggest to printout log on the access layer (you look into access.c you can find where we print out "RX:"

    Regards,

    Amanda H.

  • Hi Amanda H.,

    I think it can not enter mesh_msg_handle in access.c. 

    The log is attached as below:

    <t:          0>, main.c,  473, ----- BLE Mesh Light Switch Server Demo -----
    <t:      13390>, main.c,  429, Initializing and adding models
    <t:      13394>, main.c,  272, App OnOff Model Handle: 2
    <t:      13397>, main.c,  277, App DTT Model Handle: 3
    <t:      13401>, main.c,  283, App Scene Model Handle: 5
    <t:      13460>, main.c,  407, Node Address: 0x0005 
    <t:      13463>, mesh_app_utils.c,   66, Device UUID (raw): EEBB1097469A49C597E57B5186DD8967
    <t:      13466>, mesh_app_utils.c,   67, Device UUID : EEBB1097-469A-49C5-97E5-7B5186DD8967
    <t:      13498>, main.c,  523, 
    		-------------------------------------------------------------------------------
    		 Button/RTT 1) LED state will toggle and inform clients about the state change.
    		 Button/RTT 4) Clear all the states to reset the node.
    		-------------------------------------------------------------------------------
    <t:      14030>, app_onoff.c,  154, msg: SET: 0
    <t:      14038>, main.c,  254, Transition time: 0, Target OnOff: 0
    <t:     232382>, friend.c,  933, Friend request (0x0006): offer delay: 147, rDelay: 100, pTimeout: 10000, prevAddr: 0x0005, elements: 2
    <t:     232387>, friend.c,  941, Friend offer: rWindow: 5, queueSize: 35, sublistSize: 16, rssi: -71, fcnt: 0
    <t:     232396>, friend.c,  323, Friend TX: opcode:4 nid:0x18 dst:0x0006 tx_time:7237690 
    <t:     232399>, friend.c,  324, Friend TX: 052310B90000
    <t:     237308>, friend.c,  794, Friend poll (0x0006): fsn: 0 (prev: 0)
    <t:     237315>, friend.c,  323, Friend TX: opcode:2 nid:0x6A dst:0x0006 tx_time:7341516 
    <t:     237319>, friend.c,  324, Friend TX: 000000000000
    <t:     237322>, friend.c,  817, Friendship established (0x0006)
    <t:     237325>, friend.c,  258, Clearing recently seen LPN: LPN 0x0006
    <t:     547745>, friend.c,  794, Friend poll (0x0006): fsn: 1 (prev: 0)
    <t:     547753>, friend.c,  323, Friend TX: opcode:2 nid:0x6A dst:0x0006 tx_time:16815337 
    <t:     547757>, friend.c,  324, Friend TX: 000000000000
    <t:     551269>, friend.c,  794, Friend poll (0x0006): fsn: 1 (prev: 1)
    <t:     551277>, friend.c,  323, Friend TX: opcode:2 nid:0x6A dst:0x0006 tx_time:16922876 
    <t:     551281>, friend.c,  324, Friend TX: 000000000000
    

    There is no print out "RX:"

    Best Regards,

    Daisy

  • Hi Daisy, 

    Seems it is because ack_transaction_status_cb is not implemented in lpn example, then generic_onoff_client_set function returns NRF_ERROR_NULL and the example asserts.

    You need to add the callback like it is done in the light switch client example: https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/blob/master/examples/light_switch/client/src/main.c#L163-L186

    Regards,

    Amanda H.

Related