Understanding CYBT-213043-MESH Dimmer & Dimmeable Light Sample

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

cross mob
LUAB_4724786
Level 4
Level 4
25 replies posted 10 likes received 10 replies posted

Hello,

Finally I've been able to play with CYBT-213043-MESH kit and start playing with the sample provided in the SDK and the documents (Dimmer and Dimmeable Light Sample). It is a good sample and guideline provided as my first time experience with BLE Mesh.

During my learning curve I did some modification steps (multi network, multi groups and cross groups) as my practice to understand better about BLE Mesh device, provisioning and sample application provided (IOS). It seems I need help to understand better on how it works, please kindly help me to enlighten the process, thanks.

1. In the picture, is dimmer works as a proxy node between IOS App and the rest of the nodes ? Or perhaps ... I wrongly interpreting the document in here and the picture is not intended for Dimmer and Dimmable Light sample.

Screen Shot 2020-07-14 at 14.40.25.png

2. Is it correct to assume that the IOS app actually broadcasting (or advertising?) a message in the network created previously to control each node functionality (on/off and lightness) ?

3. Is it correct to assume that after the dimmer being provisioned and ADDED to the group only broadcasting message within its network and group ?

4. If it is NOT added to the group, is the Dimmer only broadcasting to the network only ?

Question 3 and 4 actually popup while I am creating 2 groups within a network. Freshly after creating the groups I am adding one by one Dimmer and Dimmeable light, it is working as expected, each button in the dimmer can work as expected, only controlling Light in its group.

Then I remove the dimmer on some group and test it, it is turning on all the light in the network and then I add it again (via Group "All" Menu) to its previous group, somehow when I pressed the button it is still turning on all light in the network and not in its group only, so .. its confuse me.

4. Is it correct to assume that after the devices provisioned, it will not be able to be added again into another network ? (Unless it is being preset). What actually happen in here at the devices before and after it is provisioned ?

5. At high level application (like IOS or Android), in order to keep the network setting created and making it easier to control devices, the application developer must implementing mobile application that support "importing" created network (and groups too) either with login credential, cloud or the others, is it like that ?

6. Delete Network menu on IOS App, is it only deleting the network in the mobile application level ? and making all the devices in the network become unprovisioned ? Or we need to manually preset the devices to make it unprovisioned ?

That is all for now, thank you for your patience for answering my questions above, still new in BLE Mesh world.

Best Regards,

LUTHFI AD

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

Hi,

Thank you for the compliments.

1. Figure.19 can be considered as a general BLE Mesh Networking setup, with necessary hardware and software. It includes a Provisioner (android/IOS/Windows app), a GATT proxy node (To connect legacy Bluetooth device to mesh network) and other mesh nodes (relay, frined, etc.). It is not specific to dimmer and light_dimmable.

Check .feature in wiced_bt_mesh_core_config_t  mesh_config to know what all features are enabled for an app.

Eg: Dimmer application does not have proxy feature enabled. Check (.features = 0, )

But light_dimmable app has following features enabled,

.features           = WICED_BT_MESH_CORE_FEATURE_BIT_FRIEND | WICED_BT_MESH_CORE_FEATURE_BIT_RELAY | WICED_BT_MESH_CORE_FEATURE_BIT_GATT_PROXY_SERVER,

2. No. The IOS/Android/Windows provisioner helper applications will establish a GATT connection to the proxy node and through this node it communicates to the rest of the network. smartphone supporta BLE, but not BLE Mesh.

3) 4) Yes. A node will be sending messages with 3 keys. NetKeys, Appkey, and Devkey. If dimmer is part of a particular network, it encrypts all it's messages with the associated Netkey.  Each node possesses one or more NetKeys based on the network and subnets they are part of. The NetKey separates each network and subnet from all others. If the device is not part of any subnet then it should broadcast messages to all the nodes in the network.

Which provisioner app are you using ? Android/IOS/MeshClient?

