raspberry pi ibeacon ble
raspberry pi, tutorial

How turn your raspberry pi into an iBeacon in 2 minutes

0
2 Flares Twitter 0 Facebook 0 Google+ 2 Pin It Share 0 Filament.io 2 Flares ×

 

as usual, apple talks about ibeacon and suddenly the world think they ve invented something…. apple don t invent since ages, they copy and sew, just don t you forget.

nvm here is a quick tutorial that will explain you how emulate an ibeacon with your pie for test purposes, always handy

all you need:

a raspberry pi (oh wait!=

A bluetooth 4.0 usb dongle

fingers for type

here we go,

first make sure your pi is online with a good ping via term

then install packages:

sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev

download an install BlueZ

$ sudo wget www.kernel.org/pub/linux/bluetooth/bluez-5.8.tar.xz
$ sudo unxz bluez-5.8.tar.xz
$ sudo tar xvf bluez-5.8.tar
$ cd bluez-5.8
$ sudo ./configure --disable-systemd
$ sudo make
$ sudo make install

Now configure your dongle:
$ hciconfig

output should be close to:
hci0:   Type: BR/EDR  Bus: USB
         BD Address: 00:01:0A:39:D4:06  ACL MTU: 1021:8  SCO MTU: 64:1
         DOWN
         RX bytes:1000 acl:0 sco:0 events:47 errors:0
         TX bytes:1072 acl:0 sco:0 commands:47 errors:0

as you can see, the status is down by default, so you have to bring it up

$ sudo hciconfig hci0 up

now you should get:
$ hciconfig
hci0:   Type: BR/EDR  Bus: USB
         BD Address: 00:02:72:3F:4D:60  ACL MTU: 1021:8  SCO MTU: 64:1
         UP RUNNING
         RX bytes:1000 acl:0 sco:0 events:47 errors:0
         TX bytes:1072 acl:0 sco:0 commands:47 errors:0

now you have to configure data send by the beacon:
$ sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00

and enable it:

sudo hciconfig hci0 leadv 0


now install on your mobile (if it handle bt 4.0) ibeacon ot something else and you ll see that it works :)
here is the result with my htc one:






About the author / 

nocomp

ble bluetooth low energy dongle ibeacon raspberry raspberry pi usb

Leave a reply

Your email address will not be published. Required fields are marked *