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

Parents
  • Hi,

    1. Which devices did you use for the sensor server and client samples?
    2. Could you add the output you see on your mobiles as well? 
    3. Are there any differences between the mobiles? Different OS'?

    Kind regards,
    Andreas

  • Hello

    Sorry for late response. 1. For sensor_server thingy:53 with nRF5340DK and for sensor_client nRF52840DK

    2. From my colleague mobile i dont have screenshot also he is not available now its android and output comes from picture-2 i.e "chip temperature is .. ", "presence detected" and so on. I have two mobiles one is android and other is IOS so in both i could not see "chip temperature" output line its directly jumping to picture-1 i.e "Relative runtime in 0 to 30 degrees : 0.0000 percent" and also i can see presence detected lines when i press button on thingy-53.

    3. Already answered in point 2

    Regards

  • SaSu said:
    I set it to 10 it shows error

    What do you set to 10, and what error does it give?

    SaSu said:
    Could give me instructions how exactly to do that by any example code attached. It would be great so that i would get exact idea how to do that.

    Can you please upload what you already did?

    BR,

    Edvin

  • I did like below and it doesn't work

    With the error thing i did like below, I know its wrong

    int32_t val1==10;

    Please tell me what do you mean with example code and please tell me the working code which you already tested it and works as i already told you its important to me and since a month that this forum question is running.

    Regards

  • Well, we do not develop applications for customers here on DevZone, and to be fair, I have tried as best I can to get information.

    I can ask again:

    SaSu said:
    I set it to 10 it shows error . Could give me instructions how exactly to do that by any example code attached. It would be great so that i would get exact idea how to do that.

    What do you set to 10? How do you do it? is it the int32_t val1==10 from your snippet above? That is not setting anything. When you are using two "=", it is a comparison. That line doesn't make sense. It basically says:

    int32_t 1;

    or 

    int32_t 0;

    depending on whether val1 equals 10 or not.

    Is that the error you were talking about? Or is it some sort of function that returns an error?

    Why don't you try to change your button_handler_cb() in your sensor_server application to do this:

    static void button_handler_cb(uint32_t pressed, uint32_t changed)
    {
    	if ((pressed & BIT(0))) {
    		int err;
    
    		/* This sensor value must be boolean -
    		 * .val1 can only be '0' or '1'
    		 */
    		// struct sensor_value val = {
    		// 	.val1 = 1,
    		// };
            struct sensor_value val = {
    			.val1 = 1,
                .val2 = 500000,
    		};
    
    		// err = bt_mesh_sensor_srv_pub(&sensor_srv, NULL,
    		// 			     &presence_sensor, &val);
            err = bt_mesh_sensor_srv_pub(&sensor_srv, NULL,
    					     &chip_temp, &val);
    
    		if (err) {
    			printk("Error publishing presence (%d)\n", err);
    		}
    
    		prev_pres = k_uptime_get_32();
    
    		k_work_reschedule(&end_of_presence_work, K_MSEC(2000));
    	}
    }

    Then it should print something like this:

    Best regards,

    Edvin

  • Is that the error you were talking about? Or is it some sort of function that returns an error?

    Yes it is the error i am talking about and not any function i am getting and yes later i realised == is not making any sence

    Why don't you try to change your button_handler_cb() in your sensor_server application to do this:

    I did still shows nothing

    Regards

  • Hello,

    Did you change anything else in the project? Does it work like before if you revert the button handler back to default? Try the attached application in an unmodified (!) NCS v2.1.2:

    3343.sensor_server.zip

    BR,

    Edvin

Reply Children
Related