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

nRF Mesh and uart

hi..... everyone 

I want to send the data from one node  to particular node and that same data should want to print in termite using uart . so i checked the ble_uart coexist example .so how to do this task . in this case which example i should use to pass the data from one to another node .

anyone can explain me clearly how do achieve this ?

Parents
  • Hi,

    You should be able to print the data by adding UART to the Mesh example. I suggest you have a look at this, Integrating Mesh into nRF5 SDK examples.

  • What do you mean by "I have entered the message in message paaramater"? The UART Coexistence example simulates a button press over UART, which will turn on/off a LED on a Light switch server. You should start with the Light switch example, the client can send a message to the server then server prints out the message via UART.

  •  here i have set my message , is it correct pls check here

    static void button_event_handler(uint32_t button_number)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Button %u pressed\n", button_number);
    
        uint32_t status = NRF_SUCCESS;
        generic_onoff_set_params_t set_params;
        model_transition_t transition_params;
        static uint8_t tid = 0;
    
        /* Button 1: On, Button 2: Off, Client[0]
         * Button 2: On, Button 3: Off, Client[1]
         */
     char arr[5] = "code";
     char ara[5] = "set";
     
        switch(button_number)
        {
            case 0:
            case 2:
                set_params.on_off = arr;
                break;
    
            case 1:
            case 3:
                set_params.on_off = Ara;
                break;
        }
    
        set_params.tid = tid++;
        transition_params.delay_ms = APP_CONFIG_ONOFF_DELAY_MS;
        transition_params.transition_time_ms = APP_CONFIG_ONOFF_TRANSITION_TIME_MS;
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);
    
    
        set_params.tid = tid++;
        transition_params.delay_ms = APP_CONFIG_ONOFF_DELAY_MS;
        transition_params.transition_time_ms = APP_CONFIG_ONOFF_TRANSITION_TIME_MS;
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);
    

  • Yes, it seems correct. Why have you :

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

    twice?

  • Thanks mttrinh , for your reply . by mistake its copied twice . Now , i have sent this character from client to server , and how do i check whether it is received to server side or not?

    here  , below pic client  side debug terminal results after i am  pressing button 1

     here , below pic  server side 

  • Hai Mttrinh
    I am following the instruction  as per you said above
    But firstly I am trying to send a custom data to uart like

    int main(void)
    {

    initialize();
    start();
    uart_init();
    uint32_t err_code;

    do
    {
    err_code = app_uart_put('p');
    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
    {
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- UART initiated successfully -----\n");

    //NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code);
    APP_ERROR_CHECK(err_code);
    }
    } while (err_code == NRF_ERROR_BUSY);

    in nrf_mesh light_switch example

    But i cant able to see any data in my terminal ( I am using tera term with 115200 baud rate)

    kindly help me

    Best regards

    venkatraaman

  • Hi,

    This is a very old case, I suggest you create a new ticket and include more information regarding the issue.

Reply Children
Related