3 Replies Latest reply on Jun 1, 2020 12:39 AM by DheerajP_41

    How to ensure sensor_server is subscribed to sensor_client?

    HaOv_4353196

      Hello,

       

      I am using the CYBT-213043 with ModusToolbox 2.1.  I am currently testing two boards, one is the sensor_server which will be attached to an RFID sensor, the other is the sensor_client who will be attached to an LED screen. I would like to send a STATUS message from the server to the client which will contain the RFID sensor data to be displayed on the client's LED screen.  As provisioner I am using the Cypress MeshApp on iOS.  I am able to establish a Network (test) and a group (G1) within this network. I can also subscribe both the aforementioned nodes to the same group (G1).  Using the app I can send a GET SENSOR DATA message to the sensor server node but it does not send back the correct data to the app.  I have hardcoded the data to be 1 but the app message reads: "Presence Detected: 0". I am using the WICED_BT_MESH_PROPERTY_PRESENCE_DETECTED as my property for both the server and the client nodes.  I cannot find the reason why I cannot simply hardcode a value to send to the network.  Any ideas you have would be much appreciated.  Thanks.

        • 1. Re: How to ensure sensor_server is subscribed to sensor_client?
          DheerajP_41

          Hi,

           

          I doubt, the data is getting updated wrongly in the application.

          You can go through the mesh demo sensor_motion application, compare and check if you are missing inn your application. It uses WICED_BT_MESH_PROPERTY_PRESENCE_DETECTED.

           

          Could you please share your modified code as well so that I can also go through it to identify the issue?

           

          Thanks,

          -Dheeraj

          • 2. Re: How to ensure sensor_server is subscribed to sensor_client?
            HaOv_4353196

            Hi Dheeraj,

             

            From our understanding I believe the Cypress provisioner MeshApp assigns the AppKey and unicast/ group address to the sensor server and sensor client. How ever it does not seem like the client is communicating with the server to receive the status. Is my understanding correct that the provisioner app creates and handles the AppKey and addresses that the two models are subscribed to, or do I need to assign those in the code?

             

            Thanks,

            Harrison

            • 3. Re: How to ensure sensor_server is subscribed to sensor_client?
              DheerajP_41

              Hi,

               

              The Provisioner is responsible for generating and distributing AppKeys, netkeys, etc.

               

              "How ever it does not seem like the client is communicating with the server to receive the status"

              When sensor server is provisioned, it is configured to publish data to a group, if current group was configured. Or it is configured to publish data to "all-nodes", if there were no group. The sensor publication configuration can be modified using the provisioner application (android/ios app, meshclienit, clientcontrol).

              If sensor_client app is also provisioned to the same group then it should also receive the status message. Otherwise, after provisioning and configuring the two devices (sensor, client and server), please configure the sensor server to publish the data to "all the nodes", and check whether you are getting the status message.

               

              WICED_BT_MESH_SENSOR_GET event calls wiced_bt_mesh_model_sensor_server_data() which will create a mesh reply event from the received mesh event (wiced_bt_mesh_create_reply_event). This function doesn't create but just updates received mesh event to be used to send message back to the originator.

               

              Thanks,

              -Dheeraj

              1 of 1 people found this helpful