14 Replies Latest reply on Sep 1, 2020 12:50 AM by DheerajK_81

    Bluetooth Search Devices Not Responding

    PaHe_4724661

      I have been watching the BLE PSOC Android App videos from Cypress and have noticed that whenever I use either my android device or the emulator, the app builds, however, once I hit Start and then Search For Devices, nothing happens and I am not able to connect to my bluetooth device.

       

      Per the videos instructions (Or maybe I missed something), I basically just copy and pasted the code from the BLEApp-Master downloadable zip file under app and BLE101. I copied over both the Main Activity and the PSOCCapSenseLEDService Java files.

       

      Once I added the the correct Strings to values, I was able to build and run the app but I am still hitting the same search bluetooth roadblock.

       

      Any sort of guidance would be much appreciated with this one. Thanks!

       

        • 1. Re: Bluetooth Search Devices Not Responding
          DheerajK_81

          Please add the following line in the manifests/AndroidManifest.xml file:

          <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

           

          When you run the app, you should be prompted to provide the required permissions. Please enable permission to access your location. If you don't see this prompt, please go to the App Settings and then enable the permission manually. In case it was already enabled and it wasn't working, please deny all permissions and then enable them again.

           

          When you run the app now you should be able to see all BLE devices around you. Note that you won't be able to see devices that do not support BLE and only support classic Bluetooth.

           

          Let me know your observations.

           

          Regards,

          Dheeraj

          1 of 1 people found this helpful
          • 2. Re: Bluetooth Search Devices Not Responding
            PaHe_4724661

            Hi there,

             

            So I'm still running into the same issue and should be noted that the app doesn't have a settings directory yet since it only has the one page for activity_main.xml under layouts (At least that's what I can figure).

             

            I already had the line: <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

             

            invoked so I figured this should have already worked but I'm not certain of the difference.

             

            Anyway, it looks like it is still working the same as before where it just seems to get "Stuck" on that search devices button.

            • 3. Re: Bluetooth Search Devices Not Responding
              DheerajK_81

              When I mentioned App Settings, I meant the phone app settings. Go to the Phone Settings > Apps and Notifications  > find BLE101 app > Permissions > Enable all of them.

               

              Based on the Android OS version running on your phone, the above steps might differ, you just need to open the BLE101 App info in the phone settings.

               

              Regarding the permissions, please add both COARSE and FINE location permissions. It is necessary for it to work. When I used only coarse location with my phone, it didn't work.

               

              Regards,
              Dheeraj

              • 4. Re: Bluetooth Search Devices Not Responding
                PaHe_4724661

                Hmm, even with both the lines you provided and correcting the app settings, the app just seems to stall on the search for devices. It doesn't even seem to be looking for nearby devices at all.

                 

                I'm wondering if I may be missing functionality because I'm missing the appropriate provided material from the BLEMaster app zip file. This is the correct material, right?

                • 5. Re: Bluetooth Search Devices Not Responding
                  DheerajK_81

                  Which device are you using and whats the version of Android running on it? The material can be downloaded from here: GitHub - cypresssemiconductorco/bleapp

                   

                  Regards,
                  Dheeraj

                  • 6. Re: Bluetooth Search Devices Not Responding
                    PaHe_4724661

                    Thank you for this.

                     

                    When I run everything I get the error:

                     

                    > Task :app:compileDebugJavaWithJavac

                    Note: /Users/parkerh/Downloads/bleapp-master/BLEApp/app/src/main/java/com/example/bleapp/PSoCCapSenseLedService.java uses or overrides a deprecated API.

                    Note: Recompile with -Xlint:deprecation for details.

                     

                    Any trouble shooting passed this?

                    • 7. Re: Bluetooth Search Devices Not Responding
                      PaHe_4724661

                      I am also running this on Android Studio 4.0 and I am running it on an android 10 version from my pixel

                      • 8. Re: Bluetooth Search Devices Not Responding
                        DheerajK_81

                        Please find attached the working project on Android Studio 4.0. Kindly open this project in Android Studio. It will take sometime to successfully complete the Gradle Build. You may see some warnings like "Unsupported modules detected" etc that you can safely ignore.

                         

                        Apart from adding the fine location permission, you will notice one other change in the project. Latest Android Studio versions require you to use migrate to the latest AndroidX package, so I have added the following lines in BLE101/gradle.properties file.

                        android.useAndroidX=true

                        android.enableJetifier=true

                         

                        Run the app on your phone and see if it works now. When prompted make sure appropriate permissions are provided.

                         

                        Looking forward to your reply

                         

                        Regards,
                        Dheeraj

                        • 9. Re: Bluetooth Search Devices Not Responding
                          PaHe_4724661

                          Hmm, Still doesn't look to be working on my end. Same issues as before I'm wondering if it just doesn't see the board for whatever reason?

                           

                          The board works fine with the CySmart App and connects fine. Any input would be helpful.

                          • 10. Re: Bluetooth Search Devices Not Responding
                            DheerajK_81

                            The BLE101 application looks for the specific service based on the UUID and then connects to it. CySmart displays all the devices and allows you to connect to it. So, the flow is rather different.

                             

                            Can you please check the UUIDs defined in the PSoCCapSenseLedService.java file and the ones in the BLE configurator to make sure both are the same?

                             

                            Please attach your PSoC Creator project so that we can get more insight on your issue.

                             

                            Regards,
                            Dheeraj

                            • 11. Re: Bluetooth Search Devices Not Responding
                              PaHe_4724661

                              How do I go ahead and attach a file to a thread such as this?

                               

                              Also, when you say BLE configurator, which file are you referring to exactly?

                               

                              Thank you again for all your help on this one!

                              • 12. Re: Bluetooth Search Devices Not Responding
                                DheerajK_81

                                To attach your project, right click on the project > Archive Workspace/ Project > Minimal. Attach the zip archive thus created by clicking on Use Advanced Editor at the top right of your reply and then clicking attach option that will be available on the bottom right.

                                 

                                 

                                Not sure if the view is the same for you, but it should be similar to this.

                                 

                                The BLE Configurator is the window that opens when you double click the BLE Component in the PSoC Creator project.

                                 

                                Regards,
                                Dheeraj

                                • 13. Re: Bluetooth Search Devices Not Responding
                                  PaHe_4724661

                                  Strange, it doesn't look like I have that feature

                                  • 14. Re: Bluetooth Search Devices Not Responding
                                    DheerajK_81

                                    When you click Reply, at the top right, you should see the label "Use advanced editor".

                                    pciture.jpg

                                     

                                    You should then see Attach icon at the bottom right.

                                    picture2.jpg

                                     

                                    Let me know if you are able to attach your project using these steps

                                     

                                    Regards,

                                    Dheeraj