Quick start with Ubuntu
This guide shows you how to get started with Pelion Edge and Ubuntu. You can obtain Pelion Edge .deb
(Debian) packages through two methods:
- Installing prebuilt packages from Pelion's official Advanced Package Tool (APT) repository.
- This method saves time, requires less knowledge and reduces the risk of making mistakes because it doesn't require setting up a build environment.
- Building the packages from source.
- With this method, you can install
mbed-edge-core-devmode
, which is Edge Core built specifically with your Pelion Device Management developer credentials, so it doesn't require additional provisioning after installation.
- With this method, you can install
Install prebuilt packages
At the end of this tutorial, you will have installed Pelion Edge packages on the Ubuntu 20.04 operating system from Pelion's official APT repository.
Prerequisites
Before you install the packages, you need a Pelion Device Management account.
Install
-
Add the Pelion Edge APT repository to your list of package repositories:
sudo sh -c 'echo "deb http://apt.edge.pelion.com/ubuntu/ focal main" >/etc/apt/sources.list.d/pelion-edge.list'
-
Import the public GPG key to verify the integrity of the Pelion Edge debian packages:
curl http://apt.edge.pelion.com/apt.edge.pelion.com.gpg.key | sudo apt-key add -
-
Override the priority for the
containernetworking-plugins
package:sudo sh -c '(echo Package: containernetworking-plugins; echo Pin: origin apt.edge.pelion.com; echo Pin-Priority: 999) > /etc/apt/preferences.d/99prefer-pelion-edge'
-
Update the APT package index, so the Pelion Edge packages are available for installation:
sudo apt update
-
Install the Pelion Edge packages:
sudo apt install pelion-edge
At this point, Pelion Edge packages are installed on your system. However, if you have not yet provisioned Edge Core with a Pelion Edge client certificate, the Pelion Edge edge-core service will be in a failed state. To provision a certificate to Edge Core, please see the provisioning documentation, or use the Edge pep tool to automate the provisioning process.
Build packages from source
This guide builds Pelion Edge on the Ubuntu 20.04 operating system. At the end of this tutorial, you will have built Pelion Edge packages ready to be installed on Ubuntu Focal AMD64.
Prerequisites
Before you can build this package, you must have:
-
A Pelion Device Management account with which you have:
- Created and downloaded the developer certificate credentials file
mbed_cloud_dev_credentials.c
. - Created an application access key.
- Created and downloaded the developer certificate credentials file
-
Docker and git installed to your build machine.
Build
-
Clone
distro-pelion-edge
, and change the directory to the root of the repository:git clone https://github.com/PelionIoT/distro-pelion-edge cd distro-pelion-edge
-
Copy the
mbed_cloud_dev_credentials.c
file in place, so the Edge developer mode package builds with your developer credentials:cp ~/Downloads/mbed_cloud_dev_credentials.c .
-
Use the manifest tool to create
update_default_resources.c
:manifest-tool init -a <access-key> --vendor-id 42fa7b48-1a65-43aa-890f-8c704daade54 --class-id 42fa7b48-1a65-43aa-890f-8c704daade54 --force
Note: Firmware-over-the-air update behavior is currently not defined.
-
Copy the generated
update_default_resources.c
into place:cp /path/to/update_default_resources.c .
-
Build all the Ubuntu 20 packages for AMD64 using Docker:
./build-env/bin/docker-run-env.sh focal ./build-env/bin/build-all.sh --deps --install --build --source --arch=amd64
Ubuntu packages are available in
./build/deploy/deb/focal/main/
-
(Optional) To rebuild an individual package (for example,
mbed-edge-core-devmode
):./build-env/bin/docker-run-env.sh focal ./mbed-edge-core-devmode/deb/build.sh --install --build --source --arch=amd64
Troubleshooting
Please see the distro-pelion-edge README for more information and GitHub issues for solutions to common build errors.