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

Packet delivery ratio more than 1

I  have 2 client  nodes and 1 server node . How can i possibly recieve packets more than i send. I sent 114 packets from 1 node and 104 from another . I am receiving 302 packets on server side. Now i know that in ble mesh to increase the message receiving probability a message is forwarded multiple times by the relaying node or client node , But if u can explain me this phenomenon in a more elaborate way i will be happy.

Parents Reply Children
  • I have modified the light dimming model and I am periodically sending data

    static void handle_set(access_model_handle_t model_handle, const access_message_rx_t * p_rx_msg, void * p_args)
    {

    generic_level_server_t * p_server = (generic_level_server_t *) p_args;
    generic_level_set_params_t in_data = {0};
    model_transition_t in_data_tr = {0};
    generic_level_status_params_t out_data = {0};

    //if (p_rx_msg->length == GENERIC_LEVEL_SET_MINLEN || p_rx_msg->length == GENERIC_LEVEL_SET_MAXLEN)
    {
    // generic_level_set_msg_pkt_t * p_msg_params_packed = (generic_level_set_msg_pkt_t *) p_rx_msg->p_data;
    fmc_set_node_params_t * p_msg_params_packed = (fmc_set_node_params_t *) p_rx_msg->p_data;


    Current_State.pH_VALUE=p_msg_params_packed->pH_Value;
    volatile float pH=40.25;
    Current_State.WATER_LEVEL = p_msg_params_packed->Water_Level;

    Current_State.TEMPERATURE =p_msg_params_packed->Temperature;
    Current_State.from_node_address = p_msg_params_packed->Node_address;

    // NRF_LOG_INFO("My float number: \"NRF_LOG_FLOAT_MARKER\"\r\n", NRF_LOG_FLOAT(Current_State.pH_VALUE));

    //*************************FMC UART***************************??


    mesh_packet_recieved++;

    char tx_message[150];
    // tx_message=(char*)malloc(sizeof(char));

    if (model_tid_validate(&p_server->tid_tracker, &p_rx_msg->meta_data, GENERIC_LEVEL_OPCODE_SET, in_data.tid))
    {
    /* if (p_rx_msg->length == GENERIC_LEVEL_SET_MAXLEN)
    {
    if (!model_transition_time_is_valid(p_msg_params_packed->transition_time))
    {
    return;
    }

    in_data_tr.transition_time_ms = model_transition_time_decode(p_msg_params_packed->transition_time);
    in_data_tr.delay_ms = model_delay_decode(p_msg_params_packed->delay);
    }*/

    valve_set_packet node_valve_action;
    set_valve_action(Current_State,&node_valve_action);
    node_valve_action.node_address = Current_State.from_node_address;

    fmc_valve_status_send(p_server,p_rx_msg,&node_valve_action);
    sprintf(tx_message,"\n\r%d: Node: %0.4x pH_Value: %f Moisture_Value: %f Temperature: %f pH_Valve: %d water_valve: %d \n",
    Rpi_MessageNum++,Current_State.from_node_address,Current_State.pH_VALUE,
    Current_State.WATER_LEVEL,Current_State.TEMPERATURE,
    node_valve_action.pH_valve.time,node_valve_action.waterValve.time);

    // sprintf(tx_message,"Action%d: Node: %0.4x pH_Valve ON for : %d Water Valve ON for: %d ",Current_State.from_node_address,node_valve_action.pH_valve.time,node_valve_action.waterValve.time);
    //nrf_mesh_serial_init(NULL);
    // nrf_mesh_serial_enable();
    int status=nrf_mesh_serial_tx(tx_message,sizeof(tx_message));

    //serial_uart_tx_start();
    int a,i=0;
    // while(tx_message[i]!='\0')
    {//
    serial_uart_byte_send(tx_message);

    }
    // while (app_uart_put(tx_message) != NRF_SUCCESS);
    if(status==NRF_SUCCESS)
    { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "-----NRF SUCCESS \n: %s -----\n",tx_message);
    }
    (void)fmc_status_send(p_server,p_rx_msg,&Current_State);
    /* if (p_rx_msg->opcode.opcode == GENERIC_LEVEL_OPCODE_SET)
    {
    (void) status_send(p_server, p_rx_msg, &out_data);
    }*/
    }
    }
    }

    Whenever handle set callback is called i am updating the received message counter . It is high lighted.

    and on the client side 

    void fmc_publish_cb()
    {
    fmc_set_parms();
    model_transition_t transition_params;
    transition_params.delay_ms = APP_CONFIG_LEVEL_DELAY_MS;
    transition_params.transition_time_ms = APP_CONFIG_LEVEL_TRANSITION_TIME_MS;
    // access_model_publish_ttl_set(m_clients[0].model_handle,10);
    mesh_packet_sent++;
    fmc_client_set(&m_clients[0], &fmc_set_node_params, &transition_params);
    latency_counter[transaction_number]=app_timer_cnt_get();
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- Message sent waiting........ -----\n");
    //app_timer_start(node_latency_timer_id,latency_counter[i],NULL);
    }

    the recieved message is being updated at generic_leve_server.c

    and the sent message is getting updated at main.c

  • Can you see if you get the right amount of packets if you only send from one client?

  • With just 1 client also i am receiving packets more than i send

  • Hi,

    Have you had any progress with this? When sending packets from one client, how many received compared to how many sent? 

    If you send the same amount of packets each time, does the amount of packets received change or is it the same each time?

Related