Bluetooth mesh sensor client example gives different outputs in different mobile devices

Hello

I tried bluetooth mesh sensor server and client example, everything is good including provisioning process in mobile but the output is different with different mobiles. i have 2 mobiles where i tested in both mobiles i get output of this part as shown in picture-1

picture-1

and

picture-2

and from the picture-2 of code except chip temperature i can see other printk functions in output.

I tried this in my colleague mobile in that i can see picture-2 outputs but not picture-1 output.

I am really confused, why this happens? Can anyone help me as soon as possible please...

Regards

SaSu

  • Hello,

    If you program the default, unmodified example to a DK, without provissioning it, What does the log look like? Mine looks like this:

    Is that not the case for you?

    I know it says that it is getting an error, but that is only because it is not provisioned that it returns:

    #define EADDRNOTAVAIL 125 /**< Can't assign requested address */

    Best regards,

    Edvin

  • Hi

    I am getting like this.

    So, what should i do now?

    Regards

  • Hello Edvin

    I am still waiting for your reply for the next step as i already told its very important to me. Hope you understand.

    Thank You

    Regards

  • Hello,

    I understand, but I am missing quite a few steps of understanding. What happens between you pressing the button on the thingy and you end up in the sensor_cli_data_cb()? Can you please try to set a breakpoint there to check the callstack? Where is the sensor->id being set? 

    Are you using the sample as it is descibred in the sample description? You have one node acting as a server and one as a client? The sensor_cli_data_cb() is triggered on the client, right? 

    I needed to try the sample that you are talking about, and I want to clear up a few things:

    The thingy is programmed with the sensor_server sample, not the sensor_client sample, right?

    Edvin said:
    Is it the same thingy that is running the application that produced the logs that you sent? Or does the Thingy send some message over Mesh to the device that printed the logs?
    SaSu said:
    It is the same thingy that sending the logs(eg: 4 seconds since presence detected when i pressed button on thingy)

    And the logs are coming from a separate device in the same network? So the callback is not a button handler. It is a callback handler from the sensor. 

    I need to leave the office now. I will be back on Monday. But you need to look into the implementation. Where in the sensor server is it triggering the message that triggers the callback in the sensor_client that prints the "presence detected" message. Because by default, it is not set up to send the temperature data. Alternatively, you can figure out how it prints the.

    65.000000 second(s) since last presence detected
    Relative runtime in 0 to 20 degrees: 0.000000 percent
    Relative runtime in 20 to 25 degrees: 0.000000 percent
    Relative runtime in 25 to 30 degrees: 100.000000 percent
    Relative runtime in 30 to 100 degrees: 0.000000 percent
    71.000000 second(s) since last presence detected
    

    Where it gathers the temperature data from. You should be able to find that. 

    Best regards,

    Edvin

  • pressing the button on the thingy and you end up in the sensor_cli_data_cb()?

    Yes it goes to  

    else if (sensor->id ==
    		   bt_mesh_sensor_time_since_presence_detected.id) {
    		if (value->val1) {
    			printk("%s second(s) since last presence detected\n",
    			       bt_mesh_sensor_ch_str(value));
    		} else {
    			printk("No presence detected, or under 1 second since presence detected\n");
    		}

    Already "No Presence detecte, or.....") will be printing and when i press "%s second(s) since last presence detected" will print as follows

    Can you please try to set a breakpoint there to check the callstack?

    Could not understand this, I could set break point as far as i know it really doesn't do anything just building process will stop till there(FYI: I doesn't get any errors in building process) and what is call stack and how can i check it? if you mean something different than what i understood.

    Where is the sensor->id being set?

    Its sending to sensor_cli_data_cb() but bt_mesh_sensor_present_dev_op_temp.id and bt_mesh_sensor_presence_detected.id id's are getting different don't know why. and sensor->id ==bt_mesh_sensor_time_since_presence_detected.id these id's are same that's why when we press or don' press that part is being printed.

    Are you using the sample as it is descibred in the sample description? You have one node acting as a server and one as a client? The sensor_cli_data_cb() is triggered on the client, right? 

    Yes, i am using the sample described in the sample description. Yes one node is server(i am using thing 53 with nRF5320_DK as server) and one node is client(i am using nRF42840_DK as client). Yes sensor_cli_data_cb() is triggering but only one if else part i.e as explained in above line.

    The thingy is programmed with the sensor_server sample, not the sensor_client sample, right?

    Yes, it is programmed in sensor_server not in sensor_client thats why i get some output right otherwise i will get some issues or errors.

    and FYI: everything is perfect with the sample program except

     this part is not triggering because bt_mesh_sensor_present_dev_op_temp.id and bt_mesh_sensor_presence_detected.id id's are different.

    And the logs are coming from a separate device in the same network? So the callback is not a button handler. It is a callback handler from the sensor. 

    Logs are coming from sensor_client with me its COM10 which i can see on PuTTY and those are being sent from sensor_server as it is a mesh sample example.

    Where in the sensor server is it triggering the message that triggers the callback in the sensor_client that prints the "presence detected" message. Because by default, it is not set up to send the temperature data. Alternatively, you can figure out how it prints the.

    I know from where it is sending the messages.

    from sensor_server from below part it is sending

    and from sensor_client

     here it receives. as you can see we use sensor types and as far as i figured that is main function to send and receive messages .

    (FYI: You please check the sample program and run by yourself and update me whether you get the "chip temperature" output or not. Because i checked with 3 mobiles and its same problem and you check it once, if its working please tell me what different you have done and if it is not please check it what is the problem because you are expert than me as i am student, i am really not able to figure out what is the problem as the id's are auto generated and its not user given values. I am literally trying since 2 months as i couldn't figure out i updated a forum question a month ago. I am really waiting for answer. Hope you understand).

    Thank You

    Best Regards

Related