How Mesh Sensor Client code works in CYBT213043

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

cross mob
NaB_2049561
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Hi,

I am not able to understand the mesh sensor client code. What it does. Ideally, it is suppose to listen all the sensors after provisioning right? I am not able to read any sensor data. But, I can able to read the all sensor data after configuring Publication in MeshLighting App.

How can I read all the provisioned sensors and print on UART inside client. I am using Modustoolbox2.0.

I have observed one more thing that, My code is not entering into

void mesh_sensor_client_message_handler(uint8_t element_idx, uint16_t addr, uint16_t event, void *p_data).

I am not using any HCI commands. In future, I would like to use HCI.

Naveen

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi NaB_2049561

Mesh works on publish- subscribe paradigm.

Provisioner is used to provision and configure the device. After successfully configuring the device, it will publish to the publish address and whoever are subscribed to the address can receive the published messages. So you have to configure the publication.

Configure all the provisioned sensors to publish to the specific sensor_client or a group of nodes where the sensor_client present or to the entire network. Then client can get the messages and process it and if needed you can print the data also.

mesh_sensor_client_message_handler( ) will be called whenever you get a valid message over mesh. ("Process event received from the sensor Server.").

HCI commands will be processed by the function mesh_app_proc_rx_cmd().

Here are the few useful links to understand the mesh implementation.

Thanks,

-Dheeraj

View solution in original post

5 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi NaB_2049561

Mesh works on publish- subscribe paradigm.

Provisioner is used to provision and configure the device. After successfully configuring the device, it will publish to the publish address and whoever are subscribed to the address can receive the published messages. So you have to configure the publication.

Configure all the provisioned sensors to publish to the specific sensor_client or a group of nodes where the sensor_client present or to the entire network. Then client can get the messages and process it and if needed you can print the data also.

mesh_sensor_client_message_handler( ) will be called whenever you get a valid message over mesh. ("Process event received from the sensor Server.").

HCI commands will be processed by the function mesh_app_proc_rx_cmd().

Here are the few useful links to understand the mesh implementation.

Thanks,

-Dheeraj

Thanks for this AppNote: https://www.cypress.com/file/473921/download , very useful. It explained code line by line.

Since, I come from PSoC 4 & PSoC Creator land, I was kind of disappointed with BT Mesh & Modustoolbox at first.

But, not anymore. As always, Cypress makes the best in class documentations and support material compared to other silicon manufacturers !

0 Likes

Evan I like the Cypress semi solutions. It's matter of time. As we go through inside solutions eventually we start liking it.

0 Likes

Hi ShHo_1410221​, NaB_2049561,

Thank you for your valuable feedback. It means a lot.

@NaB_2049561 : The source code for MeshClient, Android/IOS and ClientControl applications are also there with the SDK (WICED or Modus). It will be useful in development of host side application.

"\components\BT-SDK\common\apps\snip\mesh\peerapps"

Thanks,

-Dheeraj

0 Likes
NaB_2049561
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Thanks DheerajP_41​.

I am using mesh lighting App. Initially, I configured client publish settings as Publish to 'all'. As I set it to 'all  nodes' I started observing my data on UART.

If any host side C code example for HCI control will be great help.

Regards,

Naveen

0 Likes