Adding Beacons to Google’s Beacon Dashboard with the Proximity API

Before Starting

Make sure you have configured your beacon using the Eddystone Protocol, with a Namespace and an Instance. You can learn about naming beacons in the blog here: https://revolution11blog.com/2019/05/01/beacon-naming-standards/

Your beacon manufacturer should have provided instructions about setting up your beacon.  Here are some sample instructions we have written about configuring Minew Beacons: https://revolution11blog.com/2019/04/30/basic-configuration-of-minew-beacons/

You will also want to make sure and get the Latitude and Longitude of the location where you will be placing the beacon.

Determining Your Latitude and Longitude

Open up Google maps and find your current location. Right click on the location on the map and choose “What’s Here?” You will get a popup containing the latitude and longitude, go ahead and make note of them.

Determine the PlaceID

Google’s PlaceID is used with the Places API. 

Go to https://developers.google.com/places/place-id and find your location. Make note of the PlaceID.

Enabling the Proximity API

  1.  Go to https://console.developers.google.com/apis/library/proximitybeacon.googleapis.com and log in as the root user.
  2. Select the Project you would like to use with the Proximity API.
  3. Press “Enable”.

Create Credentials

  1.  Once the API Setup is complete you will land on the Manage API page. You’ll see we need to create credentials.  Click on credentials in the bar to the left.

2.  On the credentials home page, we’ll start by configuring the consent screen that pops up when this API is called. Press the Configure Consent Screen button.

3.  We’re going to do a minimum configuration to get us going. We’ll name our app Beacon App and upload an icon for it to use for the application logo.

4.  Scroll down and press “Save”.

5.  On the next screen click on create credentials and choose OAuth client ID.

6.  Select Web Application and press “Create”.