After provisioning the dimmer app, I believe by default it is configured to broadcast messages only to it's group. The use will be able to reconfigure it also. (for example, if the dimmer should control only a particular bulb, then it can be configured by selecting the dimmer node in the UI).

I believe in the MeshClient Windows app, the nodes are getting added without any group. So here by default, dimmer will be able to control all the light_dimmable apps provisioned in the network. Here also user can reconfigure the node.

4) Yes. Cannot be provisioned again. Once a node is provisioned it stops sending unprovisioned beacons.

But the provisioner can still add the provisioned node to other networks. (For. Example: duplicate the device, Mode the device, etc.)

5) Yes. The database sharing between the provisioners is not defined in the ble mesh spec. Developers can use cloud base system, or any custom methods. You can import or export the provisioner database from our provisioners in .JSON format.

6) I need to check. I will get back to you.

The best practice is to unprovision each node and then delete the network. Because delete network might be deleting the entries from it's database only.

The WBT101 lab manual will also be helpful to understand the stack and programming better. Please have a look.

https://github.com/cypresssemiconductorco/CypressAcademy_WBT101_Files

All the very best.  

Thanks,

-Dheeraj

View solution in original post

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

Hi,

Thank you for the compliments.

1. Figure.19 can be considered as a general BLE Mesh Networking setup, with necessary hardware and software. It includes a Provisioner (android/IOS/Windows app), a GATT proxy node (To connect legacy Bluetooth device to mesh network) and other mesh nodes (relay, frined, etc.). It is not specific to dimmer and light_dimmable.

Check .feature in wiced_bt_mesh_core_config_t  mesh_config to know what all features are enabled for an app.

Eg: Dimmer application does not have proxy feature enabled. Check (.features = 0, )

But light_dimmable app has following features enabled,

.features           = WICED_BT_MESH_CORE_FEATURE_BIT_FRIEND | WICED_BT_MESH_CORE_FEATURE_BIT_RELAY | WICED_BT_MESH_CORE_FEATURE_BIT_GATT_PROXY_SERVER,

2. No. The IOS/Android/Windows provisioner helper applications will establish a GATT connection to the proxy node and through this node it communicates to the rest of the network. smartphone supporta BLE, but not BLE Mesh.

3) 4) Yes. A node will be sending messages with 3 keys. NetKeys, Appkey, and Devkey. If dimmer is part of a particular network, it encrypts all it's messages with the associated Netkey.  Each node possesses one or more NetKeys based on the network and subnets they are part of. The NetKey separates each network and subnet from all others. If the device is not part of any subnet then it should broadcast messages to all the nodes in the network.

Which provisioner app are you using ? Android/IOS/MeshClient?

After provisioning the dimmer app, I believe by default it is configured to broadcast messages only to it's group. The use will be able to reconfigure it also. (for example, if the dimmer should control only a particular bulb, then it can be configured by selecting the dimmer node in the UI).

I believe in the MeshClient Windows app, the nodes are getting added without any group. So here by default, dimmer will be able to control all the light_dimmable apps provisioned in the network. Here also user can reconfigure the node.

4) Yes. Cannot be provisioned again. Once a node is provisioned it stops sending unprovisioned beacons.

But the provisioner can still add the provisioned node to other networks. (For. Example: duplicate the device, Mode the device, etc.)

5) Yes. The database sharing between the provisioners is not defined in the ble mesh spec. Developers can use cloud base system, or any custom methods. You can import or export the provisioner database from our provisioners in .JSON format.

6) I need to check. I will get back to you.

The best practice is to unprovision each node and then delete the network. Because delete network might be deleting the entries from it's database only.

The WBT101 lab manual will also be helpful to understand the stack and programming better. Please have a look.

https://github.com/cypresssemiconductorco/CypressAcademy_WBT101_Files

All the very best.  

Thanks,

-Dheeraj

Dear Dheeraj,

