NINA-B1 series - Getting Started
UBX-16009942 - R04 Use case examples
Page 13 of 19
4 Use case examples
4.1 Connect two NINA-B1 using Bluetooth low energy
Connect two NINA-B1 modules using Bluetooth low energy Serial Port Service (SPS) that connects automatically.
To set up first NINA-B1 as a Central (Device A)
• Enable Central Role
o AT+UBTLE=1
• Default peer to Serial Port Service and always connected (use the address of Device B)
o AT+UDDRP=0,sps://112233445566,2
• Startup NINA-B1 in data mode
o AT+UMSM=1
• Store configuration
o AT&W
• Restart NINA-B1
o AT+CPWROFF
Set up second NINA-B1 as a Peripheral (Device B)
NINA-B1 has the u-blox Serial Port Service enabled by default:
• Startup in data mode
o AT+UMSM=1
• Store configuration
o AT&W
• Restart
o AT+CPWROFF
4.2 Set up GATT Server / Client on NINA-B1
The following example shows how to set up a GATT Server on one NINA-B1 and receive notifications of updated
values at a GATT Client on a second NINA-B1.
Set up a GATT Server with a pre-defined service on NINA-B1 (Device A)
• Define a Heart Rate service, a list of all available pre-defined services and its characteristics can be found
at [8] and [9]
o AT+UBTGSER=180D
+UBTGSER:30
• Add a Heart Rate measurement characteristic with notification support
o AT+UBTGCHA=2A37,10,1,1
+UBTGCHA:32,33
Use the GATT Client on NINA-B1 (Device B) to receive Heart rate measurement values:
• Enable Central Role
o AT+UBTLE=1
• Store configuration
o AT&W
• Restart
o AT+CPWROFF
• Find the other device
o AT+UBTD=4,1