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/

  • 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.

  • Hi,

    Tekk said:
    Thank you!!

    No problem at all, I am happy to help!

    Tekk said:

    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.



    As I said earlier I am not familiar with the hcitool commandline tool, and how you could capture its output, but I am sure hcitool provides the functionality you are after.
    A quick search for the hcitool reference yielded this overview, though I am unable to verify the specified options.
    It seems the rssi option might be what you are looking for? Then you can save just the RSSI values directly.

    Alternatively, you could set up a script to sift through the hcitool output(using $grep for example), and $echo the parts you are interested in to another program or file.

    Hope this solves your issues with acquiring the beacon data you seek! :)

    Best regards,
    Karl

     

     

     

Related