Mesh networking

We’ve started our Mesh Network stack as a solution that used flooding protocols to communicate data over the network. That was just the beginning, though. We’ve upgraded our beacons to use a routed and addressable protocol, which means you can send specific pieces of data to specific beacons along specific paths. This gives you a much greater degree of control over the process, and has the serious upside of using much less power, since only a fraction of the devices in the network are involved.

Read on to see how you can set it up and use it to make managing your fleet of beacons more efficiently.

What’s ahead (a.k.a. Table of Contents)

Prerequisites

Getting set up

Update firmware

If you need to update the firmware on your beacons, a quick way to do it is to keep them close, and run Firmware Update using the Deployment app. Since we’ll be doing a bit of work with multiple beacons at a time, you might want to go ahead and grab that app. And if you don’t have an iOS device handy, don’t worry! We’ve made a tutorial on how to get the same functionality on Android.

Create a mesh

Setting up your devices for a mesh network takes just a few clicks in the Cloud interface.

Enabling mesh networking in Estimote Cloud

Select the beacons you want using the checkboxes to the left of the beacons’ list, then click “Create Mesh”. The only step now is connecting to the beacons, to ensure their newly-minted mesh settings are applied. You can use the Estimote app, and connect to each beacon individually, or the Deployment app, and have it update all the becons at once.

Now let’s move to a more interesting subject, i.e. setting unique values for individual beacons.

Place your beacons

On the physical world side, we need to make sure the beacons are able to communicate with each other. A safe distance is usually about 13-15 ft (4-5 m), but you definitely should experiment!

Let’s start by putting your Candy beacon at the end of your office (unless it’s really, really big—bear in mind the effective distance we’ve mentioned). Place Beetroot about halfway between Candy and your desk, and keep Lemon on hand.

Configuring meshed beacons

But, seeing that work in action would require you to walk around with an app set to detecting those regions, so for now, we’ll stick to changing the state of the GPIO port in the beacons. Our latest firmware ties the GPIO state with the beacon’s built-in LED. That means you’ll be easily able to see the changes you make (without moving a muscle), and you’ll be prepared to do things like the demo in our blog post.

Keep in mind: To change the state of the LED from the Cloud interface, you’ll need Location Beacons with firmware 4.13.1 or newer. To update your beacons to this firmware, you’ll need to use our Android SDK 1.0.10.

Go ahead and open our API documentation, prepare a POST request for your Candy beacon, then change its GPIO setting to High / Output.

Send the request (remember to authenticate yourself!) to https://cloud.estimote.com:433/v2/devices/0123456789101112131415 with its body formatted as follows:

{
    "identifier": :beacon_id,
    "pending_settings": {
        "gpio": {
            "config_0": 3,
            "port_data": 1,
            "interrupt_enabled": true,
            "gpio_0_state_led_indicator_enabled": true
        }
    }
}

This will turn the LED on. To turn it off, send a POST with the following data:

{
    "identifier": :beacon_id,
    "pending_settings": {
        "gpio": {
            "config_0": 3,
            "port_data": 0,
            "interrupt_enabled": true,
            "gpio_0_state_led_indicator_enabled": true
        }
    }
}

Then pick another beacon… and rinse and repeat.

To make things more interesting, use the Estimote app to connect to just one of the beacons, Lemon (no cheating, keep the Deployment app closed!). Let the updates sync, and voila! You’re now a proud owner of a routed, addressable mesh. I don’t have to tell you the possibilities that come with it — connect to just one device, and have unique changes propagate to any other device you specify.

If you’ve changed the LED state, take a look around—it shouldn’t take more than 30 seconds for all the meshed beacons to light up. If you’ve changed the iBeacon settings, you can use an app (like the one we’ve described here, or like the template we provide here) to check for the new regions.

Updating the settings

Modifying the settings works exactly the same way—change them as you would normally, then connect to just one of the beacons using either app. And you’re done!

In real-world conditions, you will likely want to use a setting such as iBeacon regions, to easily mark out individual areas of a location. You can follow our ranging tutorial to prototype an app.

You may be wondering what happens to the pending settings that are created when you update a beacon through the Cloud interface or the API. Naturally, they should be removed once applied. We have that covered, too. Our mobile SDKs (both Android and iOS) include a mechanism we call mesh confirmer, which continuously checks if the beacons have the latest version of the settings applied over mesh—if they do, the pending settings get removed. What does it mean in practice? Make sure that you initialize ESTMeshManager in your app, then walk by the beacons with your phone. Reload the Cloud dashboard and watch the “Pending settings” message disappear.

We do believe it’s best to make complex technology transparent, and we really think we succeeded here. In effect, once you set up your mesh, you can make changes to your network with just a few seconds’ worth of work, and without having to find each individual beacon. The quickness and convenience is hard to beat.