how to use 20735 mesh sendor models

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
zhjic_4227711
Level 1
Level 1

I download the sensor_temperature example to the 20735 boardA.Then I add a button event to the mesh_sensor_client example and download it to another boardB.However,when i push the button,I can't see  boardA recive the button event.Two boards are both provisioned.button code shows below:

/*

* Process interrupts from the button.

*/

void button_interrupt_handler(void* user_data, uint8_t pin)

{

    uint32_t value = wiced_hal_gpio_get_pin_input_status(pin);

    uint32_t current_time = wiced_bt_mesh_core_get_tick_count();

    uint32_t button_pushed_duration;

    WICED_BT_TRACE("button handler\r\n");

    wiced_bt_mesh_event_t *p_event;

    p_event = wiced_bt_mesh_create_event(0,MESH_COMPANY_ID_BT_SIG,WICED_BT_MESH_CORE_MODEL_ID_SENSOR_CLNT, 0xFFFF, 0xFFFF);

    if (value == 0)

    {

     //   WICED_BT_TRACE("interrupt_handler: duplicate pin:%d value:%d current_time:%u\n", pin, value, current_time);

        return;

    }

    if(p_event)

    {

        wiced_bt_mesh_sensor_setting_set_data_t sensor_data;

        wiced_result_t ret;

        uint8_t data[]="123";

        sensor_data.setting_property_id = 0x11;

        //sensor_data.setting_raw_val = data;

        memcpy(sensor_data.setting_raw_val,data,sizeof(data));

        sensor_data.prop_value_len=3;

        sensor_data.property_id=0x12;

        ret = wiced_bt_mesh_model_sensor_client_sensor_setting_send_set(p_event,&sensor_data);

        //wiced_bt_mesh_model_sensor_client_sensor_send_get();

        if(ret != 0)

        {

            WICED_BT_TRACE("data send fail\r\n");

            return;

        }

        WICED_BT_TRACE("data send sucess\r\n");

    }

  //  button_previous_value = value;

    //WICED_BT_TRACE("interrupt_handler: pin:%d value:%d current_time:%u\n", pin, value, current_time);

}

0 Likes
1 Solution

Hi zhangjianh_4227711,

Since WICED6.4 is not released in broad market, we will not be able to support you through cypress forum.

My apologies for the inconvenience caused.

Thanks,

-Dheeraj

View solution in original post

0 Likes
5 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Can you please share the modified project to test at our side?

0 Likes
lock attach
Attachments are accessible only for community members.

The code is attached.tem_sensor_LPN plays the role of LPN and temp_sensor_PFR play a role of proxy/friend/realy.My new code is little different from the old code in the forum.

Thanks!

zhangjianh@lierda.com

0 Likes

Hi zhangjianh_4227711,

Could you please let me know the version of SDK you are using?

Also can you please post the JSON file from the Android MeshController app. (Use export option to export the database to a JSON file)

There are few things which, I would like to mention,

  • Android Meshcontroller by default acts a temperature sensor client which is capable of receiving temperature changes I request you to use the app to understand the general working of temperature sensor

  • As per your requirement, you seem to be wanting to use a separate mesh device as a temperature sensor client, to make this working you will have to follow the below steps
    • After provisioning set the sensor servers publish address to group address.
    • Make sure sensor client is also subscribed to the group address
    • Configuration of the sensor (settings/cadence etc) can be done from Android Meshcontroller (we have app instruction available on the readme.txt of Android Meshcontroller)
    • Now when the user uses the onboard thermistor (may be rub the finger and place it on thermistor), temperature changes will be notified to the Sensor Client

Thanks,

-Dheeraj

I am using wiced6.4 and the default meshcontroller app.

I don't know how to publish or subscribe message to group address with wiced sdk.Can you show us an example?

Thanks.

zhangjianh@lierda.com

0 Likes

Hi zhangjianh_4227711,

Since WICED6.4 is not released in broad market, we will not be able to support you through cypress forum.

My apologies for the inconvenience caused.

Thanks,

-Dheeraj

0 Likes