Documentation

Mistake on this page? Email us

Quickstart guide

This guide shows you how to get started with Edge.

Getting started with Edge

  1. Download a developer certificate from the Device Management portal.
  2. Clone the Edge code and follow the build instructions in the readme.
  3. Clone the Edge protocol translator examples and follow the build instructions in the readme.
  4. Follow the instructions in the Edge readme to start edge-core.
  5. Follow the instructions in the Edge protocol translator example readme to start pt-example. Instead of pt-example, you can also use the javascript example.

Building Edge for Raspberry Pi

After running the Edge on a local machine, run it on a device of its own. Raspberry Pi 3 is used as a reference device for Edge. The Yocto Project is used for creating a firmware image.

If you're not familiar with the Yocto, read the quick build guide.

  1. Download the Yocto Project's build system and Poky.

  2. Add the required additional meta-layers to your build system by cloning them and adding them to the bblayers.conf file:

  3. Follow the instructions on setting the required local.conf variables in the meta-mbed-edge and meta-mbed-raspberrypi readme documents.

  4. (Optional) To enable the firmware update, use the Manifest tool to create the information required by the Update client.

  5. Build the rpi-mbed-image using Bitbake. Add the mbed_cloud_dev_credentials.c and update_default_resources.c files to the build by setting the following environment variables:

    $ export MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS="-DDEVELOPER_MODE=ON -DMBED_CLOUD_IDENTITY_CERT_FILE=/path/to/mbed_cloud_dev_credentials.c -DFIRMWARE_UPDATE=ON -DMBED_UPDATE_RESOURCE_FILE=/path/to/update_default_resources.c"
    $ export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS"
    
  6. Flash the generated rpi-mbed-image-raspberrypi3.rpi-sdimg to a memory card.

Building Edge for AM437x EVM

Texas Instruments (TI) provides an SDK with Yocto-based Linux distribution called Arago and hardware support for AM437x EVM.

  1. Set up the Arago Yocto build, see meta-mbed-am437x section Dependencies.

    • We recommend that you build plain Arago before proceeding with these instructions just to sort out potential problems with the build environment.
  2. Add the required additional meta-layers to your build system by cloning them and adding them to the bblayers.conf file:

  3. Follow the instructions on setting the required local.conf variables in the meta-mbed-edge readme document.

  4. (Optional) To enable firmware update, use the Manifest tool. It creates the information required by the Update client.

  5. Add the mbed_cloud_dev_credentials.c and update_default_resources.c files to the build by setting the following environment variables:

    $ export MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS="-DDEVELOPER_MODE=ON -DMBED_CLOUD_IDENTITY_CERT_FILE=/path/to/mbed_cloud_dev_credentials.c -DFIRMWARE_UPDATE=ON -DMBED_UPDATE_RESOURCE_FILE=/path/to/update_default_resources.c"
    $ export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS"
    
  6. Build the am437x-mbed-image using Bitbake, see meta-mbed-am437x section Build.

  7. Flash the generated arago-base-tisdk-image-am437x-evm-[timestamp].rootfs.ti-sdimg to a memory card.

Protocol translator reference implementations

Simple protocol translator example

The example demonstrates the bare minimum to implement a protocol translator without the protocol-specific implementation and how to use the pt-client APIs. It creates three simulated devices, cpu-temperature, thermometer and thermostat, each demonstrating some combination of readable, writable and executable resources. See the application source code and related documentation.

MQTT protocol translator example

The example demonstrates how to translate devices from an MQTT broker. It shows how to interface with the MQTT broker using the Mosquitto library and how to implement a translation based on the MQTT topics and payloads. See the application source code and related documentation.

Bluetooth Low Energy (BLE) protocol translator example

The example demonstrates how to translate BLE devices. It shows how to interface with the BlueZ Bluetooth daemon over DBus and how to implement a translation of BLE Generic Attributes (GATT) server services and characteristics. See the application source code and related documentation.

JavaScript examples

Instead of using the provided pt-client library like the other examples, these JavaScript examples use the Edge Core protocol translator and management API directly. See the application source code and related documentation.