cancel
Showing results for 
Search instead for 
Did you mean: 

How to send packet between mesh nodes by BLE_MeshLightingDemo Example.

Jlai.9
Associate II

Hi Sir:

I try to use BLEMesh_SetRemoteData(..) with Unicast Address from BLEMesh_GetAddress() for sending packets between two nodes, but the received node dosn't call the Vendor_WriteLocalDataCb().

Is there any suggestion for me to send the packets with manually fiiled payload between Mesh nodes ?

Thanks,

Jack

4 REPLIES 4
EMECH
ST Employee

​Hi Jack,

What is the use case ? What do you mean by sending packets ?

Just for information, Bluetooth Mesh packet sizes are 15 bytes for unsegmented messages (unack'd/unreliable), however, it is also possible to send a segmented/reliable message which can consist of 12 bytes per packet (3 byte packet overhead for segmentation) with a 32 segment max, which would yield a 384 byte total message size.

Obviously, segmented messages are much slower than unsegmented due to the required ack'd response from the receiver.

It is not possible to send 1KBs in a single packet or even feasible to send over multiple messages.

You should note that Bluetooth mesh in its current version (v1.0) is primarily targeted at command/control type applications and therefore the concept of flooding 1K bytes across the mesh is not a primary or expectant use case.

Hopefully Mesh v1.1 will deliver an additional bearer layer which incorporates advertising extensions and additional throughput enhancements, to be confirmed. 

Best regards.

EMECH
ST Employee

​Jack,

Before the 2 nodes has to be provisioned, and configured with the smartphone Mesh application.

The Client node have to be configured as a publisher to the Server node.

The Server node have to be configured as a subscriber to the Client node.

On the application SW side before using the BLEMesh_SetRemoteData() function, you have to get the publish address (a provisioned node can publish to One node or Group) with the BLEMesh_GetPublishAddress() function.

BLEMesh_GetAddress() function give the address of the node that will publish, no the publication address node.

You have an example of the functions use in the function BLEMesh_ModelsCommand() of the models_if.c file.

This function is called each time there is a short SW1 button press.

Best regards.

Best regards.

Hi Eric:

Thank you for your information, but I am not familiar with BLE mesh.

So I still have few questions!

(1)

I have two nodes provisioned, and the send message like below.

Can I send the message like this?

Send Node:

Unicast Address: 0x0003 from BLEMesh_GetAddress()

TX:

#define TX_DATA_LEN 5
 
MOBLEUINT8 tx_data[TX_DATA_LEN] = {0x00, 0x01, 0x02, 0x03, 0x04};
 
MOBLEUINT32 tx_data_len = TX_DATA_LEN;
 
BLEMesh_SetRemoteData(0x0004, 0x00, APPLI_LED_CONTROL_STATUS_CMD, tx_data, tx_data_len, MOBLE_TRUE, MOBLE_FALSE);

Receive Ndoe:

Unicast Address: 0x0004 from BLEMesh_GetAddress()

RX:

MOBLE_RESULT Vendor_WriteLocalDataCb(MOBLE_ADDRESS peer_addr, 
 
                  MOBLE_ADDRESS dst_peer, 
 
                  MOBLEUINT8 command, 
 
                  MOBLEUINT8 const *data, 
 
                  MOBLEUINT32 length, 
 
                  MOBLEBOOL response)
 
{
 
 // Not going into here...
 
}

(2) How to configure Client/Sever Node to publisher/subscriber ?

Best regards,

Jack

Hi EMECH,

How to send and receive segmented message?

Correct me if I am wrong. If I send 100 bytes of segmented message, means that BLE Mesh handle all internal communication and on receiver I get complete data of 100 bytes?

And one more question, is it possible to write "default provision data" by user application from CortexM4 STM32WB? I want to avoid use smartphone to configure each node.

Best Regards