7.  Name the credentials and paste the URL for google’s OAuth Playground (https://developers.google.com/oauthplayground/) in the Authorized redirect URLs field. This allows us to test adding beacons to the beacon dashboard. Press “Create”.

8.  You should get a pop-up with the Client ID and Secret we will be using in the OAuth Playground. Copy the Client ID then click “OK”.

Testing the Proximity API with the OAuth Playground

  1. Open Google’s OAuth Playground in a new browser window with this URL: ​developers.google.com/oauthplayground

2.  Click the gear icon in the top right corner and:
● Change “OAuth flow” to “Client-side”.
● Check the “Use your own OAuth credentials” checkbox.
● Paste the client ID you generated in the previous step, click on close.

3.  Then, on the left side, in the “Input your own scopes” text field, type:

https://www.googleapis.com/auth/userlocation.beacon.registry and press the authorize APIs button.

4.  You will be asked to sign in.

5.  You will be asked to give permission to view and modify the beacons. Click on “Allow.”

6.  You will be asked to confirm your choices. Press “Allow.” 

Creating an AdvertisingID

  1.  Now we need to create an AdvertisingID to use with the Proximity API. This is made with a packing function using the Namespace and Instance that the beacon is using.  There are a lot of ways to do this within an app, but since we are in the Google OAuth playground, and we are working with a Mac, we are going to do this really quickly in ruby with the terminal app. Open the terminal app from apps/utilities and fire up the ruby application by typing irb and then hit return.

2.  Type in the following using your Namespace and Instance in the terminal and hit return.

require ‘base64’
namespace = ‘YourNameSpaceHere’
instance = ‘YourInstanceHere
puts Base64.strict_encode64([namespace + instance].pack(‘H*’))

This will generate the AdvertisingID as shown below:

Registering the Beacon

  1. Now return to the OAuth playground.

2.  Below is an example you can paste in, replace the example data with your own.

  • The advertisingID you generated in the terminal
  • The place ID you copied earlier
  • The latitude and longitude you collected earlier
  • The Places API supports floors for indoor mapping so we are going to set the name of the indoor level to 1 in our example
  • You can add a description of the beacon here
  • And in the properties, you can add any key value pairs you wish, we are starting with the key of position and the value of entryway.

Once the request URI text is entered press “Close”

3.  Hit “Send the Request”.

4.  You should see a successful post message.

View the Beacon on Google’s Beacon Dashboard

  1.  Go to https://developers.google.com/beacons/dashboard/  Since this is the first time you have used the beacon dashboard, you will get a pop-up message. Press “Start”.

2.  Another pop-up will appear asking for permission to use your account, click on “Allow”.

3.  Choose the project you are using with the Proximity API.

4.  You should land on summary page of the beacons connected to that project.  Congratulations, you have successfully setup the proximity API! The developer you set up in the last blog should now be able to work with the API.

Adding Beacons to Google’s Beacon Dashboard with the Proximity API

Setting Up an Organization & Creating a Developer Account

Important Note Before Starting:
• Make sure your organization has a Domain
• Make sure that you have access to your Domain’s Control Panel

This is a process that generally will take place over the course of two days. Setting up an Organization requires Google to verify your ownership of the domain, a process that you will want to leave several hours for, or have going overnight.

Creating the Organization

  1. Make sure you are signed onto the Google Cloud console. Click on “Identity & Organization” in the left menu bar. You will receive a pop-up giving you an overview of the identity setup process, review, then press “Sign Up”.

2.  The next screen tells you a little about the cloud identity service, click “Next”.

3.  The next screen asks for your business name and size, fill those in and press the “Next” button.

4.  You will be asked where your business is located, pick a location from the dropdown and press “Next”.

5.  Enter Your email address and press “Next”.

6.  You will be asked for your business’s domain name, enter it and press “Next”.

7.  You will be asked to confirm the domain you are using to set up with Google cloud. Hit “Next”.

8.  You’ll be asked for your first and last name, enter them and press “Next”.

9.  Provide the email address and password you will be using to manage identities and press “Next”.

10.  On the next screen, select “I’m not a robot.”

11.  A verification screen will popup. Select the correct images that match the word or phrase in the top of the pop-up and click “Verify”.

12.  When the pop-up closes press on the “Agree and Create Account” button.

13.  You should see the screen below when your account has been successfully created. Press “Go To Setup”.

Verifying Domain Ownership

1. The next step is to verify your domain ownership. You’ll want to be logged into the control panel of your domain in another tab or window. Press “Start”.

2. We are already logged into our domain’s host website, so we are going click Yes in the first checkbox.

3. You will be asked to open the control panel on the website where you manage your domain. We have already done so, click on the checkbox “I have opened the Control Panel for my Domain”.

4.  On the next screen you will see two pieces of information we will need to add our domain.  The name (also known as the host or alias) and the value (also known as the answer or destination).

5.  Go to your domain panel and find the area where you add new DNS records. The interface for doing so will vary depending on the website where you manage your domain. Make sure the type of record you are adding is TXT and enter the two values provided by Google, the host record and the TXT Value. In this case we are going to press the “add record” for this service provider’s control panel.

6.  You should receive a confirmation.

7.  Return to the cloud setup pop-up, and click on “I added the TXT Verification record.”  We also saved the record, so click on the “I saved the TXT verification record” checkbox as well.

8.  Press the “Verify Domain” button.

9.  You should see a screen like this while your domain is verifying:

10.  And more likely than not, you will see a message like this after about an hour. It usually takes more than an hour for the change you made at the website where your domain is managed to propagate across the internet. Come back in a few hours or the next day and hit the retry button.

11.  You will see the same set of checkboxes that you saw before. We have already completed this so click on “Verify Domain.”

12.  You should see a screen like this once you have verified the domain. OK, let’s now set up our developer. Press the “Create Users.” 

Creating a Developer Account

1. On the create user pop-up, give the user a first name, last name and a user name. Press “Add”.

2. On the next screen enter the email address for notifying the developer of the account.

3. Scroll down, type in a message for the developer and press “Send Emails.”

4.  That’s it for adding an account. Now let’s create a project for our developer to use.  Press “Continue to Cloud Console.” 

Adding a Project

1. Agree to the terms of service by checking the box, then press “Agree and Continue.”

2. You’ll land back on the IAM & Admin homescreen. There are a few more things we should set up, like billing accounts and other roles, but we’ll tackle that later on. Let’s create our project. Click on “Google Cloud Platform” in the upper left — this is how you navigate to the homescreen of Google Cloud.

3. You’ll see that the homepage is not viewable for organizations; you will need to select or create a project in order to view the console homepage. In our case, we don’t have any projects, so we will press the Create button.

4. Give the project a name, and press “Create.”

5. Once your project is created, you will land on the project home page. Let’s now give our developer access to this project.

Project Access

  1.  If the navigation bar to the left is not exposed click on the icon in the upper left hand corner to expose it and choose IAM & Admin.

2. On the top of the IAM screen, click “Add.”

3.  We will be using the Proximity API for our project, so we will give our developer BeaconEditor rights.

4.  Type in the developer account we will use and click on the roles dropdown, find the Proximity Beacon Set of roles and choose it. Pick “Beacon Editor”.

5.  Press “Save.”

6.  You should see that the developer was added to the project.

Checking Developer Access

  1.  Now, let’s make sure the developer can log onto the project. They should have reeived an email that looks like the one below. Have the developer click on the “Sign In” link in the email.

2. When the developer signs in, they will be asked for the temporary password that was provided in the email. Enter it and press “Next.”

3. The developer will be asked to accept the terms of service for the account. Press “Accept.”

4. The developer will be asked to create a new password, and then confirm it. Then press “Change Password.”

5.  The developer will be asked to agree to the terms of service for Google Cloud Platform and it’s APIs. Click on the corresponding checkbox, and press “Agree and Continue.”

6.  From the developer’s home screen the project can be selected at the top of the screen. This will bring up a pop-up of project, have the developer click on the BeaconProject.

7.  This will bring the developer to the project homepage. We’ll explore setting up the proximity API and working with it in the next blog in this series.

Setting Up an Organization & Creating a Developer Account

Setting Up A Google Cloud Account

Before you set up your Google Cloud Account you will need:

  1. A Google Account, which will be the owner of the account.
  2. A credit card. Google gives you a $300 credit you can use for the first year. 

Go to https://cloud.google.com and press the “Get Started For Free” button in the upper right corner.

You will be asked to sign in with your Google account. Sign in then press “Next”.

Enter your password and click “Next”.

Fill in the account recovery details on the next screen, review and press “Done”.

Agree to the various terms of service by clicking the checkboxes and press “Agree and Continue”. 

Confirm or add your address and add your credit card information on the next screen and press “Start My Free Trial”. 

You should now see a success message and now you are ready to work with Google Cloud!

Be sure to check out the next blog in this series “Setting Up an Organization & Creating a Developer Account”.

Setting Up A Google Cloud Account

Setting Up A MySQL Database on Bluehost

Why MySQL for IoT Data?

MySQL is one of the most used databases on the web. Many organizations have pre-existing resources, such as shopping carts and order tables, which already exist in MySQL Databases. 

In this blog you will learn how to set up a MySQL database to accept input from a serverless function so clicks are captured from IoT buttons. These IoT buttons can be configured in countless ways and perform actions like re-ordering physical stock or sending notifications. Check out our IoT Button Roundup Blog for some ideas on how these buttons can make your life a little easier!

Creating the Database
1. Sign on to your Bluehost* account and click on the advanced tab, then click on MySQL Databases.
*Wordpress sites on top of a MySQL Database, so if you have a WordPress site, or external web hosting, you probably  have access to a MySQL database. The screen example below may vary for different hosting providers.

2.  Under the create new Database Heading, type in the name of the database and then click on the Create Database.

3.  You should get a success message, then click on the Go Back link.

4.  This will take us back to the databases homepage, scroll down and you will see the new database has been added to the list.

5.  Scroll down to create a user for this database. Type in a username, a password, and confirm the password. Then click on the Create User.

6.  You will receive a success message, then click on Go Back.

7.  Now we are going to add this user to our database. Scroll down and under “Add User to Database” select the user you just created, and then select the database and click Add.

8.  Select All Privileges to make this a full access user.

9.  Next we are going to make a user just for our IoT button. Scroll down to Add New User, enter a username, a password and confirm the password, and then click on create user. Add this user to the database just like you did the full access user.

10.  We don’t need to give our IoT button user full access, so just use the permissions here. Click on Make Changes and then Go Back.

11.  Make note of you both your full access and button user’s name and password as well as the name of the database as you will need these later. You will also need the name of the database host. To find this, click on Domains in the menu bar to the left.

12.  Before we  can work with our database on our local computer, we need to record our computer’s IP address in a table on the service provider’s site so that we can access the MySQL Database. First let’s get our IP address. Simply go to Google and type in “What’s my IP?”

13.  Next you will add your IP address to the white list on Bluehost so you can work with the database from your computer. Click on Advanced on the menu bar to the left and choose Remote MySQL.

14.  Add the IP address to the host field —  it’s a good idea to add the name of your computer or service in the comment field. Click on Add Host.

Working with the Database
1.  For this example we will be using DBeaver, a cross platform application that works with most SQL databases via SQL Statements, or a GUI interface. You can download the application from https://dbeaver.io.

2.  Once the app is installed, open it and you will be prompted to select a database, choose MySQL.

3.  Enter the following details necessary to connect to the hosted MySQL Database. 

Hostname – yourhostname.com

  • Port – 3306
  • Database – yourdatabasename
  • Username – fullaccessuser
  • Password – fullaccesspassword

Press the Test Connection button

4.  Since we have not connected to a MySQL database yet, we will be prompted to download a driver for the database, click on the download button in the lower left hand corner.

5.  Press the Test Connection button again, and you should be able to successfully connect to your database.

6.  A popup will appear asking if you want to create a sample database. Since we have already created a database, click No.

7.  A ‘Tip of the day’ will show up every time you start the app unless you deselect the “Show tips on startup” checkbox. Close the window to start working with your database.

8.  Click on the connection to your hosted MySQL Instance in the panel to the left and open up the disclosure triangle so we can see the MySQL Directory.

9.  Open up the disclosure triangle for the databases and you will see the database we created earlier.

10.  Next we will create the table and columns needed to capture data from an IoT Button. Select the database, Right Click, select create and then choose Table.

11.  Click on the Properties Tab and name the table.

12.  Now let’s create the columns. Select the database, Right Click, select create and then Column.

13.  The Properties popup will first appear. Name the column  ID, and give it a data type of INT, it will not be null and will auto increment. Press OK.

14.  Right Click to create another column, we are naming this one buttonJSON, with a data type of TEXT.  Click OK.

15.  Next we will create the Primary Key. Right Click on Constraints and choose Create Constraint.

16.  Click on the checkbox next to “id” and press OK.  Choose save from the file menu, or Command S to save the changes to your database.

17.   You should get a confirmation popup, click on Persist to make these changes in the hosted database.

18.  If you get an error message, you may have disconnected from the database while setting up these changes. Right Click on the MySQL Instance and choose Invalidate/Reconnect to establish a new connection and try saving the changes again.

Allow Access For Serverless Apps IP

The last step in getting IoT data into our MySQL Database is to allow the IP address of the serverless app sending the button data access to the database at your service provider.  For Bluehost, click on advanced in the menu bar and choose Remote MySQL and add the IP address for the serverless app just like you added the IP address for your computer.  


Check out the Revolution11 blog on configuring your AWS Virtual Private Cloud (VPC), so that your serverless app has an IP address.

Congratulations, you you are now ready to use your server less app with a hosted MySQL Database!

Setting Up A MySQL Database on Bluehost

Configuring a Virtual Private Cloud (VPC)

What You Will Learn in This Blog
Configure your Amazon Web Services (AWS) Virtual Private Cloud (VPC) so the serverless apps you are running within your VPC have a public IP address. This  means you can use your serverless apps with external SQL Databases.

What is a Virtual Private Cloud?
A space where Amazon resources such as databases, serverless applications, storage, and other useful tools reside as a part of a virtual network. 

What are Subnets?
Subnets are segments of a network, broken down by IP address ranges. Various AWS resources are assigned to the IP addresses within the ranges.

What are Route Tables?
Route tables are  a set of rules that determines how traffic is routed on a network.

What is a Network Address Translation (NAT) Gateway?
A NAT Gateway routes internal traffic to a public IP address. This is important because we want to use the NAT Gateway to associate our serverless functions with a public IP address — we can then use our serverless apps with a MySQL database that is not hosted with AWS.

Configuring Your Subnets
1.  Log into the AWS Console as a Root User and search for the VPC service. 

2.  On the left menu select Subnets.

3.  You will see the list of subnets that are already set up.

4.  It’s important to label the subnets to make them easier to identify as we work with them. Let’s label the subnet where the last two sections are zero as ‘public.’

5.   Locate the Name field and click on the pencil icon to edit the field. Type in ‘public’ and confirm the change by clicking the checkbox in the right corner below the edit box.

6.   The name ‘public’ now appears in the list. Amazon suggests that your Lambdas use two subnets.  Repeat the labeling process for two more of the subnets, changing the name fields to Lambda Private 1 & Lamba Private 2.

7.  Your subnet list should look like this:

Setting Up Route Tables
8.  Next, click on route tables on the left menu.

9.  You will see an existing route table here.

10.   We will now create a couple of new route tables. Click on the Create Route Table in the upper left.

11.  For the first name route table, we are going to use the name Public Subnet, and we are going to select our existing VPC from the dropdown. Press the create button.

12.  You will land on this success screen once the route table is created. Press the close button to return to the list of route tables.

13.  You can see the new Route Table back in our list of route tables.

14.  We are going to repeat this process for our second route table, but we are going to name this one Private Lambda.

Associating Subnets with Route Tables
15. Now we are going to set up the Public Subnet, click on it and then select the subnet associations tab.

16. Press Edit Subnet Associations.

17.  You will see the four subnets we have, this is where those labels come in handy.

18.  We are selecting the public subnet for the public route table. Click on it and press Save.

19.  We are then returned to the route table home, and we can now see the association with our public subnet.

20.  Next, Let’s set up the Private Lambda Route Table, click on that and select the subnet associations tab, then press the Subnet Associations Button.

21.  Amazon recommends two subnets for Lambdas so we are selecting the 2 Lambdas we labeled just for that. Then Press Save the in the lower right hand corner.

22.  You can see that two subnets are now associated with the Private Lambda Route Table when we return to the list of route tables.

Setting Up The Public Route Table
23.  Select the Public Route and press the Edit routes button.

24.  This will bring you to the list of routes. We are going to add a public route. Click on the add route button on the left.

25.  For the destination, we are going to manually add the public route which is represented by 0.0.0.0/0.  For the target we are going to choose our existing internet gateway.

26.  You will get a success message. Press Close.

Setting Up a NAT Gateway
27.  Now we are going to set up a NAT Gateway to provide an external IP address for our Lambda. Click on Nat Gateways on the left menu.

28.  We don’t have any NAT gateways set up yet so we are going to create one. Press the Create NAT Gateway button in the upper left.

29.  For the subnet, pick the public subnet from the list. We are going to create a new elastic IP address by clicking on the Create New EIP Button. Then we are going to press the Create a NAT Gateway button in the lower right hand side of the screen.

30.  You should get this success message, click on the close button in the lower right to return to the list of NAT Gateways.

Associating Private Route Table with the Nat Gateway
31.  We now need to associate our Private Route Table with this NAT Gateway so our Lambdas can use the external IP address we just created. Click on Route Tables on the menu bar to the left.

32.  Select the Private Lambda Route, then press the Routes tab and choose the Edit routes button.

33.  Add the public route destination, 0.0.0.0/0 and then choose the NAT gateway we just created as the target. Press the save route button in the lower right hand corner.

Giving your Lambda Role Permission to Use the VPC
34.  Now we are going to give our Lambda role permission to use this VPC. Return to the console home page and find and click on IAM.

35.  On the IAM Home Screen choose Roles from the menu to the left.

36.  You will land on the Roles home page, scroll down to see the existing roles.

37. Scroll down to the list of existing roles and click on the Lambda you are interested in.

38.  You’ll see our Lambda has basic permissions to execute. We want to let it use VPC, so click on the Attach Policies Button.

39.  Search for VPC and select “AmazaonVPCFullAccess” and press the “Attach Policy” button in the lower right hand side of the Screen.

40.  When we return to this roles’ detail screen we can see the VPC policy is attached.

Configuring Your Lambda to Use the VPC
41.  Go to the AWS consul homepage to edit the Lambda application to use the VPC. For this example, we are using a serverless app that inserts the results of an IoT button click into a SQL database. We are using our default VPC, our 2 private subnets for the Lambda, and the default security settings. Press the save button in the upper right hand corner.

42.  Now test the Lambda, you can see how to set up these test events by watching this video, which covers installation of this serverless app on this channel. Congratulations! Success.

Configuring a Virtual Private Cloud (VPC)

IoT Button Roundup


What is an IoT Button?

An IoT button is a piece of hardware that sends data to the cloud when you press a button; a serverless application then takes an action or series of actions based on the information that is sent when the button is clicked.

What Can I do with an IoT Button?

Your serverless app can run a simple 1-task function, such as:

  • Send an email  
  • Send an SMS  

AWS’s One Click and IoT Button apps make it painless to set up serverless apps that perform seamlessly in the cloud

Create Serverless App Workflows

Your serverless app runs on a series of functions, which creates a workflow  

Common Example Workflow

Imagine that you are a representative for a wine distribution company

One of your customers is running low on stock between your regular visits.

The First Action:

In the stockroom, next to cases of a particular wine, a button tied to the SKU for that wine is positioned on the shelf. When the manager realizes the store is running low on stock, she presses the button – just 1-click!. The wine rep receives an email letting him know that the store is running low on stock for this item.

The rep knows all of the relevant information about the product: the SKU and the typical quantity this customer orders.

The Second Action:

An order is automatically placed in the distributor’s ordering system.

The Third Action:

An SMS is sent back to the customer letting them know the order has been placed and when it will ship.

Create Dynamic Serverless Apps

Using the Twilio API we can ask the customer, via a phone call, how many cases of wine they would like to order.


Demo

What About the Buttons?

Now that we have covered what buttons are and what they can do, let’s review the types of buttons out there.

Wi-Fi Buttons

If you are mainly going to be using your buttons in one place and have a wi-fi network available, the AWS Buttons might be a good bet for you.

AWS IoT Button

Use this button and the AWS ButtonDevApp to develop your serverless apps and test them with the button. You can let your users change the wi-fi Networks the buttons work on with the AWS IoT Button Wi-Fi App.

You can purchase this button from Amazon.

AWS Enterprise Button

Once you have developed and tested your Serverless apps, the AWS Enterprise Button is a great choice. It uses the AWS 1-Click infrastructure to keep track of and manage the buttons. The app, available from the Google Play store or Apple’s App store, allows you to easily claim a bunch of buttons at once and enable them.

You can purchase this button from Amazon.

Bluetooth Buttons

These buttons require a gateway or a device that captures the bluetooth signals from the buttons and transmits them over the Internet where they can initiate a server less app. You can learn more about gateways in our Bluetooth Gateway Roundup

LTE-M Buttons

The last category of buttons are those that register the button click using the special M2M networks provided by all of the cellular carriers. These devices are much, much cheaper than traditional cellular plans as they are intended for devices that send very small amounts of data.

The AT&T LTE-M Button

This is by far the easiest to set up of the M2M buttons. The button is supported by the AWS 1-Click Service; the cellular service is already included in the cost of this button.

https://marketplace.att.com

Estimote LTE-M Beacon

This product is meant for developers and works with the Estimote’s Events API. The unit runs javascript microapps on the device itself, and can call code for those apps from the cloud via the cellular network. In addition to the button functionality that is described earlier in this video, you can program this device to act as a GPS tracker or a BLE gateway.

You can purchase the Estimote LTE-M Beacon from their website

AT&T LTE-M Starter Kit

Your imagination is your only limit with this unit. Also meant for developers, it has several programmable buttons in addition to heat and humidity sensors as well as an on board accelerometer  You can also use expansion boards with this unit.

You can purchase this unit from AT&T’s IoT Store

Simplify Your Work Tasks with Help from Revolution11

Now that you have a pretty good idea of the varied and fascinating IoT products and services along with a better understanding of what these buttons are and what they can do — there’s bound to be a button for you! WIth so many ways of connecting to the cloud to run important IoT applications let Revolution11 get you started with any project, big or small. Ping us at inquiries@revolution11.com to get going today!

Download a PDF of this blog here: IoT Button Roundup

IoT Button Roundup

Beacon Naming Standards

What are Beacons?

Beacons are small devices that transmit Bluetooth radio signals to phones, Bluetooth gateways, and even other beacons. A great article about beacons can be found here: https://www.beaconzone.co.uk/what_are_beacons

Finding Your Beacons

In order to work with beacons, it is important that they are both easily identifiable to your organization, and uniquely named. This makes it easy for your various applications to find your organization’s beacons and differentiate them from one another.

Beacons can transmit Bluetooth radio signals in Google’s Eddystone Format, Apple’s iBeacon Format, a proprietary format from a manufacturer, and in many instances, they can broadcast more than one of these formats at the same time.

Since Eddystone and iBeacon are the most dominant beacon formats, we are going to concentrate on naming standards for these two formats.

A great article about naming conventions for beacons can be found here.

Setting Up Your Beacon’s Identity

Eddystone

The Eddystone format uses two pieces of information to identify the beacon: the Namespace and the Instance.

In our case we are going to use the Namespace to represent the Organization or company, and the Instance will be a random 6 bit, 12 Hex digits (Digits are 0 to 9 or a to f) value.

We used the tool atWaraxe IT Security to convert our domain name into SHA-1 (a cryptographic hash function that takes an input and creates hex values) and used the first 20 characters as the Namespace.

Here is an example of what the name looks like:
Revolution11.com becomes dcfa937051d7f02c4130d170291507d485067271, the first 20 characters are our namespace (dcfa937051d7f02c4130)

iBeacon

The iBeacon format uses three pieces of information to distinguish a beacon’s identity (UUID, Major, Minor)

In our case we are going to use the UUID to represent the Organization or Company and the major and minor will be random values between 1 and 65535

Here is an example of what the name looks like:

d0285c83-2167-42e3-8d11-99a37cb97489   7654 9835

UUID Major Minor

Follow our blog series to understand where and how these naming standards will come into play as you utilize different applications with your beacons!

Download a PDF of this post: Beacon Naming Standards

Beacon Naming Standards

Basic Configuration of Minew Beacons

Basic Configuration of Minew Beacons

Minew makes beacons in a variety of form factors. These instructions cover the basic setup of a tag beacon, but they will apply to most of the beacons in Minew’s product lineup.

Download the BeaconsSet+ App in the Google Play Store or the Apple App Store

Open the BeaconSet+ App. The Minew Beacons in Range should appear. For instructions on the type of beacon you want to configure, see below.

Remove the Plastic Strip attached to the beacon, which enables the battery.

Make note of the Mac Address that is on a sticker on the outside of the beacon, you will use this to identify the beacon so you can configure it.  Also make sure you have your Eddystone namespace and instance values ready, or your iBeacon UUID, Major and Minor Values ready (or both if you will be broadcasting in both formats). You can learn more about beacon naming standards here).