Thanks a lot for the explanation, it really helps ! now I can correct my understanding of it.

For question No. 1 and 2 it is clear now and I learn that smartphone supports BLE, but not BLE Mesh and in order to communicate with it (through provisioner app definitely) it is required a device configured as GATT proxy node.

About the sample of Dimmer and Dimmeable Light, you are right ... the Dimmeable Light have GATT feature and Dimmer do not have it based on the source code (under .features), I think I got confuse since both of them include #include "wiced_bt_gatt.h" in the source code, so I wrongly conclude that Dimmer have GATT as well, I think that include is needed for other operation in the sample.

So ... in the case of Dimmer and Dimmeable Light, only Dimmeable Light have GATT and it means the Mobile App will be able to control the node(s) in the network when it is on the range of Dimmeable Light node ... right ?

I am picturing that Dimmeable Light as light bulb and dimmer as a switch ... in here the design, I will be able to control those bulbs in my mobile phone when I am in the range of that bulb but not dimmer (because no GATT), I hope I am thinking it correctly.

Now about the IOS App, I will try to explain further, because I still cannot understand why it is behave like that, below are the steps :

1. I created a network (MESH-NETWORK) and 2 groups (GROUP 1 and GROUP 2).

2. Open each group and add a device(s), the screenshot below.

IMG_2845-side.PNG

at this point everything is working as expected, all the Dimmer button will turn on Dimmeable Light into their own corresponding group.

3. And then I start removing Dimmer (0004) from Group 2 and it is shown succesfully removed.

IMG_2851-side.PNG

at this point, based on my understanding, this dimmer do not have a group but it is under one network, so ... if I press the button it should light ALL Dimmeable Light within the network and it is !

4. Then I stumble into this step, I add again that Dimmer (0004), just browse it through "ALL" devices menu and add them back to Group 2.

IMG_2854-side.PNG

at this point, Dimmer (0004) should light corresponding Dimmeable Light in the Group 2 only, but what happen is ... it is ALWAYS light on all the light in the network (just like on previous state on step 3). Could you help me point what when wrong in here ?

About questions No. 6, I am testing with "delete device" menu in IOS app, it seems that the menu make the device into unprovision state. So .. if I delete the devices and delete network, should be safe steps right ? anyway ... I will wait the correct steps from you.

Once again, thanks a lot Dheeraj, I really learn a lots and it seems I need to start my digging into those SIG documents (profiles and models), Grrrrrr ... its a along pages in there I think I should make a tables related with each profiles in there for quick-docs.

Best Regards,

LUTHFI AD

0 Likes

Hi,

Q) "So ... in the case of Dimmer and Dimmeable Light, only Dimmeable Light have GATT and it means the Mobile App will be able to control the node(s) in the network when it is on the range of Dimmeable Light node ... right ?"

yes, you are right.

Q) "at this point, Dimmer (0004) should light corresponding Dimmeable Light in the Group 2 only, but what happen is ... it is ALWAYS light on all the light in the network (just like on previous state on step 3). Could you help me point what when wrong in here ?"

"Add to Other group" is basically duplicating the node and adding it into other group.

If you have used this options, I believe in step-4, you might be having Dimmer node in both "ALL" group and "Group 2". So all the nodes can be controlled. You can use "Move to Other Group" option to move the node from "ALL" group to group_2 without duplicating it.

Q) "if I delete the devices and delete network, should be safe steps right ?"

Yes, delete provisioned devices (which will put the device into unprovisioned state) before you delete the network.

Is delete network puts any node in unprovisioned state in your testing?

Thanks,

-Dheeraj

0 Likes

Hi Dheeraj,

Thanks a lot for the answer, really help me !

About .... "Add to Other group" is basically duplicating the node and adding it into other group.

If you have used this options, I believe in step-4, you might be having Dimmer node in both "ALL" group and "Group 2". So all the nodes can be controlled. You can use "Move to Other Group" option to move the node from "ALL" group to group_2 without duplicating it.

