Read and Write Bluetooth Signal with SIMCOM-GATT Server

02.05.24 11:51 AM By AKB

Read and Write Bluetooth Signal with SIMCOM-GATT Server


In implementing the communication protocol for Internet of Things (IoT), Bluetooth communication plays an important role in communicating devices fast. Whether it's your smartwatch connected with your phone or your fitness tracker, Bluetooth technology enables these interactions. In this blog post, we will discuss the reading and writing of Bluetooth signals using the SIMCOM-GATT Server, so that you can use the full potential of Bluetooth-enabled devices.

What is GATT?

GATT stands for Generic Attribute Profile. It's like a rule to be followed for Bluetooth devices to share data using Services and Characteristics. It’s a data sharing Attribute Protocol where devices store their data with short IDs. GATT starts working once two devices are connected after they've finished their initial "handshake" process. GATT connections are like VIP passes. Only one device can connect to another at a time. Once a connection is made, the device stops announcing itself to others until the connection is over. When devices are connected, they can send data back and forth, sharing information easily. In this blog we will see how to start a GATT server and Read and Write Data onto it.

Requirements

1. SIMCOM Wireless Solution A7672S-FASE (with GNSS + BLE )

                                                                                                                

                                                                                                                Read and Write Bluetooth Signal with SIMCOM-GATT Server


A7672S FASE is the LTE Cat 1 module that supports wireless communication modes of LTE-FDD/GSM/GPRS/EDGE. A7672S supports maximum 10 Mbps downlink rate and 5 Mbps uplink rate. A7672S adopts LCC+LGA form factor and is compatible with SIM7000/SIM7070 series (NB/Cat M modules), and SIM800A/SIM800F series (2G modules), which enables smooth migration from 2G/NB/Cat M products to LTE Cat 1 products, and greatly facilitates more compatible product design for the customer needs.


A7672S supports both multiple built-in network protocols and the drivers for main operating systems (USB driver for Windows, Linux and Android). The software functions, AT commands are compatible with the SIM800 series modules. A7672S also supports BLE* and GNSS* and it integrates abundant industrial standard interfaces with powerful expansibility, such as UART, USB, I2C and GPIO, which makes it perfectly suitable for main IOT applications such as telematics, POS, surveillance devices, industrial routers, and remote diagnostics etc.


A7672S(with GNSS + BLE ) Advantages:

  • Compact size with abundant interfaces.

  • Supports BLE and GNSS functions.

  • Abundant software functions: FOTA, LBS, SSL.

  • Form factor is compatible with the SIM7000/SIM7070 series.

2. SIMCOM AT Command Tester Tool


                                                                                                   Read and Write Bluetooth Signal with SIMCOM-GATT Server


AT Command Tester for Simcom Modules is a desktop software that communicates with all Simcom Module devices using AT Commands. Download here.

3. nRF Connect for Mobile Application


                                                                                                                                                                          Read and Write Bluetooth Signal with SIMCOM-GATT Server


nRF Connect for Mobile is a powerful generic tool that allows you to scan and connect your Bluetooth Low Energy (BLE) devices and communicate with them. nRF Connect supports a number of Bluetooth SIG adopted profiles together with Device Firmware Update profile (DFU) from Nordic Semiconductors and Mcu Manager on Zephyr and Mynewt. Download this app from here.


Now our Requirements are fulfilled lets now create a GATT server and Read and Write data:

Follow the below steps to perform operations on GATT server using SIMCOM A7672s 4Gmodule:

  1. Power up the 4G module.

  2. Connect it to your laptop.

  3. Open the Simcom AT Command Tester Tool.

  4. Select the AT port option and open the port.


After successfully opening the port, follow the following AT sequence:

  1. To check the host name: AT + BLEHOST?

  2. To change the host name: AT+BLEHOST= “CampusComponent BLE”

  3. POWER UP the BLE: AT+BLEPOWER=1, this will take some time.

  4. Register a GATT server by this command: AT+BLEREG, wait till you get the response with a name of the server such as “ABCDEF00”.

Lets now set the parameters for our GATT server:

  1. AT+BLESSAD=0, “1802”, 30, 1, 4

  2. AT+BLESCAD=0, “2A06”, 4, 38, 3

  3. AT+BLESSDAD=0, “2902”, 4, 0

Now let's start our server:

  1. AT + BLESSTART = 0,0

  2. AT+BLESLSTART = 0


After this open the nRF connect application on your mobile phone

  • At the top right corner of the application you will find an option for “Start Scanning”.

  • After scanning you can find your BLE name as “CampusComponent BLE” connect it.

  • After the connection is successfully established, you will get a AT command response on your laptop screen as follow: +BLESCON:1, ABCDEF00, 54, 29, 28: C5: 5F:24,1

  • On your mobile app:

  1. Click on Immediate alert

  2. On side of your BLE name there are two arrows: Downward arrow use for Reading the Data and Upward arrow is use for Writing the data

To Read the data:

  • Click on Read i.e Downward Arrow

  • Then send the AT command AT+BLERSP=0, “HEX(123489)’

  • On the application you will be able to see the Send Value.

  • Same process follows for Writing the Data.

Conclusion

Thus we have successfully started our GATT server and did the Reading and Writing of the data on the server. We have used the SIMCOM AT command Tester tool to send AT commands and started the server and connected the server by using nRF connect mobile app. Using the app we are able to send and receive the data over SIMCOM A7672s BLE. By using this GATT server over BLE you can establish communication in your IOT Device seamlessly. This protocol can be used in various applications like Home automation, Agritech, Industrial IOT, etc. If you are looking to implement a BLE GATT server in your IOT application and want the SIMCOM modules then checkout the best electronic components online store - Campus Component now.

Added to cart
- There was an error adding to cart. Please try again.
Quantity updated
- An error occurred. Please try again later.
Deleted from cart
- Can't delete this product from the cart at the moment. Please try again later.