EZ-Serial: BLE pairing with random passkey

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PascalS
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

I have got a CYBT-333047 eval-board and I'm using EZ-Serial via CySPP communication interface.

Now, I need a secured connection, where the user of the central device (a proprietary app) has to type in a random passkey which is generated by the CYBT-333047 module and shown at our display. So the user of the central device needs to have hardware access to couple with the module (peripheral). It mustn't be possible that anybody in the near can connect to our module without typeing in the right passkey. The passkey should be random or course.

I found the chapter Pairing with a Random Passkey (BLE) in EZ-Serial WICED Firmware Platform User Guide for CYW2070x-based Modules​ (p. 48 -49) and I hope, that this chapter describes my issue.

I tried this example but didn't get the expected results

RESET

Boot event

@E,003B,BOOT,E=01010E06,S=05020016,P=0103,H=D1,C=00,A=F60F3EE81861\CR\LF

40 45 2C 30 30 33 42 2C 42 4F 4F 54 2C 45 3D 30 31 30 31 30 45 30 36 2C 53 3D 30 35 30 32 30 30 31 36 2C 50 3D 30 31 30 33 2C 48 3D 44 31 2C 43 3D 30 30 2C 41 3D 46 36 30 46 33 45 45 38 31 38 36 31 0D 0A

Advertisement changed event

@E,000E,ASC,S=01,R=03\CR\LF

40 45 2C 30 30 30 45 2C 41 53 43 2C 53 3D 30 31 2C 52 3D 30 33 0D 0A

Set random passkey generation

SSBP,M=4D,B=1,K=10,P=0,I=4,F=3\CR\LF

53 53 42 50 2C 4D 3D 34 44 2C 42 3D 31 2C 4B 3D 31 30 2C 50 3D 30 2C 49 3D 34 2C 46 3D 33 0D 0A

Success event

@R,000A,SSBP,0000\CR\LF

40 52 2C 30 30 30 41 2C 53 53 42 50 2C 30 30 30 30 0D 0A

Central connects to the module

Connection event

@E,0035,C,C=01,A=6ECB0FFB7A44,T=00,I=0028,L=0000,O=02BC,B=00\CR\LF

40 45 2C 30 30 33 35 2C 43 2C 43 3D 30 31 2C 41 3D 36 45 43 42 30 46 46 42 37 41 34 34 2C 54 3D 30 30 2C 49 3D 30 30 32 38 2C 4C 3D 30 30 30 30 2C 4F 3D 30 32 42 43 2C 42 3D 30 30 0D 0A

NOT documented event

@E,001A,W,C=01,H=000B,T=00,D=0200\CR\LF

40 45 2C 30 30 31 41 2C 57 2C 43 3D 30 31 2C 48 3D 30 30 30 42 2C 54 3D 30 30 2C 44 3D 30 32 30 30 0D 0A

I do not get the expected and documented result

pairing.PNG

Best Regards!

0 Likes
1 Solution

The IOS device will initiate the BLE connection without pairing.

I test the FW with CYSmart app on an Android device. When I click the "pair", it can receive the events successfully.

Following is the log:

pastedImage_0.png

View solution in original post

5 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

It seems the peer device connect with the module directly without the passkey.

What's your peer device? Did you set its IO ability to display yes or no?

0 Likes

My peer device is an iPhone 8 with the Blue Light App. Where can I set these IO abilities?

The IOS device will initiate the BLE connection without pairing.

I test the FW with CYSmart app on an Android device. When I click the "pair", it can receive the events successfully.

Following is the log:

pastedImage_0.png

Thanks for your response XinghaoZ_26! It seems, that the iOS App hasn't the same features than the Android App.

First of all, I could reproduce your example with the CySmart Android App! But it seems, that the fixed passkey fits better than the random passkey for us. Unfortunately I can't reproduce the fixed passcode procedure.

My configuration

config.PNG

Datasheet configuration

data.PNG

As you can see, I receive a DISconnection event, before I get the suggested ENCryption event.

In the CySmart Android App, I type in the code "123456".

It would be great, if you could reproduce this!

Independent of the establishment of a paired / bonded connection. It seems that I just can secure the first characteristic with UUID 65333333-A115-11E2-9E9A-0800200CA101 all other charecters can be written and read independent of the server_security settings in .CYSPPGP Is that right? In our scenario all characteristics should be secured and not read or writeable until a secured connection / pairing / bonding is established.

Best Regards!

I summarized my problem in this post to close this topic. The headline doesn't fit to the wished solution anymore .

Best Reagrds!