This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connect 1 central and peripheral nrf52830 with 1 peripheral nrf52832

Hi all!

I'm quite new in working with BLE device and in working with MCU also so If my question look a bit silly, please dont laugh at me

I am using a nrf52832 as both central and peripheral device, I want to communicate with 1 peripheral nrf52832 and send data between them, the data sent is simple

I don't know how to do that, is there any detail instruction or example that can show me how to implement it? I use Keil C for coding

I would really appreciate if anyone can help me

Thank you so much!

  • I think the Beacon Transmitter Sample Application located in examples/ble_peripheral/ble_app_beacon is convenient for your case. It can be flashed into the peripheral, and it will make the peripheral broadcast (advertise) information to the devices nearby. Here is a blog post explaining more about GAP advertising.

    However, if you want to send more data, and establish a connection between the two devices, I would recommend you read about GATT, which stores the data in modules called Services and Characteristics. Here and here are some examples that can be loaded into respectively the peripheral and the central. These examples implements Nordics UART Service (emulates serial port over BLE), and is a nice place to start when learning about GAP connections.

    Down below is also some nice tutorials to learn about advertising, characteristics and services

    Best regards, Simon

  • Thank you for your reply, I have 1 more concern, could you explain for me if you have time?

    Actually when a ble device is set as peripheral, I can discover it in my phone through nrf connect and choose which device to connect, but when connect between 2 nrf device, how can they recognize each other correctly because there are many other devices around them

  • This is because the advertising packet contains data such as device name and UUID, and nRF Connect can separate between devices based on that information. Here is a nice link in order to understand the advertising packet. It is also possible to to this an nRF chip, and here is a link showing how to decode the advertising data in the payload.

Related