📜 ⬆️ ⬇️

Turn Raspberry Pi 3 into Eddystone URL beacon



Mini PC Raspberry Pi 3 was released quite recently, and very shortly after the appearance of the system on the market based on it began to create interesting projects. One of them, very specific - is the transformation of the "raspberry" in the Eddystone URL beacon.

Eddystone is Google’s own open source beacon format (the specification is here ), and this technology is compatible with both Android OS and iOS. In order for this to work, you need to keep Bluetooth LE permanently on your smartphone - this is probably the only condition. All that is required to turn an RPI 3 into an Eddystone URL beacon is the mini PC itself, the power supply for it and the SD card. The rest is under the cut.

So, a little more about Eddystone. Its advantage is the ability to send three packets instead of one. This is a UID, URL, telemetry.


')
The phone that receives these packets can either warn you of the receipt of information of a particular type, or perform some kind of action.

Setting "raspberry"

1. Download Raspbian ;
2. Install the image ;
3. We are looking for an IP “raspberry”. This can be done using the " Raspberry Pi Finder " or nmap.

$ sudo nmap -sP 192.168.2.0/24
or
$ arp -a | grep "b8: 27"

4. Connect to Raspberry:

$ ssh pi @ <the_ip_of_your_pi>

5. We are looking for information on the hciconfig command

$ hciconfig -h

6. Turn on the Bluetooth device

pi @ raspberrypi: ~ $ sudo hciconfig hci0 up

7. Set the mode "advertise and not-connectable"

pi @ raspberrypi: ~ $ sudo hciconfig hci0 leadv 3

8. Enter data for Beacon

pi @ raspberrypi: ~ $ sudo hcitool -i hci0 cmd 0x08 0x0008 17 02 01 06 03 03 aa fe 0f 16 aa fe 10 00 02 77 65 62 67 61 7a 65 72 08 00 00 00 00 00 00 00 00

We broadcast:

OptionDescription
0x08#OGF = Operation Group Field = Bluetooth Command Group = 0x08
0x0008#OCF = Operation Command Field = HCI_LE_Set_Advertising_Data = 0x0008
17Length The hexadecimal 17 converts to 23 decimal which is the number of bytes that follow
02Length
01Flags data type value
06Flags data
03Length
03Complete list of 16-bit Service UUIDs data type value
aa16-bit Eddystone UUID
fe16-bit Eddystone UUID
0fLength The hexadecimal 0f converts to 15 decimal which is the number of bytes that follow
sixteenService Data data type value
aa16-bit Eddystone UUID
fe16-bit Eddystone UUID
tenFrame Type = URL
00TX Power (this should be calibrated)
02Scheme URL (http: // = 0x02)
77'w' in hexadecimal
65'e' in hexadecimal
62'b' in hexadecimal
67'g' in hexadecimal
61'a' in hexadecimal
7a'z' in hexadecimal
65'e' in hexadecimal
72'r' in hexadecimal
08.org (.org = 0x08)
00
00
00
00
00
00
00
00


The example above allows you to send the blog address of the author of the idea for Eddystone and Malinka. If you need to send your URL, change it here .

To detect the Raspberry Pi beacon from iPhone, use the following video tutorial:



Android should do everything automatically, provided that Android OS 4.3.2 or newer is available, bluetooth enabled, geologic, and permission to determine the location for Chrome. You can also use the web application to make it all work immediately and without problems.

The page of the author of the project .

Source: https://habr.com/ru/post/392379/


All Articles