1 2 3 Previous Next 32 Replies Latest reply on Jul 3, 2019 2:12 PM by DheerajP_41

    BLE Mesh 2 way communication

    RoBe_1502026

      Hi all,

      I am using for development the following: cybt-213043-mesh/cyw920819e

      in final production plan on using the cybt-213043 modules. using the cyw920819 because the 213043 does not expose the i2c bus for development.

      here is what I am trying to accomplish.

      1. send a Number to the module(remote relay box from now on) that will then trigger an alarm via a pca9555 (I have this board developed as I have been using it for 10 year but working on an upgrade of the system to BLE- Mesh) I have been able to trigger using a fixed value on a button push, but would like to send the number of the relay to trigger over the ble mesh net.

      2. receiving battery voltage from remote relay box.

      3. receiving temperature(s) from remote relay box.

       

      So I need to send one value and receive 2-3 values FROM the remote relay box.

      I am not sure how to do this? it seems like a module is either a server or a client, can it be both? How.

      Also not sure how to transfer this data, which profile or do I make a custom profile.

      If a custom profile is needed are there any good guides/videos on how to make one.

      I hope I have given enough into.

      Thanks for all the help,

      Rob Berry

        • 1. Re: BLE Mesh 2 way communication
          DheerajP_41

          Hi Robert Berry,

           

          An end application can use Server Models or Client Models, or both along with the control logic. Any combination of Server and Client Models results in a Control Model. Here, I believe, your module should act as a control model, so that it can communicate with the configuration device on one side and it can control the Alarm on the other side.

           

          As per Spec:

          Control model: A control model may contain client model functionality to communicate with other server models and server model functionality to communicate with other client models. A control model may also contain control logic, which is a set of rules and behaviors that coordinate the interactions between other models that the control model connects to.

           

          And, Mesh spec allows the developer to create vendor specific models that are not defined in the Mesh model Specification. Also we have a snip app called mesh_vendor_server which will demonstrate this feature. Helper Applications (MeshClient - Windows) will help you to Set vendor data for vendor models.

           

           

          We have an excellent AppNote of Mesh where you can get the information of basic architecture overview, code example usage, etc. of Mesh.

          Getting Started with Bluetooth Mesh

           

          MeshClient guide you can find here: MeshClient and ClientControlMesh App User Guide

           

          Thanks,

          -Dheeraj

          • 2. Re: BLE Mesh 2 way communication
            RoBe_1502026

            Dheeraj,

            Thanks for the reply. I am reading that doc again with a bit more knowledge then I did the first time.

             

            Best Regards,

            Rob Berry

            • 4. Re: BLE Mesh 2 way communication
              DheerajP_41

              Hi VictorZ_46 , Could you please give your suggestion and view also for designing this project?

              • 5. Re: BLE Mesh 2 way communication
                RoBe_1502026

                I updated my question as I was using the files from the cyw920819 on the cybe-213043 by accident.

                I am using the GitHub versions and importing them into my environment.

                I have not tried yet but can the .data property pass a structure or only int or arrays?

                 

                thanks,

                Rob

                • 6. Re: BLE Mesh 2 way communication
                  VictorZ_46

                  If the communication is between your 2 devices, you indeed can use Vendor Specific model and build your protocol on top of that.  There should be a mesh vendor specific data app for that.  If you need to be standard (for example, your temperature measurements need to trigger fan to be turned on), you should try to stick with standard models.  You can have temperature sensor, battery server and whatever else you need on the same device.

                   

                  Please note that it either case, you will need to use some Provisioner to set up your network.  For example, your provisioner will need to set up your client device to publish data (for example, vendor specific data, or sensor data) to a specific device or to a group of devices.

                  1 of 1 people found this helpful
                  • 7. Re: BLE Mesh 2 way communication
                    RoBe_1502026

                    Hi,

                    I am not sure if I understand your question. Ill recap my project.

                    I have a main controller, this controller communicates with a 'black box' that has a psoc6 with relays and inputs (digital,A/D,etc)

                    I need to have the main controller communicate with the black box to obtain values like, battery voltage, temperatures (3 of them from remote probes) and faults from the inputs. ALSO I need the main controller to send a value to the 'black box' to trigger a relay on and off as needed.

                    There is a reason the controller is separate from the 'black box' as the main controller uses a 4G/LTE modem and the location of the equipment may not be in the range of cellular data. so the ble mesh is the best option to mounting the controller where it has cell service and still be able to talk to the 'black box'

                    Hope this is clearer, I do have some other modules but I think learning how to do this will help me design them....

                    Best Regards,

                    Rob

                    • 8. Re: BLE Mesh 2 way communication
                      VictorZ_46

                      Sounds that you need vendor specific model. Please use the sample in the SDK.

                      • 9. Re: BLE Mesh 2 way communication
                        RoBe_1502026

                        Victor,

                        I have the mesh_vendor_server on my device but not sure how to use it.

                        the help files doesnt 'help' Can you explain more how to use it?

                        Thanks,

                        Rob

                        • 10. Re: BLE Mesh 2 way communication
                          DheerajP_41

                          HI Robert Berry,

                           

                          You can use mesh_provision_client and mesh_vendor_server (or mesh_vendor_specific_app) apps from the code examples.

                          Here mesh_provision_client will act as a client device that can send vendor specific messages to a server and also can receive the status messages. And mesh_vendor_server app can act as a server device that can process the received messages and do some operations if needed.

                           

                          Please follow below instructions to use vendor specific app.

                          1. Download mesh_provision_client and mesh_vendor_server apps into two separate boards.
                          2. Open MeshClientControl (LightControl tab) and open COMport of mesh_provision_client device.
                          3. Create a network, Open it and then Scan and Provision the mesh_vendor_server app. (Please use Helper application guide: https://www.cypress.com/file/462491/download if you have doubt in the usage of helper applicaion)
                          4. Select the required provisioned device and use Vendor Data field to send required data to the server.
                          5. You will be able to see sent messages and received the status message on the ClientControl log itself (Bottom).

                           

                          NOTE: Instead of using mesh_provision_client and MeshClientControl, you can use MeshClient helper application (windows) to provision and communicate with a vendor specific server app.

                           

                          BLE MESH application development guides:

                          Getting Started with Bluetooth Mesh

                          Please watch How To Design With Bluetooth Mesh (Hands-On) if you prefer video lecture.

                           

                          Helper application guide: MeshClient and ClientControlMesh App User Guide

                          Other supported documents: https://www.cypress.com/products/ble-mesh

                          Please refer to BT SIG Mesh Specification also - https://www.bluetooth.com/specifications/mesh-specifications

                           

                          Thanks.

                          -Dheeraj

                          1 of 1 people found this helpful
                          • 11. Re: BLE Mesh 2 way communication
                            RoBe_1502026

                            Dheeraj,

                            I am going to try these now. I think I am just having a problem with wrapping my head around something. If I have a separate controller and want to send a packet of data through the ble mesh, I would normally do it through a serial link. How do I setup a ble mesh app to listen to a serial link and relay whatever is send through the link out to the mesh? And is there a way to direct data to a specific target board? for example me my application if I have my 'black box' and then another 'black box #2'. Is there a way to direct the traffic or better address the traffic to 'black box #2' ? 

                            I think part of my problem is understanding where I put my data to be sent out and how that data gets processed once received by a another module.

                            Sorry if these are very green questions.  I do appreciate your help and I have watched the video with Alan. Very good and he is a great teacher, It gave me a great start but now I need to make some customizing and the video doesn't cover that...

                            Best Regards,

                            Rob Berry

                            • 12. Re: BLE Mesh 2 way communication
                              VictorZ_46

                              I will pass the message to Alan that you enjoyed his video.  Going back to real work...  BLE mesh uses concepts of subscriptions and publications.  A client model needs to be configured to publish data to an address and to protect data using a specific application key.  The address can be a unicast address, or a group address or a virtual address.  The receiving side by default is subscribed to receive messages with a unicast address of one of its element.  If the client model is configured to publish messages to a group, the destination needs to be configured to subscribe the server model to the same group.  A client and a server need to have the same application key.  In addition to that the models shall be bound to this key.

                               

                              You can think of a switch and a bulb.  Switch by default does not know where his onoff command need to be send.  So provisioner need to configure publication on the switch.  The publication shall contain information of the destination address, and the key to encrypt the data, i.e. an app key shall be added and on/off client model shall be bound to the key.  If the switch controls group of bulbs, on the bulb side, you need to subscribe the on/off server model to the group address.  The same application key shall be added.  The on/off server model shall be bound to the application key.

                               

                              If you use Cypress provisioner (Windows, or Android, or iOS), most of the work should be done for you when you are doing provisioning/configuration.  For example, provisioner creates and maintains application keys.  if you have Vendor Specific models, and if you configure device in a group, the model will be subscribed.  I suggest you study configure_queue_remote_device_operations in the wiced_mesh_client.c message to see what is being done.  Note that Cypress provisioner will only configure Vendor Specific models if Vendor is Cypress.

                              1 of 1 people found this helpful
                              • 13. Re: BLE Mesh 2 way communication
                                RoBe_1502026

                                Victor,

                                Thanks, I have emailed Alan a couple of times, I hate doing it as I know he's a busy man.
                                Ok ,so I have all my boards connected in the same network. I now want to send the number 0x80 to one of the boards, lets say the name of that box is 'relayBox' and there is only on in the network.  also the number 0x80 is coming from another processor via uart port. how do i make it listen to the serial port and then transmit the number?  once its transmitted how does the 'relayBox' receive the number to be processed on the module?

                                I am sorry if I am asking 'stupid' questions, I really want to understand this fully. Are there any classes or training courses where I can ask question and learn? I am understanding more every day but get stumped. I am so used to the ole'     int main(){} thinking I get somewhat confused when we move to event driven. I dont fully understand where the events get generated and how to define custom events (if that what they are called. I am using that term as the best way to describe it.)

                                also is the mesh_app_init(is_provisioned) called continuously? i am reading the setting started doc so if its in there, I apologies.

                                As I look more, it seems like all the 'work' get setup in the mesh_app_init(). Is this correct?

                                also where is the wiced_mesh_client.c file so I can see the configure_queue_remote_device_operations section. I cant find it in the sample code I have.

                                Best Regards and Thanks!

                                 

                                Rob

                                • 14. Re: BLE Mesh 2 way communication
                                  VictorZ_46

                                  There is plenty of information on BLE Mesh around the web.  Google is your helper.  Cypress community forum (or emails to Alan) is definitely not the place to learn how the mesh works.

                                   

                                  You cannot send the message to a device, unless you are a provisioner and you know all devices all keys and everything.  If you are configured for publications, you can publish the message.  If you have a vendor specific model and a provisioner configured this model with appropriate application key and appropriate address to send a message you can publish the message.  Please look at the vendor specific models sample.  Hope it will give you some clue what to do.

                                   

                                  Please look at the documentation for mesh_app_init. The function is not called periodically.

                                  1 2 3 Previous Next