Alfred
Alfred

Reputation: 11

AT+PASSKEY in BLE 5.0 . How to set and use?

I would like to use the EBYTE E104-BT52 module on my device and connect to it via an Android smartphone. But what if the client device is running BLE 4.2 and it will be unsecure pairing. To avoid this I would use passkey which will be showed on the device's display. But I dont find AT+PASSKEY ( or something similar ) in the user manuals: E104-BT07, E104-BT08, E104-BT5032A/B, E104-BT52, E104-52X, E104-BT09, E104-BT5040U(ble 4.2), E104-BT5032A/B. ( AT+PASSKEY is in the E104-BT40 user manual ( dual-mode bluetooth module ble 4.2 spp 3.0 Classic ) ).

Does it mean that I must write own firmware (this is undesirable) for E104-BT52 for use Passkey?

Upvotes: 1

Views: 172

Answers (2)

Alfred
Alfred

Reputation: 11

  1. I contacted EByte support. They replied: "I have confirmed with the engineer that our modules default to transparent transmission modules. It does not have functions related to the BLE and SM layers."
  2. My solution to this problem (using E104-BT5011A or similar):
    a. E104-BT5011A is in sleep mode with Advertising=0 (disable).
    b. when user presses button, I wake up ble. user can connect to the module.
    c. after user set all settings via bluetooth, he confirms by pressing button again to save settings.
    d. I disable advertising.

Upvotes: 0

Youssif Saeed
Youssif Saeed

Reputation: 13285

I had a quick look at the manual and there seems to be an "AT+AUTH" command for setting the authentication key. It isn't described in much detail though and it doesn't mention the underlying pairing methodology that is used, so you probably have to order this and test it yourself. I believe that you can't write your firmware anyway for the E104-BT52 (or it's not going to be easy) because the module is supposed to work only in AT command mode.

To respond to your comment, in BLE the pairing process always happens after the connection process. Your description of connecting through nRF Connect and then using AT+AUTH to read the third char is exactly what is expected of a pairing process. Pairing in BLE can happen when the user explicitly requests pairing, but it can also happen when accessing a characteristic requires authentication/encryption, which is the behaviour that you saw. You can read more about this by checking GATT or ATT access permissions. I've added some links in the references below.

Finally, there is no "air configuration" command in the Bluetooth spec so I am sure this is a technical term used by EBYTE and under the hood this is either setting the default passkey or changing it during the pairing process.

If this still doesn't answer your question, my recommendation is to reach out to EBYTE for help as they will be better equipped in explaining how their AT commands can be used to achieve what you need.

Reference:-

Upvotes: 0

Related Questions