Important! Set up an Amazon Web Service (AWS) Account before beginning Gateway configuration
Gateway Set Up for Your Wi-Fi Network
Once you receive your Gateway follow these steps to configure:
- The Gateway comes with an antennae and a USB charging cable; you supply your own USB charging adapter. The instructions for adding this unit to your Wi-Fi Network are very straightforward and can be found here.
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 the Create button in the upper right hand corner.
3. On the next screen, name the policy.
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.
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.
Under Effect, choose Allow
Press Create in the lower right hand corner
4. Next Choose Manage → Things on the left menu. Press Create
5. Choose Create a Single Thing
6. 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 Wi-Fi Gateway. An example group is Gateways. *See note below on Naming Conventions
Click Create a Type and fill in the appropriate information.
7. Choose One-Click certificate creation and click Create Certificate
8. 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
9. Get the root certificate. Go to: https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication
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 (or another text editor) to save the file http://www.barebones.com/products/bbedit/index.html
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. Choose Register Thing.
13. 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.
14. Make Sure you are on the Gateways Wi Fi; log onto the admin console. Review instructions here. You can download the Android app Fing to help you determine the IP address of the device.
15. 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. This will reboot the gateway.
16. 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
- On the Applications Services 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
3. Click on MQTT Client, paste the default topic into first text box and press Subscribe to Topic
4. This gateway does not send JSON so you will just see the strings for the beacons it is picking up.
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:
- Location: Fort Bragg,
- Type of device: ble wi-fi gateway
- Manufacturer: Ingics
- Number: first of several devices at this location