Open the BeaconSet+ App
It should open to a scan screen, press the refresh icon in the lower right hand corner to scan for beacons.

Tap on your beacon in the list. You will be prompted for a password. The default password for Minew Beacons is minew123

EddyStone Configuration

  1. We will use the first slot for Eddystone. Choose Slot 1
  2. For the Frame Type Choose UID from the scrolling “Frame Type” Picker

3. Paste in your InstanceID and NameSpace and press Save

Congratulations, the first slot should now be set-up to broadcast your company or organization’s namespace and the unique instance of this beacon with the Eddystone Format.

On to the next slot!

iBeacon Configuration

  1. We will use the second slot for iBeacon. Choose Slot 2
  2. For the Frame Type Choose iBeacon  from the scrolling “Frame Type” Picker

3. Past in the UUID, Major, and Minor. Note that the field entry has Major at the top rather than UUID.

Hurray!  The Second Slot is now set to broadcast in the iBeacon Format.

URL Configuration

The Third slot is set up with an Eddystone URL. Google has discontinued using this URL with nearby notifications, but it is still useful as it can be viewed by applications built to support it. The URL is set to Minew’s Site by default.

For this example, we will change the url to revolution11.com; you will use your organization’s URL. Once that change has been made, press Save

TLM Configuration

The fourth slot is set-up to broadcast TLM.  This is useful to monitor the health of your beacons with Google’s Beacon Manager Service and the Proximity API.

