Beacons

Flare can use several different technologies for calculating the indoor location of devices. Beacons are the fastest and cheapest way to get started.

Beacons are tiny devices that transmit a signal over Bluetooth at regular intervals. A device can measure the signal strength of three or more beacons at known locations to determine its own location. The device can then send its location to the Flare server, which can then push the location to other things.

The Flare sample code for iOS uses Apple's iBeacon standard, while the sample code for Android uses Radius Networks' AltBeacon and Google's Eddystone standards. We recommend beacons from Radius Networks that are compatible with all three standards.

Placement

Environments have a coordinate space that extends across the entire plane of a single location, such as one floor of a building. Environments can be divided into zones, corresponding to rooms or sections of an open space.

Each zone should have beacons distributed as evenly as possible along a grid, starting with the far corners. For example, if you have four beacons you could place them in the corners only. If you have eight beacons, you could also put a beacon in the middle of each edge. If you have sixteen beacons, you could make a 4 x 4 pattern, etc.

Note that all beacons in an environment can be used to determine the user's position and which zone they are currently in, so beacons can be placed along the common edges of two zones.

Configuration

{
    "name": "Building",
    "data": {"uuid": "2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6"},
    "perimeter": {
        "origin": {"x": -1, "y": -1},
        "size": {"height": 12, "width": 12}
    },
    "zones": [
        {
            "data": {"major": 1},
            "name": "Open Space",
            "perimeter": {
                "origin": {"x": 0, "y": 0},
                "size": {"height": 10, "width": 10}
            },
            "things": [
                {
                    "data": {"minor": 1},
                    "name": "Northwest",
                    "position": {"x": 0, "y": 10}
                },
                {
                    "data": {"minor": 2},
                    "name": "Northeast",
                    "position": {"x": 10, "y": 10}
                },
                {
                    "data": {"minor": 3},
                    "name": "Southwest",
                    "position": {"x": 0, "y": 0}
                },
                {
                    "data": {"minor": 4},
                    "name": "Southeast",
                    "position": {"x": 10, "y": 0}
                }
            ]
        }
    ]
}

Beacons that use the iBeacon and AltBeacon protocols broadcast a signal that has three data values:

  • A UUID that must be known by the client to find the beacon (32 hexadecimal characters)
  • A major value (integer)
  • A minor value (integer)

These values can be configured with software from the manufacturer of the beacons. For example, here's a screenshot of RadBeacon from Radius Networks.

RadBeacon

In Flare, these values should be configured as follows:

  • Each environment has a UUID. The UUID should be the same for all beacons in the environemnt. It does not have to be unique from other environments.
  • Each zone has a major value. The major value should be the same for all beacons in the zone. It does not have to be unique for all zones in the environment.
  • Each thing that is a beacon has a minor value. The combination of major and minor value must be unique for all beacons in the environment.

The environments, zones and things in this example show a typical configuration. This will create a map that looks like this:

Beacons

Eddystone

Beacons that use the Eddystone protocol broadcast a signal that has two data values:

  • A namespace ID (20 hexadecimal characters)
  • An instance ID (12 digit number)

For Eddystone beacons to be compatible with Flare, these values should be configured as follows:

  • The namespace ID is a shortened version of the UUID, using either the first 8 and last 12 hexadecimal characters, or the first 10 and last 10. For example, if the UUID is 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6, then the namespace ID should be either 2F234454F4911BA9FFA6 or 2F234454CF911BA9FFA6.
  • The instance ID should be set to 0000 + major (padded with zeroes to four digits) + minor (also padded to four digits). For example, if the major is 4 and the minor is 1, then the instance ID should be 000000040001. If the major is 1234 and the minor is 5678, then the namespace ID should be 000012345678.

The RadBeacon app has a "Generate from UUID" button that will generate a namespace ID from the iBeacon UUID as described above.

If a beacon is set to use both AltBeacon and Eddystone, then the Android Beacon Library will detect it twice. However if is configured as described above, then the Flare library will only count it once when using it to determine the position of the device.

Creating environments

See the Environments page to learn how to set up environments, zones and things in Flare.

Location tutorial

See the Location tutorial to learn how to write an app for iOS or Android that uses beacons to determine the device's location and interacts with the Flare server.