How to connect my bluetooth peripheral uart example with 3rd party bluetooth applications

Hi everyone, I am quite newbee to nRF5340 and nRF ecosystem. Anyway, my goal is to talk with 3rd party application to receive positioning data over bluetooth and then I have to mirror these data to another MCU via UART. I modified peripheral uart example in way to send data received from BL to other MCU. This is working with nRF's own bluetooth serial application and other 3rd party bluetooth serial application, but whenever I try to connect my nRF5340 from 3rd party GNS applications, it could not connect. I don't know the reason and I am open to any suggestions. 

Thanks.

Parents
  • Hi,

    Can you explain a bit more? The third party device you are connecting to, is it a peripheral or a central? Which exact device is it? What sevice(s) does it have, are they standard ones and/or custom ones? And what about pairing/bonding?

    If you do not know the answer to these questions, and if the device is a peripheral, a good start could be to connect to it from nRF Connect for desktop, and do service discovery to see what services it provides.

    If you are not even able to connect, perhaps the third party device use whitelisting, or some other mechanism that prevents you from connecting? Would it be possible to put in in a pairing mode where it would advertise without a whitelist for a while (this is a common thing to do)?

  • Hello,

    1. I picked bluetooth/peripheral_uart example for my custom nRF5340 board.

    2. I modified UART in a way to would send received data from BL to my another MCU runs over board.

    3. I disabled Buttons in that example in a way that would accept pairing number default. ( you also need to press button to confirm whether pairing codes is true in nRF5340.

    4. I connect with nRFConnect Bluetooth Serial Interface and sent some words and It worked and also managed to send these words to my another MCU.

    5. I also tried with another bluetooth serial terminal in google play. It also worked.

    6. Then I started to evaluate my real goal.

    The real goal is, I downloaded LEFEBURE NTRIP Client app to my mobile phone to get GNSS positioning data and send the data over BLE to my peripheral device e.g my custom nrF5340 board.

    My phone could see Uart Nordic Servis as my device and whenever I try to connect my device from inside of app, it could not connect.

    I also downloaded another app like lefebure and but did not work.

    Is it clear enough ? Please let me know.

    Device is my phone Redmi 10 2022. Host Application : LEFEBURE NTRIP Client. I am not sure which one is central but both my phone device and app should be central as far as I know. You can also see available ble device from this application.

  • Hi,

    OK, so you have an nRF communicating with another MCU over UART, and that works. So it is the other way around, you are making the peripheral (nRF) and the central app on the phone you have not made. And it is not able to connect to the nRF. Is that correct?

    What does this app require to connect? A special device name in the advertising packet, a special service, or something else? Why does it not connect? Have you checked with a sniffer trace? If this is a proprietary solution then you might need a bit of reverse engineering in order to figure things out, but it could also be that it will be quite obvious.

    Even though I got this the wrong way in my previous post, the key point remains, and that is that you need to know what communication is expected between the peers. Once you know how this should work, you can start implementing.

Reply
  • Hi,

    OK, so you have an nRF communicating with another MCU over UART, and that works. So it is the other way around, you are making the peripheral (nRF) and the central app on the phone you have not made. And it is not able to connect to the nRF. Is that correct?

    What does this app require to connect? A special device name in the advertising packet, a special service, or something else? Why does it not connect? Have you checked with a sniffer trace? If this is a proprietary solution then you might need a bit of reverse engineering in order to figure things out, but it could also be that it will be quite obvious.

    Even though I got this the wrong way in my previous post, the key point remains, and that is that you need to know what communication is expected between the peers. Once you know how this should work, you can start implementing.

Children
Related