Leave this slot alone.

Check out our blog (coming soon!) on setting up the Proximity API and using it to add your beacons so they can take advantage of this service.

Info Configuration

The Fifth Slot is for broadcasting information about the beacon. We will leave this one alone for now

Each of the slots has three configurable slider bars:

  1. Adv Interval – The frequency at which the bluetooth signal from this slot will broadcast
    Rss@1m – A Measurement of power used to calculate relative distance
    Radio Txpower- The Strength of the signal this slot will be transmitting at

  2. You can adjust these sliders as you work with apps and gateways that pick up these signals to optimize the usefulness of the beacons.

  3. The last thing we need to do is change the default password. Return to the General tab and press Modify password

You will be asked to supply a new 8 character password.  Type it in and press OK.

That’s it! Your beacon is now set up and ready to be added via Google’s Proximity API to the Beacon Manager. There it is easily managed and anyone assigned to the project with an app built to use the Proximity API can utilize the beacons.

Download a PDF of this blog: Configuration of Minew Beacons

Basic Configuration of Minew Beacons

Configuring the Minew G1 Wi-Fi BLE Gateway

Important! Set up an Amazon Web Service (AWS) Account before beginning Gateway configuration

Minew Gateway Set Up on a Wi-Fi Network

1. Open box and remove the gateway from it’s plastic cover. The gateway comes with a USB cable to plug into your computer, however, we recommend purchasing a charger.

