Bluetooth LE
Author
Discussion

steve-V8s

Original Poster:

2,924 posts

278 months

Friday 31st December 2021
quotequote all
Struggling to get my head round LE.

As a basic concept does it work by effectively having a load of registers which are called services, in the service is the data which is called the characteristic.

So in simplistic terms, to exchange data once the two ends are connected : One end puts some data ( a characteristic) in a service, the other end polls the service and reads the data. When data is ready it has to be placed in a register (service) rather than directly sending it as you would with a 232 connection.

Is that any where near correct ?

Some services seem to have defined addresses like perhaps the RSSI value. Some explanations additionally refer to attributes, profiles and descriptors, what they are is unclear.

Trying to establish two way data between an RN4870 module and android, the 4870 has a "transparent UART" service but how that works other than connecting to it is remaining a mystery.

Mr E

23,081 posts

289 months

Friday 31st December 2021
quotequote all
Something like that, yes.

There are defined characteristics, but nothing stopping you defining anything you want.

steve-V8s

Original Poster:

2,924 posts

278 months

Friday 31st December 2021
quotequote all
With some code written in B4A I can connect to the RN4870 but have no clue how to send and receive data. The module data sheet reveals a 35 character UUID for read and write using a "transparent UART" service but I have not been able to figure out what to do with the UUID. Attempting to send it as a string crashes my application.

Anybody have any experience of how this works or at least give me a clue ? Have been staring at it for a couple of weeks now.

Mr E

23,081 posts

289 months

Friday 31st December 2021
quotequote all
A rasp pi using gatttool can probably connect and read/write from the command line should you wish to experiment.

steve-V8s

Original Poster:

2,924 posts

278 months

Friday 31st December 2021
quotequote all
Thankyou for the pointer to GatTool.

The documentation on its own looks easier to figure than the Microchip data sheet. I do have a Pi here but it is embedded in a bit of test kit, looks like there is a version to run on pc which I will take a look at.

Mr E

23,081 posts

289 months

Friday 31st December 2021
quotequote all
[quote=steve-V8s]Thankyou for the pointer to GatTool.

Most welcome.
Also, I find an app called nRF connect on the phone very useful for quickly looking at devices.
Android more functional than iOS

nyt

1,939 posts

180 months

Friday 31st December 2021
quotequote all
I use an android app called BLE Scanner.

steve-V8s

Original Poster:

2,924 posts

278 months

Saturday 1st January 2022
quotequote all
Still struggling with understanding this. Out of the BLE sniffers suggested I have installed nRFmaster. With that I can see and connect to the RN4870 module and read rssi, manufacture, software version etc. but I am no where nearer to understanding how to send and receive data.

The module has a “Transparent UART” service, it seems this works by sending data as a notification and receiving data as a write without response. I guess that using notification avoids the remote end having to poll to see if there is data.

The data sheet tells me that the transparent service UUID is :-

49535343-FE7D-4AE5-8FA9-9FAFD205E455

and the characteristic properties are :-

UART TX 49535343-1E4D-4BD9-BA61-23C647249616 Notify,Write,write without response.
UART RX 49535343-8841-43F4-A8D4-ECBE34729BB3 Write,Write without response.

I can see the service and the characteristics listed using nRFmaster but still can't see how to send or receive anything. If I try to send the entire characteristic from b4a it crashes and I can't believe you need to tag the entire 32 characters on to each packet, the pay load I am trying to send and receive is just a string of 5 Ascii values every 500ms.

It is all so easy with rs232.

nyt

1,939 posts

180 months

Monday 3rd January 2022
quotequote all
This may provide some help: https://www.argenox.com/library/bluetooth-low-ener...



Edited by nyt on Monday 3rd January 13:16

steve-V8s

Original Poster:

2,924 posts

278 months

Monday 3rd January 2022
quotequote all
Useful reading, thank you.