I have a laptop with Bluetooth 4.0, or Bluetooth Low Energy if you will.
For testing purposes I'd like to turn this Windows 8 laptop into broadcasting a fake iBeacon UUID/MajorID/MinorID so I can test an App I wrote.
Is there any software available with which I can broadcast beacons? Or any API's or libraries with which I could (easily) write it myself?
Like this, but then for Windows: https://github.com/timd/MactsAsBeacon
An actual iBeacon is on its way here, but I'd love to already do some testing in the meanwhile.
So, it is possible, but you need a Linux VM inside Windows 8. Here's a small guide.
Step 1: VirtualBox
Step 2: Linux
Run:
sudo apt-get install bluez
sudo hciconfig hci0 up
sudo hciconfig hci0 leadv 3
sudo hciconfig hci0 noscan
hciconfig
The last command should show UP RUNNING
before you continue.
If you can't find the hci0
device, you probably have incorrect VM usb filter settings, or your device is in use by Windows. I found that disabling and enabling the device in the Windows Device Manager helped the VM recognize it. When you enabled sharing the bluetooth device from VirtualBox, the Device Manager should show a greyed-out bluetooth adapter when you've selected 'Shown hidden devices'.
Step 3: Assemble your broadcast command
python -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)'
hcitool -i hci0 cmd 0x08 0x0008
1E 02 01 1A 1A FF
(iBeacon-specific flags)4C 00
is Apple02 15
(iBeacon advertisement indicator)00 00
00 00
C8 00
, or short: C8
Your command should look something like this, replace the __
with your UUID:
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ 00 00 00 00 C8
Step 4: Start broadcasting!
Example command:
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 63 6F 3F 8F 64 91 4B EE 95 F7 D8 CC 64 A8 63 B5 00 00 00 00 C8
If that command was succesful, it should keep transmitting. Grab your Android or iPhone device and install the iBeacon locate app to see if you can find your beacon broadcasted.
Happy app debugging!
Credits: a lot of the idea's were stolen from this article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With