Turn Windows laptop into iBeacon
I have a laptop with Bluetooth 4.0 or Bluetooth Low Energy, if you will.
For testing purposes, I would like to turn this Windows 8 laptop into a broadcast of a fake iBeacon UUID / MajorID / MinorID so that I can test the application I wrote.
Is there any software with which I can broadcast beacons? Or any API or libraries that I could (easily) write it myself with?
Similar to this but then for Windows: https://github.com/timd/MactsAsBeacon
The actual iBeacon is already here, but I would love to do some tests at this time.
source to share
So it is possible, but you need a Linux virtual machine on Windows 8. Here's a quick reference.
Step 1: VirtualBox
- Install VirtualBox and VirtualBox Extention Pack, make sure they are the same version.
- Create a new Ubuntu Linux VM, install the ubuntu installation CD and install the OS. I used the server version as the GUI would be redundant and slow down everything.
- Make sure the USB 2.0 controller is enabled in the virtual machine settings and you've created a filter for your bluetooth device.
- Then start your virtual machine and in the VM running window, enable Bluetooth device sharing: Menu Devices> USB Devices> select Bluetooth device.
Step 2: Linux
sudo apt-get install bluez sudo hciconfig hci0 up sudo hciconfig hci0 leadv 3 sudo hciconfig hci0 noscan hciconfig
The last command must show
If you cannot find your device
, you probably have incorrect USB usb filter settings or your device is being used by Windows. I found that disabling and enabling the device in Windows Device Manager helped the VM to recognize it. When you have enabled Bluetooth device sharing from VirtualBox, the device manager should show the gray-out bluetooth adapter when you selected "Show hidden devices".
Step 3: Assemble the broadcast team
- Create UUID:
python -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)'
- The command format will be:
hcitool -i hci0 cmd 0x08 0x0008
1E 02 01 1A 1A FF
(flags specific to iBeacon)
- Company ID
(iBeacon ad indicator)
- UUID: 16 pairs of two hexadecimal numbers separated by spaces
- Main identifier:
- Minor ID:
- Calibrated Tx Power:
Your command should look something like this, replace
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!
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 this command was successful, it should continue to transmit. Take your Android device or iPhone and install the iBeacon finder app to see if you can find its beacon.
Happy debugging applications!
Credits: Most of the idea was stolen from this article .
source to share
Unfortunately, Windows 8 cannot broadcast BLE as a beacon. Although Windows 8.1 has BLE APIs, they can only be used to communicate with standard Bluetooth profile devices after pairing. Only the operating system can scan and pair. This prevents third-party applications from scanning beacons or transmitting beacons. We hope Windows 9 will change this situation.
An alternative to Windows is to install virtual machine software like VirtualBox and use a Linux virtual machine for transfer. There is a free example here: http://developer.radiusnetworks.com/altbeacon/virtual
Please note that this example transfers the intellectual property to the free AltBeacon advertising. But it is trivial to modify the altbeacon_transmit virtual machine script to transmit any other beacon format. You can see the transmitter script source code here: https://github.com/RadiusNetworks/altbeacon-reference/blob/master/altbeacon_transmit
source to share