Connect the Android „nRF Connect mobile“ app with a Bluetooth Low Energy device

AndroidCrypto
4 min readOct 25, 2022

--

This is a simple manual for how to do the first steps when you’re
trying to examine a Bluetooth Low Energy (BLE) device using the
app „nRF Connect for mobile“.

The app is provided for free and is available on Google’s PlayStore
using this link: https://play.google.com/store/apps/details?
id=no.nordicsemi.android.mcp&hl=de&gl=US
.

Purpose of the app: the app is extreme useful when you are
developing a server or peripheral for the Bluetooth Low Energy
technology or having a 3rd party device and you would like to
know what services and data are provided by this device.

After downloading and starting the app the app is immediately
scanning for BLE devices and will show a device in the „Scanner“
tab.

I used this app to communicate with my BLE Server app and the
screenshots in this article were taken during development.

Step 1: start the server app or bring your external device in a
„advertising mode“, so that it becomes discoverable for the nRF
app.

Step 2: the nRF app has found the server running on my second
smartphone. The name shown in the first line („SM-A515F“) is the
name of my smartphone, a real device could show something like
„Contour7901H12345678“ for a Glucose meter device. Click on the
CONNECT button to proceed.

Step 3: The server is providing the general services like General
Attribute
, Generic Access, Device Information and 2 data
services like the Current Time Service and a Heart Rate Service.
This service has (short) UUID „0x180D“ and the long UUID for the
service is „0000180D-0000–1000–8000–00805f9b34fb“.

Now click on the Heart Rate entry to get the information of this
service.

Step 4: We get the information for the Heart Rate Measurement
characteristic with the “short” UUID „0x2A37“ (and long UUID
„00002A37–0000–1000–8000–00805f9b34fb“).

The „arrow down“ symbol is a button that allow to read the data
from the server. The „arrow down and up“ symbol is a switch for
en- or disabling notifications and indications.

The „Descriptors“ below are responsible to handle notifications and
indications.

Step 5: press the read button for the Heart Rate Measurement and
receive a one-time value of 64 bpm.

Step 6: press the enable notifications/indications button and notice
that the value for the heart rate will change periodically (in this
example every second).

The Descriptors section will show that Indications/NOTIFICATIONS are enabled. The symbol changes and a second press on the symbol will disable the notifications/indications.

Step 7: doing the same with the Device Information Service you
get the values for the Manufacturer Name and Model Number from
the device/server.

Step 8: at least we choose the Current Time Service and there is a
new „arrow up“ symbol for uploading data to the device.

Warning: Beware of typing any data in the input field and send them to
the server, unless that you know exactly what data are
expected.
In the best case you just get an error on writing but in
the worst case, you disable or destroy the device without any
chance of a „reset“.

A last note when working with an emulated server/device running
on a Smartphone (e.g. the BleServerBlessedOriginal): For security
reasons the address the server can get connected is changing very
often so when using a client app like the nRF Connect-app it is
necessary to often (re)run a scan AND choose the newest entry
(mostly the most bottom down one).

--

--