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

Please tell me how to connect one nRF51822 and another as Central and Peripheral. In the future, I would like to connect one Central and multiple Peripheral.

I am new to BLE.

My question is similar to the one below.

https://devzone.nordicsemi.com/f/nordic-q-a/22596/nrf51822-central-connect-and-communicate-with-2-peripherals

But the link to the answer was broken and I couldn't find it, so I'll ask.

I am using two nRF51822 and SDK12.3.0. I want to run them as Central on one side and Peripheral on the other. 

Probably by a method called GATT communication.(It means communication in a connected state.)

My goal is to record  RSSI and receiving time in Central when it receives an empty packet from Peripheral.

I would like to receive packets at intervals of 1msec to 10msec,

so advertising with long transmission intervals and randomly staggered transmission times would not achieve my goal.

In the future, I would like to receive packets from about 6 peripherals and record the RSSI of the packets.

Please let me know if there is a sample program or code that fits my purpose.

I'm not very good at English, so I use translation software to create my texts. I'm sorry if I don't make sense in some parts.

Parents Reply Children
  • What you say is true.

    I think I have been challenging myself step by step in that.

    I learned about the communication theory of BLE.

    I used the board as "peripheral" and sent data to it using nRFToolbox.

    Central read advertisement packets from peripheral and other BLE devices.

    The "ble_app_uart.c" of both central and peripheral were connected.

    As the next step, I want to send packets from peripheral to central and get the rssi at that time.

    I'm going to use "ble_app_hrs" and "ble_app_multilink_central" or "ble_app_uart" for the connection state, since 1:1 is fine for now.

    The problem is that I don't seem to be able to establish the connection state between "central" and "peripheral".

    The combination of "app_multilink" and "app_hrs" does not show any response, and the combination of "app_uart" and "app_hrs" continues to read advertisement packets and does not move to the connection state.

    The "app_uart_c" of peripheral  and "app_uart_c" of central only show the sign of connecting, and there seems to be no packet exchange beyond that.

    Do I need to write a function in my "peripheral" side to send an empty packet when it receives a poll, for example?

  • tadanohito said:
    The combination of "app_multilink" and "app_hrs

     As mentioned here, https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/ble_sdk_app_multilink.html , the example will out-of-the box, "connect to any peer that has the device name "Nordic_Blinky". (i.e. the example in \examples\ble_peripheral\experimental_ble_app_blinky)

    In the main.c file of the ble_app_multilink_central example, we have:

    static const char m_target_periph_name[] = "Nordic_Blinky";                  /**< Name of the device we try to connect to. This name is searched for in the scan report data*/

  • Yes, of course, when I used the combination of "ble_app_multilink" and "ble_app_blinky", I used "periph_name[]" as "Nordic_Blinky" as shown in the sample.

    However, this sample requires three LEDs, and my evaluation board only has one LED on it, so I cannot check the results.

    For this reason, we wanted to confirm the connecting state in the form of RSSI reception rather than LED lighting in other applications(ble_app_hrs).

  • I thought that the LED setting of "app_multilink" is the essence of this problem, and it is unnecessary for communication with "ble_app_hrs".

    If I remove the ability to light the LED from "app_multilink" and let it communicate with "app_hrs", how should I modify the code?

    Or should I change the code to make it a connect state between "app_uart" and "app_hrs" in Central?

    Or is the problem still in the preferences or in the "BLE_GAP_EVT_CONNECTED" code?

  • I changed the code again, referring to the following article. But still nothing is displayed.

    https://devzone.nordicsemi.com/f/nordic-q-a/19437/rssi-measurement-for-each-peripheral-s130-or-132

    I still think it's the LED setting that's preventing it from working, rather than the BLE_GAP_EVT_CONNECTED part.

    I would like to remove the LED settings and connect to multiple peripherals.

Related