7 Replies Latest reply on Jun 10, 2020 12:41 AM by SudheeshK_26

    Broken link between two cyble-222014-01modules not always detected

    JiWa_1379161

      I am using two CYBLE-222014-01 modules, one as peripheral and other as central. Once the central finds the peripheral, it goes into sleep mode but maintains the link to the peripheral. The central device automatically wakes up at some interval and must check the connection to keep the two linked. The central device can also be woken up via interrupts from two switches. The problem I am having is randomly and under no pattern, the link between the two devices is broken. The peripheral sensed the break and begins advertising again, however, the central device still thinks the two are connected even though I check the state when every time it wakes up., no flags are set in the stack that it disconnected. Forces the central to be power cycled to work again and start scanning. Open to ideas as to what is wrong or if a better way to detect link is broken.

       

      I also can't find much information regarding setting the scan interval settings in the GAP Setting tab of module configuration. All Cyrpess datasheets focus on module as peripheral not central device. Any documentation on proper settings for scanning, not advertising. How to match to peripheral side?

        • 1. Re: Broken link between two cyble-222014-01modules not always detected
          SudheeshK_26

          Hello,

           

          For a better understanding about this issue, could you please share your central and peripheral projects in this forum thread?

          We can review it and let you know, if there are any issues.

           

          Thanks and Regards,

          Sudheesh

          • 2. Re: Broken link between two cyble-222014-01modules not always detected
            SudheeshK_26

            Hello,

             

            Could you please login to our website and try to attach the central and peripheral projects directly to this thread (instead of sending email)?

             

            Thanks and Regards,

            Sudheesh

            • 3. Re: Broken link between two cyble-222014-01modules not always detected
              JiWa_1379161

              Hi

               

              I have looked for the method to attach files and do not see them. If you point me in right direction I can upload them.

              • 4. Re: Broken link between two cyble-222014-01modules not always detected
                SudheeshK_26

                Hello,

                 

                You can use the advanced editor to attach your project directly on this tread. Click on the "Use advanced editor" link on top right corner of message box to open advanced editor.

                 

                Thanks and Regards,

                Sudheesh

                • 5. Re: Broken link between two cyble-222014-01modules not always detected
                  SudheeshK_26

                  Hello,

                   

                  I can see that CyDelay() function is called at multiple lines in your main for loop of both central and peripheral projects. CyDelay() is a blocking function and it may be preventing executing CyBle_ProcessEvents(); every connection/scan interval (whichever is smaller) in case of central or connection/advertisement interval (whichever is smaller) in case of peripheral device. It can lead to disconnection between peripheral and central. Please see a related forum thread at: PSOC 4 BLE disconnecting with CySmart App after 30 seconds with CyDelay . You can use Timer interrupts to generate delays.

                   

                  Thanks and Regards,

                  Sudheesh

                  • 6. Re: Broken link between two cyble-222014-01modules not always detected
                    JiWa_1379161

                    Hi

                     

                    I can understand how the delay function could mess things up. However the disconnect is not occurring when the board is running. After 10 seconds or so of no activity, the central board goes into low power mode. Only two things wake it up, the BLE doing some check in the background or the user pressing the buttons. So what is happening is the system (central and peripheral) devices are left alone for some period of time. Then the user goes to use the system and sees the peripheral flashing that it is no longer connected but the central device i snot flashing and believes it is still connected. The user then needs to power cycle the central device and it automatically reconnects to the peripheral. We have tested that when this condition occurs, the peripheral has started advertising again but the central will not connect because it thinks a connection exists.

                     

                    In previous versions of the product, we did not have any manual way to turn the central device off. When you pressed the buttons, it turned the central device on and it started scanning. If it found the peripheral, it would automatically connect. To turn the central device off, the user would power down the peripheral and then the central would see the connection break, then shut down.

                     

                    So something is happening where the central missed a connection break. If you look at central code, I added to check the state when coming out of sleep just in case something was missed. This step does not help the issue as I am getting the same problem. Keep in mind this is a random problem but it is affecting the consumers who are buying the overall product.

                     

                    I am also looking for more explanation on the central role of these modules. Most of the data sheets reference the various settings in the PSOC BLE tabs when the module is a peripheral. There are various scan intervals and timeouts. No explanation as to what these really mean or how they work.

                    • 7. Re: Broken link between two cyble-222014-01modules not always detected
                      SudheeshK_26

                      Hello,

                       

                      You can refer datasheet of BLE component in PSoC Creator to know about all of the configuration settings. Double click on BLE component to open configuration window and open datasheet by clicking "Datasheet" button on bottom left corner of the configuration window.

                       

                      Thanks and Regards,

                      Sudheesh