12

I follow this sample project BeaconEmitter under OSX to generate samples iBeacons for develop an application on iPhone. BeaconEmitter application is based on the tutorial from Matthew Robinson, and until Apple decide to introduce iBeacon support on Core Location for OSX, the only chance to generate a iBeacon is to build the advertisement packet from scratch with IO Bluetooth Framework.

BUT...that doesn't work!

I tried of course also the AirLocate tutorial code from Apple on iOS, and yes between to iOS devices that work fine. But if you try to generate an iBeacon with OSX (BeaconEmitter) and receive it with iOS device (AirLocate) that doesn't work.

I have a BLE RF Sniffer based on CC2540 TI chip, and with TI sniffer software on Windows. So I observe that the iBeacons packet generate from AirLocate and from BeaconEmitter was a little bit different.

That is iBeacon generated with AirLocate: enter image description here

Thah is ibeacon generated with BeaconEmitter: enter image description here

Following the reverse engineer made in this post (because Apple have not released iBeacons Specifications yet), is possible to see that Adv PDU Header is different from two cases. In OSX the Type = 2 and TxAdd = 0, in iOS the Type = 0 and TxAdd = 1.

Why this difference ?

In witch way is possible to force the OSX to send the same Adv PDU Header of iOS ?

Seems that also in the first 5 bytes of the AdvData the two packets aren't equals:

OSX: 02 01 06 1A FF

iOS: 02 01 1A 1A FF

The rest of AdvData payload is according with the reverse engineer post linked above.

Again, why this bytes are different ?

I not found from what part of code in the OSX sample this depend on.

UPDATE: IT WORKS

The major reason because the iBeacon generated from BeaconEmitter was not recognized by AirLocate is a my fault. I not understood that AirLocate filters some specific example of UUID i.e.: E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 or 5A4BCFCE-174E-4BAC-A814-092E77F6B7E5 or 74278BDA-B644-4520-8F0C-720EAF059935 not every UUID value.

So the random UUID generated from BeaconEmitter for sure not match with pre-written UUID in AirLocate.

If you can "force" the UUID from BeaconEmitter with a good value, the AirLocate can recognize it:

BeaconEmitter

So this is the successful test in iOS AirLocate sample app:

AirLocate

Remains the differences of the same bytes described above... that only the sniffer can see :).

Community
  • 1
  • 1
megabri
  • 881
  • 8
  • 11
  • are you shure your mac has Bluetooth 4? Which modell it is? – thorb65 Jan 06 '14 at 14:35
  • Yes I'm sure, I have the Mac Book Pro Retina. In any case the RF sniffing talk clear. – megabri Jan 06 '14 at 15:04
  • sorry, so i have no idea whats going wrong but i know that the "06" and "1A" are the binary value of used bluetooth flags and in other iBeacon scenarios its allways set to "1A". i only could mention to use a raspberry pi instead of imac. setup is very easy and it works well as iBeacon :-) – thorb65 Jan 06 '14 at 15:16
  • I am surprised the advertising header is causing you problems. Can you please post: (1) The exact iOS version of the device that fails to detect it. (2) The exact Mavericks version that you are using for transmission. Also, can you confirm you are using the built-in bluetooth adapter on your Macbook and not a USB add-on? – davidgyoung Jan 06 '14 at 16:20
  • Sure, mobile is an iPhone 5S with iOS 7.0.4 an mac is OSX 10.9.1 and I'm using built-in bluetooth on the macbook. @thorb I'm 100% sure that the correct iBeacon scenario is with AirLocate with iOS device, with that app, also an Android HTC One with [link](https://play.google.com/store/apps/details?id=com.mobisfera.prod.ibeaconfinder) iBeacon Finder is able to recognize the iBeacon generated from iOS. – megabri Jan 06 '14 at 20:53

1 Answers1

0

It seems you say about the id of bluetooth link between 2 concrete devices. It is not random because it always the same for each pair of devices.

It will be different for different pairs of devices.

Anyways if you have some troubles with beacons you can use core bluetooth which is more complex but it is also enough old and is supported by a greater range of devices and OS

Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49