1 2 Previous Next 21 Replies Latest reply on Aug 4, 2020 10:09 AM by AnjanaM_61

    How to connect with a PIN on the CYW4343W?

    RoWo_4704901

      Folks,

       

      How do you connect to a CYW4343W using a PIN please? There is vague mentions of PINs in both the source code and the sketchy documentation, but I can't fathom how you set the device up so that when the phone attempts to connect to the CYW4343W, the phone has to enter a PIN for the connection to succeed.

       

      I have set up our device in the hello_sensor style and I can connect, read and write data etc, but now I need to set it up so the phone enters the PIN to communicate.

       

      The PIN will be the same in every device (at least to start with) and we have no user interface whatsoever, hence the need for each device to have the same PIN.

       

      I can't even see any example code to wade through.

       

      I could do with some explicit instructions as to how this works. I'm assuming you have to set up somerthing when advertising.

       

      Many thanks.

        • 1. Re: How to connect with a PIN on the CYW4343W?
          AnjanaM_61

          Hi RoWo_4704901 ,

           

          From your description, I believe you are using BLE and you want to use 6 digit Passkey for security.

           

          In order to use the passkey method, you need to set the IO capabilities accordingly. In your case , your mobile phone have to enter the passkey. Which means 4343W should be having IO capability Display and for mobile keyboard.

          So when you set the IO capability BTM_IO_CAPABILITIES_DISPLAY_ONLY in BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT , the stack will generate 6 digit passkey and display on the 4343W device. Then you have to enter this passkey on your mobile phone during connection process.

          As per spec, the 6 digit passkey should be randomly generated. So there is no provision to have all the devices with same PIN .  As of now , there is no such API in WICED to set a fixed passkey in all of your devices.

          So ideally only if your device have any IO capability , you can use passkey method.

           

          I have attached modified hello_Sensor example for IO capability display to test at your side.

           

          Note :

          I have attached our WICED Academy files compatible with WICED SDK. It is targeted for CYW20719 device, however the app code implementations and structures are same for 4343W . You may refer to WBT101-04B-BLE-Ntfy-Sec.pdf in labmaual folder for understanding how to implement different security options.

           

          Regards,

          Anjana

          • 3. Re: How to connect with a PIN on the CYW4343W?
            RoWo_4704901

            OK, many thanks for the fast reply, it's much appreciated.

             

            It's not what we wanted to hear, but at least we know. We have absolutely no UI, there must be a number of other products in a similar situation, so seems like quite a an issue.

            • 4. Re: How to connect with a PIN on the CYW4343W?
              AnjanaM_61

              Hi RoWo_4704901 ,

               

              Yea, I understand.

              To add one more point , if you keep the IO capability as keyboard, then you can just use the API wiced_bt_dev_pass_key_req_reply and you can send a known passkey if that helps your requirement. In that case, in your mobile you may have to hard code a passkey with IO cap display.

               

              As I mentioned before, currently our stack don't have the option to set a fixed passkey . However if its critical for your application, you may approach our local sales / FAE marketing team. They may evaluate the opportunity and consider the request for new API.

               

              Regards,

              Anjana

              • 5. Re: How to connect with a PIN on the CYW4343W?
                RoWo_4704901

                Hi again.

                 

                Sorry, only just seen your reply.

                 

                I don't understand what you mean by:

                 

                if you keep the IO capability as keyboard, then you can just use the API wiced_bt_dev_pass_key_req_reply and you can send a known passkey if that helps your requirement

                Most specifically by "keep the IO capability as keyboard". Are you taking about a keyboard on our device with the CYW4343W? We have nothing at all, it's like a watch with no display and no buttons!

                I'll tell the powers that be about the possibility of talking to you about a new API call.

                 

                Thanks again.

                • 6. Re: How to connect with a PIN on the CYW4343W?
                  AnjanaM_61

                  Hi RoWo_4704901 ,

                   

                  What I mean is - You will be keeping the IO capability as keyboard even if you don't have a real Keyboard entry in your end device.

                  Suppose you know the passkey already and hard corded on your peer device in which you have kept the IO cap display .

                  In that case , when you know the passkey to be used, you don't have to enter the key manually. Rather on the event triggers, you can call API wiced_bt_dev_pass_key_req_reply to send the known passkey to complete pairing process.

                   

                  Regards,
                  Anjana

                  • 7. Re: How to connect with a PIN on the CYW4343W?
                    RoWo_4704901

                    I'm getting nowhere with this. I have followed the hello_sensor example you posted, but it refuses to ask for any PINs when connecting.

                     

                    I then worked through some documentation in  WBT101-04B-BLE-Ntfy-Sec.pdf as you suggested and that says use this:

                     

                    wiced_bt_set_pairable_mode()

                     

                    Whch made me think I must have found what I was missing from your example code. However, even though it's in two examples of  "wiced_bt_dev.h" header files, it's not in the one we're using for our project.


                    So, is it possible we're using the wrong header files? I'm utterly confused by the overwhelming amount of  code and how many duplicate examples there of of numerous header files.

                     

                    It looks like the only places this function wiced_bt_set_pairable_mode()  is listed is under BCM920739 files. There are only a small handul of Google devices on the BCM920739, one of them referring to this site, so goodness knows what it is and how different it is to the CYW4343W that we are using. Are you able to give any advice at all on any of this please?

                     

                    Is there a different set pairable mode for the CYW4343W? Do we have the wrong header files?

                     

                    Thanks.

                    • 8. Re: How to connect with a PIN on the CYW4343W?
                      RoWo_4704901

                      AnjanaM_61

                       

                      Another reason I'm concerned that the instructions you gave me are for completely the wrong part is that those instructions go on about Bluetooth configurator, but from what I can make out this is in something called Modus toolbox and we're using WICED studio.

                       

                      Can you confirm as well as the questions above that this all works with WICED studio?

                       

                      Thanks

                      • 9. Re: How to connect with a PIN on the CYW4343W?
                        RoWo_4704901

                        This post:CYW4343W Wiced_bt_set_pairable_mode issue

                         

                        Seems to suggest we can't PIN pair at all using this CYW4343W. Is that really correct? We can only connect without a PIN with CYW4343W?

                         

                        SheetalJ_96 You were the responder on that original post, can you confirm this please?

                         

                        If not, what is the method for PIN pairing with the CYW4343W please?

                         

                        Many thanks.

                        • 10. Re: How to connect with a PIN on the CYW4343W?
                          AnjanaM_61

                          Hello RoWo_4704901 ,

                           

                          I tested and provided you the example project. Its working for me with passkey entry.

                          I tested with CySmart mobile app. Upon clicking on the device name, you will get a pop up for pairing as a notification on mobile screen top.

                          Click on that to proceed. Attached few screenshots.

                          It should work regardless of wiced_bt_set_pairable_mode API for 4343W.

                           

                          Regarding WICED ACADEMY files, yes its directly compatible with BT discrete chips. However the theory and pairing events are same for the 4343W chip as well. So You may refer that to understand the steps .

                           

                          Please test the project once again.

                           

                          However as mentioned before , IO_capabilities are required for PIN / Passkey entry. The example I shared is for test purpose at your side.

                           

                          As I mentioned before, currently our stack don't have the option to set a fixed passkey . However if its critical for your application, you may approach our local sales / FAE marketing team. They may evaluate the opportunity and consider the request for new API.

                           

                          Regards,

                          Anjana

                          • 11. Re: How to connect with a PIN on the CYW4343W?
                            RoWo_4704901

                            Hi  AnjanaM_61

                             

                            I tried again with the hello_sensor app rar you posted in your first reply again and it made absolutely no difference.

                             

                            On a whim, I tried my tablet. Same thing. Then out of desperation I tried a different phone and that did actually try and pair with PINs. I am using printing to a serial port to give me messages and that should spit out the PIN required.

                             

                            However, I never get a BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT event, it never prints out a PIN, so I cannot connect.

                             

                            If I take too long to confirm I want to connect with a pin (about fifteen seconds or so) the message asking for confirmation of PIN pairing disappears and it just tells me the characteristics are blank. I have to reboot our device to reconnect.

                             

                            I do get an event telling me the pairing has failed.

                             

                            So questions are:

                             

                            1. Why does my phone not work in any way at all with a PIN? Why does it just connect and work every time? (Bearing in mind a different phone does request a PIN.)

                             

                            I could imagine it's maybe because it's been connected to our device before, but our device is not in the list of bonded devices on my phone.  Is my phone's details stored in our devices somewhere without me realising it goes on behind the scenes? If so, how would I clear that from our device?

                             

                            2. Why is BTM_PASSKEY_NOTIFICATION_EVT never getting called? Even with a different phone that does at least realise it needs a PIN to connect?

                             

                            I realise this is not the solution long term, and we need to have the phone select a permenant PIN that is hard coded into our device, but, baby steps.

                             

                            Thanks again.

                            • 12. Re: How to connect with a PIN on the CYW4343W?
                              AnjanaM_61

                              Hi RoWo_4704901 ,

                               

                              Can you please let me know the WICED SDK version you are using?

                              I am sorry, there was an issue with SDK 6.4 version for the pairing. However I thought the issue is only when the device is in Central role. Let me ask any of my colleague to test the example with SDK 6.4 public version to see if we are getting same issue as yours and will update you.

                               

                              Regards,

                              Anjana

                              1 of 1 people found this helpful
                              • 13. Re: How to connect with a PIN on the CYW4343W?
                                RoWo_4704901

                                We are, indeed, using SDK6.4.

                                • 14. Re: How to connect with a PIN on the CYW4343W?
                                  RoWo_4704901

                                  Hi AnjanaM_61

                                   

                                  Did a colleague have a look at this?

                                   

                                  Also, what hardware have you tested this on? Remember we are usuing a module and an STM32 connected via UART/Quad SPI.

                                  1 2 Previous Next