2. Plug in and power up the gateway by pressing the on button, located next to the power plug. Look for the SSID Name in the format of GW-XXXXXXXXXXXX in your Wi-Fi networks (you can change this name later). Choose this network.

3. Open a browser and go to http://192.168.99.1 to connect the gateway. The initial username and password is admin/admin. You will be asked to change the password once you log onto the gateway.

4. Click on the Network tab and enable the “repeater” option by toggling the switch on the right side.

5.  Choose a Wi-Fi Network to repeat, put in the password for that network, and press connect

6.  After this change you will be asked to reboot. Press “Reboot”

Setting up the Gateway on the AWS IoT Core

1. Log onto the AWS Console and select the IoT Core Service

2.  Create a policy to use for the gateway; choose Secure/Policies on the left hand menu and press Create

3.  On the next screen, name the policy and create a general IoT policy as shown in the screenshot. Under Add Statements start typing I..O..T and choose IOT*. Select Allow under Effect and press Create

4.  Next Choose Manage/Things in the menu to the left and press Create

5.  Choose Create a Single Thing

6.  Give the Gateway a Name (you can add types and groups if you will have more than one gateway) and if you would like an attribute key and value and press Next

7.  On the next screen choose One Click Certificate Creation and click “Create Certificate”

8.  This is where you need to pay attention! Download the certificates and put them in a folder. You will also need a “root certificate,” which we explain in the next step. For now, press Activate.

