0

I am new with Raspberry Pi 4B and I am trying to read data sent from a peripheral BLE device, but I am having some problems and would like your help.

First of all, I am able to connect to the BLE device but am not being able to pair to it. Anyone knows what is the difference between Connect and Pair?

Once I am connected, I am following these steps:

  • scan off
  • menu gatt

Once I am inside the GATT menu, I am not being able to read from a certain attribute. I can see there is a command called "read" but am not able to read any data.

Any help with this issue is appreciated.

3
  • Pairing is a one time exchanging of keys, while connect is establishing a connection ready to exchange data. You haven't said what flags are set on the characteristic you are trying to read so that characteristic might not support reading. Try using a generic Bluetooth Low Energy scanning and exploration tool like nRF Connect to better understand your device. You can do similar in a web browser with chrome://bluetooth-internals/#devices
    – ukBaz
    Dec 5, 2023 at 7:14
  • To be fair, the bluetoothctl documentation is very poor. Many things are not explained. Use select-attribute [attribute's UUID], and if you get something like /service0003/char0004. then read will work if the attribute is readable.
    – petzval
    Dec 7, 2023 at 15:31
  • Hello! Thanks for your responses! The flag of the characteristic I am trying to read is READ & NOTIFY, so I have been able to read the values sent using notify on (inside GATT menu). Thank you!
    – aag
    Dec 11, 2023 at 9:17

1 Answer 1

0

Your question doesn't provide several details needed to provide a complete answer. I'll answer what I can:

  1. Anyone knows what is the difference between Connect and Pair?

Yes, and you would know that also if you took a moment to search (i.e. research):

You come to car with BT audio system first time.
You are not paired and not connected.
You pair the devices and because you are close to the car you immediately connecting. But when you go to home and you are away from car you are disconnected but paired. When you come close to the car again, you don't need pair, you don't need put pin again to pair the devices. Reference

  1. Once I am inside the GATT menu, I am not being able to read from a certain attribute. I can see there is a command called "read" but am not able to read any data.

This part of your question may also reflect a lack of research. I've never used GATT, but wonder if this is significant? If it's not, I suggest you now spend a bit more time researching your question.

GATT comes into play once a dedicated connection is established between two devices, meaning that you have already gone through the advertising process governed by GAP.
Reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.