3944 views|7 replies

6062

Posts

4

Resources
The OP
 

[Free trial of Pingtouge Bluetooth Mesh Gateway Development Kit] + nRF Mesh and Light Experiment (Part 2) [Copy link]

This post was last edited by damiaa on 2021-10-31 20:15

[Free trial of Pingtouge Bluetooth Mesh Gateway Development Kit] + nRF Mesh and light experiment

Devices and Nodes

When a device becomes part of a Bluetooth mesh network, we call it a node. Otherwise, it is called an "unprovisioned device". The process of turning an unprovisioned device into a node is called " provisioning " .

element

For example, a set of headlights has three sub-lights in a physical device, each of which can be accessed through addressing. The sub-lights are called elements , and the headlights are called nodes. Each element corresponds to a unicast address.

Bluetooth mesh model

Mesh applications define a typical "client-server" architecture using "publish-subscribe". Three different modes are defined: Client, Server, and Control.

Server model : defines states, state transitions, state bindings and the messages they contain. It also defines the behaviors associated with these messages, states and state transitions.

Control model : It has the functionality of a client model to interact with other server models, and it can also have the functionality of a server model to interact with other client models. It has a built-in logical control layer (a set of rules and behaviors to coordinate the interaction among the models connected to it).

Client model : does not define any states, but it defines which messages to send and receive. These messages are defined to GET, SET or retrieve the states defined in the Server models.

Each Model corresponds to a Model ID (which can be divided into SIG Model ID and Vendor Model ID), which is similar to the address of this Model.

Addresses

Three types of addresses are defined in Bluetooth mesh: unicast address, group address and virtual address.

Message , States and Properties

Messages can be used to obtain and change state values, as well as attribute values. For example, messages for reading and controlling switches. Messages are the smallest unit of data transmission between nodes in a Bluetooth Mesh network.

For example, an onoff command is a message, and a brightness adjustment command is also a message.

To perform an operation, the basic mechanism is to call the message. A given message type represents an operation on a state or the collection of multiple states. All messages can be divided into three simple types: get, set, and status.

Most mesh messages operate on the state, and only special messages related to attributes operate on the attributes.

Publish / Subscribe

The action of sending a message in Bluetooth mesh is called publishing. Telling others what happened or what was done is called publishing. Anyone who is interested in certain messages can subscribe to these contents. Nodes publish messages to unicast addresses, multicast addresses or virtual addresses.

Nodes interested in receiving this data can subscribe to these addresses.

Bound States

When one state is bound to another, changes in one will affect changes in the other.

Bluetooth Mesh Key ( DevKey, AppKey, NetKey )

AppKeys are used to protect communications at the upper transport layer, and NetKeys are used to protect communications at the network layer. Both types of keys are shared between nodes. There is also a device key (DevKey), which is a special application key unique to each node and known only to the node and the configuration client, and is used to

Used to protect the communication between nodes and configuration clients.

Double lamp combination experiment

Burn the modules of Light 1 and Light 2 : Generate and compile mesh_light_node_demo in the CDK integrated development environment of Jianchi. Pay attention to modifying the uuid so that the uuids downloaded to the two lights are different. As shown below:

When flashing, the MAC address must be changed to be different. This should be done for all future devices. Otherwise, there will be problems if there are devices with the same MAC address in a mesh network.

When burning the device, you need to connect the serial port, dial J5 TM to VCC, then press reset, and you will see the prompt uart... Fill in the mac address, load the file in hex, then erase and write, and you will be prompted after success .

If you connect to putty and press reset, you can see the following:

To access the network, open nRF Mesh. The latest version is 3.16 ( the mobile phone is used as the Provisioner of the network device ).

There are actually only a few actions for network access, one is to create a group , one is to access the network , and one is node configuration (one is appkey , BIND KEY, and the other is to set the publishing address for switch devices and the subscription address for lighting devices. The publishing address and subscription address can be : unicast address (unicast address), multicast address (group address) and virtual address (virtual address)).

1. Configure a group (to assign addresses). You can also add the group address after it:

2. Find the device Provision

Click addnode to find two devices:

