If I want to implement the beacon and send message to Bluetooth devices, should I need
- a raspberry pi + beacon devices
- a raspberry pi
which one is right? I have found some people use raspberry pi and small beacon devices, others only use raspberry pi itself to send messages, both of them can send URL or data, and I want to know raspberry pi's character in this implementation.
thanks!!
A Bluetooth BLE device can advertise its services and as part of the advertisement can contain up to 28 bytes of advertising data. There is no format for that data defined in the Bluetooth specification and so it is up to the manufacturer to define so that both ends of Bluetooth signal understand it. This is advertising data is how beacons have been created and companies have defined the structure used by them. Examples of this are the iBeacon and Eddystone formats.
This tweet gives a good summary of the structure of the data used by the popular/common formats: https://twitter.com/josryke/status/763006284052463617
On a Raspberry Pi the Bluetooth stack is BlueZ and it has API's that allow you to create the required advertisement from your favourite programming language: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt
There are also couple of command line tools that will allow you to create the beacons by hand.
Transcript of using
bluetoothctl
to create an Eddystone URL beacon:Or the same advertisement using the
btmgmt
tool:An example of iBeacon using the
btmgmt
tool: