Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

senudajayalath
Posts: 17
Joined: Sun Jan 03, 2021 8:00 am

Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby senudajayalath » Sun Sep 26, 2021 9:59 am

Hi,

I have been going over BLE mesh documents and examples for sometime and is still not able to find an answer for my question. This is my question in brief.

I want to build a BLE mesh network where each node can send, relay and listen for messages. But from what I have learnt is that there are various server - client models which can be used to build a mesh network. It's more like a master- slave architecture.

So, if one node in the network uses a client model it can only communicate with nodes with server model. If one node uses a server model it can't send messages when it wants, but waits for a message from a client.

So how can I overcome this. What type of model should I use? Are there any example codes I can look into?

Or have I missed something important here. I am pretty new to BLE mesh. So, I would appreciate any guidance. Thanks

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby chegewara » Sun Sep 26, 2021 6:11 pm

Create group and add each node to that group, then subscribe and publish to that group. You can also publish to all nodes using special address 0xFFFF.

senudajayalath
Posts: 17
Joined: Sun Jan 03, 2021 8:00 am

Re: Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby senudajayalath » Mon Sep 27, 2021 6:27 am

So when I create a group what model should I use in each node? . Do you actually need a model for this ?

Is there any example I can follow?

Thanks a lot!!

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby chegewara » Mon Sep 27, 2021 6:43 am

https://docs.espressif.com/projects/esp ... ween-nodes

From sensor examples 1 device is sending and the other receiving (i didnt test it yet):
https://github.com/espressif/esp-idf/tr ... nsor_model


Best start is the simplest ON/OFF example:
https://github.com/espressif/esp-idf/tr ... _mesh_node

senudajayalath
Posts: 17
Joined: Sun Jan 03, 2021 8:00 am

Re: Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby senudajayalath » Mon Sep 27, 2021 11:51 am

Hi,

My requirement is for all the nodes able to send and receive. All the nodes should be equal. Not one node a serer and the other a client. How to accomplish this?

Using on/off example won't solve that according to my knowledge. Correct me if I'm wrong

Thanks

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: Peer to peer BLE mesh network where each node can send messages, relay messages and listen for messages

Postby chegewara » Mon Sep 27, 2021 2:13 pm

Agree, but it will help you to start with mesh.

For what you want to achieve you have sensors examples. and you will need to learn how to use it.
You can use server and client in the same node if you need. Here is also explanation how server can pusblish/send data:
https://docs.espressif.com/projects/esp ... -by-models

but it is enough with nrf mesh to set all nodes to subscribe to 1 group (or from code level) and setup all nodes to publish to that group or to all nodes (address 0xFFFF), also with nrf mesh app. There is option in each element (like sensor server) which can publish data, to publish with some defined interval.

Who is online

Users browsing this forum: awegel, StanInexeon and 99 guests