Click on lighting device 1, and a

Click IDENTIFY, and it will appear

Click PROVSION and the device will be connected to the network. The following prompts will appear after the device is connected to the network

3. Node configuration, click one of the following to enter node configuration

Elements enters the configuration address (switch devices set the publishing address, lighting devices set the subscription address), APP keys set appkey to be the same, and then the network can be established.

Add appkeys: Just select the first one.

Click the symbol on the right of Elements to enter the configuration address:

Select Generic On Off Server

Configure BIND KEY and subscription address SUBSCRIBE If it is SWITCH, set the publishing address SET PUBLICATION You can choose a group or other address.

After configuration, an ON OFF icon will appear in the group, which can be used to control the light on and off.

The other light can be configured in the same way. If the subscription address is in a group, then one switch can control the two lights to turn on and off at the same time. If it is placed in two groups, then they can be controlled separately.

During the experiment, you can also connect to the board through putty to see the prompt information.

This experiment ends here.

This post is from RF/Wirelessly

Latest reply

I roughly understand it. It seems that the definition of virtual address still makes sense!   Details Published on 2021-11-2 09:06
 

1412

Posts

3

Resources
2
 
Thanks for sharing, looking forward to the follow-up
This post is from RF/Wirelessly

Comments

Thanks.  Details Published on 2021-11-1 08:43
 
 

6062

Posts

4

Resources
3
 
annysky2012 posted on 2021-10-31 22:31 Thanks for sharing, looking forward to the follow-up

Thanks. Keep trying!

This post is from RF/Wirelessly
 
 
 

6742

Posts

2

Resources
4
 

The process is very detailed, and the light of a certain node device can be controlled separately.

This post is from RF/Wirelessly

Comments

Yes. The publish address and the subscribe address can be: unicast address, multicast address and virtual address. Not group  Details Published on 2021-11-1 16:47
 
 
 

6062

Posts

4

Resources
5
 
This post was last edited by damiaa on 2021-11-1 16:56
wangerxian published on 2021-11-1 16:35 The process is very detailed, and the light of a certain node device can also be controlled separately~

Yes. The publishing address and subscription address can be: unicast address, multicast address and virtual address. Select it when configuring nRF Mesh. Group is not the only option. Group is useful when one button controls multiple lights to turn on and off at the same time.

This post is from RF/Wirelessly

Comments

Under what circumstances are virtual addresses generally used?  Details Published on 2021-11-1 17:14
 
 
 

6742

Posts

2

Resources
6
 
damiaa posted on 2021-11-1 16:47 wangerxian posted on 2021-11-1 16:35 The process is very detailed, and the release can also control the lights of a certain node device separately~ Yes ...

Under what circumstances are virtual addresses generally used?

This post is from RF/Wirelessly

Comments

Virtual Address is similar to group address, but its address space is 2^16. Virtual Address is similar to multicast address in general usage. It can be created by using the button of nrf meshapp to create group. You can also configure the device address as virtual address, such as configuring switch  Details Published on 2021-11-1 19:46
 
 
 

6062

Posts

4

Resources
7
 
This post was last edited by damiaa on 2021-11-1 19:47
wangerxian published on 2021-11-1 17:14
In what situations are virtual addresses generally used?


  1. The function of a virtual address is similar to that of a group address, except that its address space is 2^16.
  2. The general usage of virtual addresses is similar to that of multicast addresses. You can create them through the button of nrf meshapp to create a group. You can also configure the publishing address and subscription address of the device as virtual addresses. For example, if you configure the switch publishing address and the light subscription address to the same virtual address, you can control the light through the switch. The test found that they are the same.

This post is from RF/Wirelessly

Comments

I roughly understand it. It seems that the definition of virtual address still makes sense!  Details Published on 2021-11-2 09:06
 
 
 

6742

Posts

2

Resources
8
 
damiaa posted on 2021-11-1 19:46 wangerxian posted on 2021-11-1 17:14 In what situations are virtual addresses generally used? &n ...

I roughly understand it. It seems that the definition of virtual address still makes sense!

This post is from RF/Wirelessly
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list