9.  Get the root certificate. Go to https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication

Choose the first option in the list: RSA 2048 bit key: Amazon Root CA 1. Save the text that comes up in your browser as a file named ca.crt. We use BBEdit to capture the text.

10.  Return to the webpage where you activated the certificates and press Attach a Policy

11.  Choose the policy you created earlier and press Attach

12.  Go to Manage/Things, select your gateway and press Interact. This is where you will find the endpoint of your thing in the top field. Copy this value and save it.

Setting up the Gateway with certificates and MQTT Publishing

1. Save all of the certificate files onto a USB Drive, and insert the USB Drive into the Gateway

2.  Make Sure you are on the Gateways Wi Fi and log onto the admin console at http://192.168.99.1

3.  Choose the Service tab and make sure MQTT is chosen in the dropdown menu

4.  Choose SSL in the URL dropdown and put in the name of the thing endpoint you saved when you set up the gateway on AWS.

5.  Make sure USB is chosen in the “Upload Way” dropdown menu and type in the names of your key, certificate and root certificate.

6.  Press all three upload buttons.  A “Success” confirmation popup appears  after each button press.

7.  Save the changes to the gateway by pressing Apply

8.  A Success popup appears

Checking MQTT Publishing at AWS

1. On the Service Tab of the Gateway Admin tool you will see the default topic the gateway is publishing to. Copy the topic.

