This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending a message to a BLE mesh node through advertising.

HI, 

I know about the proxy feature/nodes and the way in which a smartphone can connect to a proxy node and send a message. However, in the mentioned method we need to connect to a node (which must have the proxy feature)!  

I was wondering, can I use an application like nRF connect or a customized app in order to to do the advertising and in this way, I send my desired set/get message to any node in the range?

In this way the connection and existence of a proxy node is not needed anymore, probably the main problem is the NetKey but there should be a solution for that,


Thanks

Parents
  • Hi. 

    Neither iOS or Android support BLE mesh directly. However, you can implement the high level mesh protocol (network layer and up) in the application, as indicated the Bluetooth SIG mesh FAQ:

    What do I need to build a Bluetooth mesh networking smartphone application?
    To develop smartphone or tablet applications for use with Bluetooth mesh networking products, if your mobile operating system provides suitable APIs which allow an application to meet the requirements relating to Bluetooth LE advertising packets defined in the Mesh Profile specification, you should use the advertising bearer. The advertising bearer is the preferred bearer in all cases. Where the advertising bearer cannot be used, you may use the Bluetooth mesh proxy protocol to enable communication with the mesh network via a proxy node. The proxy protocol can be implemented on top of standard Bluetooth Low Energy GAP and GATT APIs.

    This is for example done in the nRF Mesh app (and IOS-nRF-Mesh-Library and Android-nRF-Mesh-Library).

    Bluetooth Mesh is not a network that sends normal advertising packets. It is true that it uses advertising packets to communicate, but it sends special advertising data that contains mesh packets. It has built other protocols on top, and the actual data is formatted differently from that of normal BLE advertising packets.

    If you take a look at the Beaconing example in the nRF5 SDK for Mesh, this example registers a RX callback that is invoked for all packets that are processed by the mesh after the mesh
    itself has processed them.

    Hence, any regular advertisment packets that does not have the mesh advertisment type will trigger this callback. So once you registered the callback and  receive a advertisment packet, you will have to create a mesh packet and publish it to a unicast or group address. Unless you're only going to turn on or off a light based on the beacon data you will have to create your own client and server model that pusblish and subscribe to the beacon data. 

    See the Creating new models in the nRF SDK for Bluetooth Mesh documentation.

    Best regards, 
    Joakim

Reply
  • Hi. 

    Neither iOS or Android support BLE mesh directly. However, you can implement the high level mesh protocol (network layer and up) in the application, as indicated the Bluetooth SIG mesh FAQ:

    What do I need to build a Bluetooth mesh networking smartphone application?
    To develop smartphone or tablet applications for use with Bluetooth mesh networking products, if your mobile operating system provides suitable APIs which allow an application to meet the requirements relating to Bluetooth LE advertising packets defined in the Mesh Profile specification, you should use the advertising bearer. The advertising bearer is the preferred bearer in all cases. Where the advertising bearer cannot be used, you may use the Bluetooth mesh proxy protocol to enable communication with the mesh network via a proxy node. The proxy protocol can be implemented on top of standard Bluetooth Low Energy GAP and GATT APIs.

    This is for example done in the nRF Mesh app (and IOS-nRF-Mesh-Library and Android-nRF-Mesh-Library).

    Bluetooth Mesh is not a network that sends normal advertising packets. It is true that it uses advertising packets to communicate, but it sends special advertising data that contains mesh packets. It has built other protocols on top, and the actual data is formatted differently from that of normal BLE advertising packets.

    If you take a look at the Beaconing example in the nRF5 SDK for Mesh, this example registers a RX callback that is invoked for all packets that are processed by the mesh after the mesh
    itself has processed them.

    Hence, any regular advertisment packets that does not have the mesh advertisment type will trigger this callback. So once you registered the callback and  receive a advertisment packet, you will have to create a mesh packet and publish it to a unicast or group address. Unless you're only going to turn on or off a light based on the beacon data you will have to create your own client and server model that pusblish and subscribe to the beacon data. 

    See the Creating new models in the nRF SDK for Bluetooth Mesh documentation.

    Best regards, 
    Joakim

Children
  • Hi Joakim,

    Thanks a lot for your response, I found it helpful, however, I have to say 
    I am aware of the answer in the FAQ in the Bluetooth website that you mentioned and most of your points. Also, I understand that data packets in the BLE mesh are different from the regular BLE. 


    You wrote and it is already written in another answer in this forum that: 
    "Neither iOS or Android support BLE mesh directly. However, you can implement the high level mesh protocol (network layer and up) in the application"

    You also wrote: "This is for example done in the nRF Mesh app"

    My question is, then is it possible to develop an app that does the job through advertising? and not exactly like nRF mesh app.
    It seems that nRF Mesh app uses the GATT bearer and as a result, it must connect to a node with the proxy feature enabled to be able to send a message to a BLE mesh network, and at this point, this mentioned proxy node uses the Advertising bearer to transfer the message to the other nodes!

    However, I am interested in sending directly a message to a mesh network using the Advertising bearer and without connection. I know this is not supported directly in the iOS or Android, but I am saying that it is possible to develop an app (implementing the whole BLE mesh stack network layer and up), so that what I said would become possible, am I right? can you confirm that?

    Thanks in advace

  • NORD44 said:
    I am saying that it is possible to develop an app (implementing the whole BLE mesh stack network layer and up), so that what I said would become possible, am I right? can you confirm that?

     That should be possible! 

    I got some information from one of our mobile developers. He said that Android devices can do low latency scan, so it is possible to modify the Android-nRF-Mesh-Library for creating the ADV bearer feature. 

    We removed the BLE transport from the library so that users can implement GATT or ADV around it. 

    Unfortunately we don't have any example code on how to achieve this. 

    Best regards, 
    Joakim 

  • Thanks a lot, Joakim.

    Alright, then let's say it's possible, at this point, I think what I would do is to develop, for example, the Android version of the "Light switch client".

    I mean nRF mesh app is used to provision un-provisioned devices as well as connect to proxy nodes using GATT. So, if I want to use the ADV bearer to send a message I need to provision the smartphone itself in the first place, and I am not sure if a provisioner can provision itself or not, or in this case, I can use "Android-nRF-Mesh-Library" to provision other devices as well as the smartphone itself or not.

    So maybe developing something like a "Light switch client" android app, could be the easier solution, so that the smartphone which runs the client app is provisioned by the nRF mesh app along with other devices and a then the above-mentioned android client app could use the ADV to send a message to all nodes.

    Could you shed some light on that? still possible? 

    Thanks again.


  • Hi. 

    I'm no expert on the application development side of things, so I'll need to talk to our mobile developers again about this. 

    I'll get back to you with more information.

    Best regards, 
    Joakim

Related