Bluetooth Presence Sensor

  1. 6 months ago

    Mark S

    17 Feb 2019 Pre-Release Testers, Xojo Pro, XDC Speakers

    Does anybody have experience on a Raspberry Pi with Bluetooth?

    I am exploring solutions to detect the presence of a bluetooth device (a smartphone) and then send a text message (SMS) to remind them to clock in to their shift. I think I could do this on a Windows or Mac with some MBS functions (which I have licensed) but it does not work in Linux or Raspberry Pi. A Pi is preferred due to pricing and physical size.

    I would even consider "SHELLing" out to a some sort of command line tool and then process the result. A bit of Internet searching indicates some Bluetooth tools do exist for the Pi environment.

    The data needed would be some unique identifier that I can associate with an entry in a database then create the text message.

  2. Jean-Yves P

    17 Feb 2019 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

  3. Russ L

    18 Feb 2019 Pre-Release Testers, Xojo Pro

    if using a Rpi3 then

    sudo hcitool lescan

    should return the list of devices that respond.

  4. Mark S

    Feb 23 Pre-Release Testers, Xojo Pro, XDC Speakers


    I finally got to test the hcitool on my Rpi3 and it does work. Now I just need to figure out which ID corresponds to which device.

    My iPhone has a Bluetooth ID listed in General>About but that ID does NOT appear in the hcitool lescan list. I can turn off BT on the phone and back on and watch the ID re-appear on the Rpi3 with the lescan but it does not match.

    Is the Low Energy ID different?

    Thanks for the tip.


  5. 5 months ago

    You might find that the iPhone is not be using the actually BT MAC address when starting the BTLE advertisement. Might be part of a privacy framework in place.. just a hunch. You can create (as far as I recall) an app for your phone that will advertise a specific service with unique characteristics that you should show up using hcitool. It'll be a case of using gatttool to interrogate the devices and look for the services.
    It's very near-field though meaning that you only have a short window to detect the BTLE signal and interrogate the device.

    I use a technique like this for a BTLE device that I have fitted to my motorbike but that's obviously not a smartphone and the bike doesn't move around like guys at work.
    I don't think Android devices have the same MAC address kung-foo in place as iOS devices.

or Sign Up to reply!