2. Log back on to AWS, choose the IoT Service, choose Manage/Things and select the Gateway

3.  Choose Activity

4.  Click on MQTT Client, paste the default topic into first text box and press “Subscribe to Topic”

5.  You should see the JSON coming in from the device, and any beacons it is picking up via MQTT.

Download a PDF of this blog here: Configuring the Minew Gateway

Configuring the Minew G1 Wi-Fi BLE Gateway

Configuring the Ingics iGSO2E Ethernet BLE Gateway

Important! Set up an Amazon Web Service (AWS) Account before beginning Gateway configuration

INGICS Gateway Set Up for Your Wi-Fi Network

Once you receive your INGICS IGS02E Ethernet BLE Gateway follow these steps to configure:

The gateway comes with an antennae and a Power Over Ethernet cable. The cable has a powered ethernet jack and a splitter to plug into the micro-USB input on the gateway to charge it.

It also has an ethernet cable that plugs into the gateway that uses your existing network to send the Bluetooth data it collects to the AWS IoT Core. If you are not using Power Over Ethernet you can still use this gateway by connecting the ethernet jack on the gateway to your router, and powering the gateway via a micro-usb cable and cell phone charging unit.

Set Up the Gateway on the AWS IoT Core

1. Log onto the AWS Console and select IoT Core under the Internet of Things heading. Select Get Started the first time you access this screen.