Now I understand about "Add" and "Move" but it triggers me another questions, see below

  1. During provisioning, as you can see I am adding devices to the group and ... I can see in respective "Group" but I also can see all devices on group "All" too. But ... why the dimmer behave like in group at this time even though I access it from "All" ? I means ... correctly triggering specific light base on group its assigned while it is being accessed from group "All"
  2. Maybe ... (this is just my suggestion) in the future under group "All", I can see some additional information about the devices list AND its group belong too. So ... If I remove a device from group, I can see it too that "additional" info about its group is gone, just a suggestion to avoid confusion.
  3. Now I also understand about "Add this node .." and "Move this Node ...", but it seem the application didnt allow me to have this "Move this node ..." if I access it under group "All".

About ... "Yes, delete provisioned devices (which will put the device into unprovisioned state) before you delete the network.

Is delete network puts any node in unprovisioned state in your testing?"

Last time I did test this after I've found out that "delete device" can make device in unprovisioned state, below is my finding :

  • Let say we have 4 devices in the network, I remove one by one (by using delete device) until only left 1 device in the network, but somehow no matter I tried, I cannot remove the last one, there is popup menu shown telling me that the "network mesh still busy message", last time I am doing it twice and still the same, perhaps you can suggest me the correct steps to delete several devices as well, since it is related with user behavior when using mobile app later.
  • I did test as well, delete network immediately after the app open, but the device still in under previous provisioned state last time, anyway I will test it again since there is new update on App Store for the apps, who knows got different behaviour.

Best Regards,

LUTHFI AD

0 Likes

Hi,

Cypress helper applications (Androrid/IOS/Windows) of BLE mesh are basically demo applications, that used to showcase the capabilities of mesh stack and application models. The source code of these apps are available for the customer with the SDK, so that anyone can do modifications or enhancements as per their application/product requirement.

please check wiced_btsdk\tools\btsdk-peer-apps-mesh.

In some user scenario, if the user misses to delete (unprovision) the device, the "ALL" group supplies some method for the user to recover the nodes easily.

I need to get little more clarity regarding the "Move to other group" and "Add to other group" operations in the "ALL" group. I will check whether it is showing any unexpected behavior in the "ALL" group or not. But these options should work as expected in all other groups created by the user. Are you facing any issues in these options in other groups?

Nodes are getting deleted/removed from the mesh network in a secure way. There is a set of procedure for it. So, it may take few seconds to remove a node from the network completely. I would suggest you to delete a node only after the previous deletion process is completed, and notified in the app. To delete a node, ideally some 5-10 seconds should be enough.

Thanks,

-Dheeraj

Dear Dheeraj,

Yes I agree with you, that is why I need to have this kind of discussions, since we might need to supply the application by ourself in the future, we need to know and understand the behavior of the App it-self. Based on this, our division will have a clear guideline on how to "guide" the user or how to "avoid" unnecessary features and perhaps adding standard on "adding or removing" devices, group or network.

By the way, I have update on application at IOS into 1.0.16

IMG_2943.PNG

I've found that its a bit different from previous sample app, previously I can add other dimmer to another group. Below is the details to give you some information on how it happen, basically I created 2 groups, each of them contain Dimmeable and Dimmer.

IMG_1.PNG

And I try to add Dimmer 2 into Group 1 too ... I accessed it from Group All to do the "adding process"

IMG_2.PNG

But somehow right it is always stuck at that "circle progress bar" I repeat the steps several times but still the same.

Best Regards,

LUTHFI AD

0 Likes

Hi,

It seems like, there is a bug in the "add to group" option in the latest IOS app. We will fix it in the next release (ASAP).

Thank you for sharing the feedback with us.

Thanks,

-Dheeraj

0 Likes

Dear Dheeraj,

Thanks, I will test it again after it is updated.

Best Regards,

LUTHFI AD

0 Likes