Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raspberry-pi as connectable beacon

I want to build some kind of two-way bluetooth connection on Raspberry-pi which actually works as beacon. Based on RadiusNetworks tutorial (How to Make an iBeacon Out of a Raspberry Pi http://developer.radiusnetworks.com/2013/10/09/how-to-make-an-ibeacon-out-of-a-raspberry-pi.html) I've built beacon on my Raspberry-pi, but it's working in "advertise and not-connectable" mode (which is connected with problem described here: Raspberry Pi iBeacon connection timing out).

What I want to achieve is beacon device, which works in advertise mode and also allows to receive some events from other device (i.e. iPhone). When iPhone discovers Raspberry-pi beacon I want it to send some data to Raspberry-pi to trigger some action. I know that in the simplest way my iPhone should send data via network to raspberry while it enters to the beacon region, but unfortunatelly my solution has to work in offline mode, so I'm looking for some kind of direct (and possibly fast) connection. I think that PayPal beacon is a good example of my needs (as it is decribed here: https://devblog.paypal.com/how-does-paypal-beacon-work/ their device works as gate for communication user smartphone with PayPal services).

I'm complete beginner in BLE topics, so I would be grateful for any hints where I can start exploration or how to properly ask Google for any good answers in this topic.

like image 527
froger_mcs Avatar asked Oct 20 '22 09:10

froger_mcs


1 Answers

For complex interaction, you need to learn how to build a connectable Bluetooth service with BlueZ, which is the Linux open source Bluetooth stack. Once you have this service, you can write iOS code using CoreBluetooth to connect to this service when the beacon is nearby.

Unfortunately, I do not know of a good tutorial for building services on BlueZ. The BlueZ code is open source at least, so the code is a good place to start looking:

http://www.bluez.org/development/

like image 116
davidgyoung Avatar answered Oct 24 '22 01:10

davidgyoung