CN
HOMEABOUT USINDUSTRY INFO HOW TO USE BLE MODULE BLE5101

How to use BLE Module BLE5101

By sdga:NiceRF Wireless Technology Co., Ltd

BLE5101 is a BLE module based on BLE 5.1 protocol, with a working frequency band of 2.4GHz. It has the characteristics of small size, low power consumption, master-slave coexistence and so on.

 

How to use BLE Module BLE5101

Tools:

  • SSCOM Serial Debugging Assistant,
  • nRF Connect for Android,
  • The phone version Android 10

(Serial port setting: 115200, 8, N, 1)

 

  1. Confirm whether the BLE module is in configuration mode

The BLE module BLE5101 manufactured by our company will enter the configuration mode by default when it is powered on, so as to facilitate the user to set parameters. In the configuration mode, the module will not automatically run the Bluetooth functions and is in the idle state.

Send the AT test command "AT\r\n" (where \r\n is the carriage return and line feed, ie 0x0d 0x0a) to confirm whether the module enters the configuration mode:

If there is no reply, the module does not enter the configuration mode. Send a packet of string "+++\r\n" or pull the SET pin (PIN 6) low to enter configuration mode. When entering the configuration mode, the serial port of the module will reply with the message "[ENTER AT MODE]":

 

  1. Turn off the function of automatically entering configuration mode after power-on

Send the AT command "AT+ENATMODE=0\r\n", the module returns "OK" and the setting is successful. The module will apply this parameter the next time it starts.

 

  1. Modify the MAC Address of the BLE module

The BLE5101 modules manufactured by our company have the same MAC Address. It is impossible to establish a Bluetooth connection between two BLE5101 modules with the same MAC Address, so it is necessary to modify the MAC Address of one of the BLE modules.

For example, set the MAC Address of the module to 11:22:33:44:55:66, and send the AT command "AT+MAC=112233445566\r\n":

If the module returns "OK", the setting is successful.

 

  1. Enable the master-slave function of the BLE module

Send the AT command "AT+CONS?\r\n" to check whether the master-slave function of the BLE module is enabled:

The module returns "+CONS=a,b". Among them, when a=0, the module will disable the slave function, the module cannot enable Bluetooth broadcast, and reject any connection request from the Bluetooth master; when b=0, the module will disable the master function, and the module cannot enable Bluetooth scanning. BLE5101 module supports the coexistence of master and slave, so a and b can be set to 1 together, and the master function and the slave function can be turned on at the same time.

Send the AT command "AT+CONS=1,1\r\n", the module returns "OK" and the setting is successful. The module will apply this parameter the next time it starts.

 

  1. Restart the BLE module

Send the command "AT+RESET\r\n" or power on the module to restart. If the SET pin is pulled low, the SET pin needs to be restored to a high level, otherwise the BLE module will still enter the configuration mode after restarting.

 

The module will always apply the above setting parameters, and will automatically turn on Bluetooth scanning and Bluetooth advertising after power-on. Open nRF Connect, start scanning, the phone will be able to receive advertise packets from BLE5101, and users can click CONNECT to establish a Bluetooth connection; if two BLE5101 modules have these settings applied, they will automatically establish a Bluetooth connection after they are powered on.

 

  1. BLE5101 establish a Bluetooth connection with each other and send and receive data

If there are two BLE5101 modules with the 1-5 step settings applied, then they will automatically establish a bluetooth connection. After the module is successfully connected as a master, the serial port will reply: "SLAVE CONNECTED" and display the MAC address of the slave; otherwise, it will reply: "MASTER CONNECTED" and display the MAC address of the master.

Note: Since the Bluetooth advertising of the two BLE5101 modules is turned on together with the Bluetooth scan, it cannot be guaranteed that one party is fixed as the master or the slave during the actual connection. If one party needs to be fixed as the master/slave, after entering the configuration mode, send the AT+CONS command to set the corresponding function to 0.

 

When BLE5101 is connected as a master, due to the BLE protocol process, it needs to discover the GATT Service and GATT Characteristic of the slave. This process takes about 1-2s, and then automatically sends a Notification Enable request to the BLE5101 slave to start data transmission. BLE5101 supports a maximum MTU of 250, that is, a single packet can send up to 250 - 3 = 247 bytes of data.

 

  1. The mobile phone establishes a Bluetooth connection with BLE5101 and sends and receives data

After establishing a Bluetooth connection between the mobile phone and BLE5101 through 1-5 points, you can start sending and receiving data as shown in the figure:

 

Service UUID

FFF0

Characteristic UUID

UUID

Attributes

Explain

FFF1

Read/Notify

The slave sends, the master receives the data channel

FFF2

Write/Write no response

The master sends, the slave receives the data channel

 

1) The default Primary Service UUID of BLE5101 for sending and receiving data is 0xFFF0. Click to view the Characteristic included in the Primary Service.

2) When BLE5101 is used as a slave, it sends a Notification notification to the master through the Characteristic with the Notify attribute by default. Click the arrow to send a Notification Enable request to the BLE5101 to automatically receive the data sent by the BLE5101.

3) Click the arrow to send data to BLE5101, and BLE5101 will print it out through the serial port after receiving the data.

Contact Us

 +86-755-23080616

 sales@nicerf.com

Website: https://www.nicerf.com/

Address: 309-314, 3/F, Bldg A, Hongdu business building, Zone 43, Baoan Dist, Shenzhen, China

Contact Us
Privacy Policy

Privacy Policy

· Privacy Policy

There is currently no content available


           

Email:sales@nicerf.com

Tel:+86-755-23080616

Address:309-314, 3/F, Bldg A, Hongdu business building, Zone 43, Baoan Dist, Shenzhen, China


×