2.  To create a Gateway policy, select Secure on the left hand menu, then select Policies on the sub-menu. Press Create.

3.  On the next screen, name the policy.

4. Under Add Statements, use the Action box to create a general IoT policy. Start typing I…o…t and then select the first statement: “IoT:*” from picklist as the value in this field; this is a general policy for all IoT devices.

5. Clear out the string that auto-populates in the Amazon Resource Name (ARN) field and replace with a wildcard (*). The Resource ARN is the end point for this resource and acts as a general policy for any resource.

6. Under Effect, choose Allow.

7. Press Create.

8.  Next Choose Manage → Things on the left menu. Press Create.

9.  Choose Create a Single Thing.

10.  Name the Gateway; add types and groups if you will have more than one Gateway and if you would like an attribute key and value. An example type is Ethernet Gateway. An example group is Gateways. *See note below on Naming Conventions.

11. Click Create a Type and fill in the appropriate information.
Press Next.

12.  Choose One-Click certificate creation and click Create Certificate.

13.  This is where you need to pay attention! Download the certificates and place them in a folder. In the next step we will get the “root certificate.” For now, press Activate.

14.  Get the root certificate. Go to: https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication

15. Click on Amazon Root CA 1 under the Amazon Trust Service Endpoints heading. Save the text that comes up in your browser as a file named ca.crt  Use bbedit to save the file. http://www.barebones.com/products/bbedit/index.html

16. Return to the webpage where you activated the certificates and press Attach a Policy.

17.  Choose the policy you created earlier and press Attach.

18. Choose Register Thing.

19. Go back to the main menu and select Manage → Things. Select your gateway and press Interact. This is where you will find the endpoint of your thing in the top field. Copy this value and save it.

Setting up the Gateway with Certificates and MQTT Publishing

1. Make sure you are on the network the gateway is attached to; log onto the admin console. You can download the app Fing from the Google Play Store or Apple’s App store to help you determine the IP address of the device to log onto the admin console. The default user name and password are admin/admin.

2. Once you are logged in, change the default password:

  • Enter the Current Password
  • Enter the New Password
  • Click on the Change Password Button

The changes will not take effect until you reboot the unit.

Change Password

2.  Click on the Applications tab and choose MQTT Client under Applications. Enter the endpoint you saved when you set up the gateway on AWS in the Host/IP field and press Save. You will have to reboot the gateway to save the changes.

MQTT Settings

4.  Press the advanced tab. Use Choose File to pick the certificate and private key files you saved (Step 8). Press Upload Certificate and Upload Key after choosing the files and then press Reboot.

Checking MQTT Publishing at AWS

1. On the Applications Tab of the Gateway Admin tool you will see the default topic the gateway is publishing to. Change it to:  /in/ac233fc01615/status so it is formatted correctly and press Save.

2.  Log back on to AWS, choose the IoT Core under Service, choose Manage/Things and select the Gateway.

3.  Choose Activity on the left menu.

4.  Click on MQTT Client, paste the default topic into first text box and press Subscribe to Topic.

5.  This gateway does not send JSON so you will just see the string.

Congratulations! You have now successfully configured your Gateway. Revolution11 is here to help you through the process of setting up your BLE Gateways, beacons and sensors. We have worked with many clients to automate processes so you can work smarter, not harder!

*Important Note

It is important to have a naming convention that allows our team to quickly identify the location, type, and manufacturer of the device when working with devices in the cloud. Revolution11 highly recommends the following naming convention, based on the useful information in this blog: https://www.netcraftsmen.com/device-naming-conventions/

The blog makes a great point in describing how your device names need to work easily in a Command Line Interface (CLI).

The only information that we have added to the standard in this blog is the addition of the manufacturer.

Best practice for naming looks like this:

ftbr-blewifi-ing-01 represents

  • Location: Fort Bragg,
  • Type of device: ble wi-fi gateway
  • Manufacturer: Ingics
  • Number: first of several devices at this location

Download a PDF of this blog: Configuring the INGICS Gateway

Configuring the Ingics iGSO2E Ethernet BLE Gateway