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

Connecting nRF51822 Beacon Kit to a Raspberry Pi 4

Hello. I am using a Nordic Semiconductor Beacon (nRF 51822) and i am trying to connect it to my Raspberry Pi 4, but even though i installed Bluez, scanned using hcitool, i am able to find it (its mac) but i can't connect to it.

I pressed SWD button, the led is blinking Yellow, i scan using sudo hcitool lescan , and i find the mac with BeaconConfig near it.

The command that i am using to connect to it is sudo gatttool -b address -I, it appears MAC[LE]> and when i type CONNECT, after 20 seconds it says Error: connect error: Connection refused (111) ... Am i doing something wrong? this is the first time i am using any beacon and i am trying to use 4 of them to get my RaspBerry location..

as a tutorial, i followed this one: https://www.jaredwolff.com/get-started-with-bluetooth-low-energy/

Parents Reply Children
  • Hello, 

    Thank you for answering my question. Yes, I read the user guide and saw that example but still no luck getting the data from my beacon. What I am trying to do is:

    I will mount my beacons in my room, in the 4 upper corners and on my VNC Server (connected to my raspberrypi) I want to receive my raspberry location (x, y). I tried to install the program from nordicsemi site as shown in the user guide but still no luck. 

  • Hi,

    Tekk said:
    Thank you for answering my question.

    No problem at all, I am happy to help.

    Tekk said:
    I want to receive my raspberry location (x, y)

    Do I understand you correctly that you wish to use the data from your 4 beacons to calculate the position of your raspberry pi?
    I am not familiar with the RaspBerry Bluetooth API - are you able to see the beacons advertisements on your device? If so, are you able to extract the different data from the advertisement bit fields, such as the manufacturer specific data or vendor identifier?

    Tekk said:
    I tried to install the program from nordicsemi site as shown in the user guide but still no luck.

    Please elaborate which program you are referring to; do you mean the nRF Connect Desktop app, or are you referring to the nRF Beacon app for iOS/Android ( as mentioned in the Beacon User Guide? ) ? Please also detail your approach and what you have attempted to do.

    Best regards,
    Karl

  • Hi,

    The only thing that I am able now to see is the MAC Address of the Beacon using sudo hcitool lescan, but i can't extract the data to calculate the position. I followed the tutorial from here. In the hcitool & gatttool  section it says that you can see more information after connecting to the beacon, but i can't connect as you said.

    On my phone I installed the nRF Beacon app and worked fine, but on Raspberry i tried with the Desktop app, the one for Linux and no luck..

  • Hi,

    I am not familiar with the hcitool commandline tool that you describe, but from a quick search on stackoverflow it seems that the command sudo hcitool lescan will only output the addresses of nearby BLE devices to terminal, and nothing more.
    Perhaps this post provides a solution for your issue with not seeing the advertisement packets?
    Please attempt their solution, and let me know if you are able to retrieve the full advertisement package.
    Please also note the difference between Bluetooth classic and Bluetooth Low Energy.

    If the guide specifically tells you to connect to the beacons, it is inaccurate - since a beacon will not accept connections.

    Tekk said:
    on Raspberry i tried with the Desktop app, the one for Linux and no luck..

    Could you specify for me which desktop application you tried on your Raspberry Pi, along with which Linux distribution you are running on your Raspberry Pi?

    Best regards,
    Karl

  • Hi, 

    Perhaps this post provides a solution for your issue with not seeing the advertisement packets?

    Thank you!! I followed that post and now i can see my beacon RSSI. Now the only problem is to store it so that i can calculate the distance.

    Could you specify for me which desktop application you tried on your Raspberry Pi, along with which Linux distribution you are running on your Raspberry Pi?

    On my Raspberry Pi I am running the "Raspbian Buster", the version with desktop and recommended software and I tried installing the nrfconnectsetup220.

Related