Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sudo touch /tmp/theswap
sudo chmod 600 /tmp/theswap
sudo dd if=/dev/zero of=/tmp/theswap bs=1M count=2048
sudo mkswap /tmp/theswap 
sudo swapon /tmp/theswap

Install system dependencies

Once you have logged in, it's time to install the system dependencies needed to run EdgeX Foundry. Connect your device to your network and run the following commands:

sudo apt update

sudo apt upgrade -y

sudo apt install build-essential git wget libzmq3-dev pkg-config

You  may also want to be able to connect and manage your device remotely, in which case you should also install:

sudo apt install openssh-server vim-tiny

Installing EdgeX

There are three ways provided by the EdgeX Foundry to install and run the EdgeX services. We provide pre-packaged versions as a snap package (works on most Linux distros), as docker images, or you can build the EdgeX code from source and run the executables directly.

From the snap 

The easiest way to get EdgeX Foundry is to install the officially supported edgexfoundry snap from the snap store. 

...

sudo snap set edgexfoundry export-distro=on

...

With docker-compose

EdgeX Foundry additionally supports running via a docker-compose file from the IoTech Community Developer Kit. To run that docker-compose file, install docker:

...

Then start the services with docker-compose

docker-compose up -d

...

From source

Note that running EdgeX from source is not a supported way and not recommended for production.

Install system dependencies

Once you have logged in, it's time to install the system dependencies needed to run EdgeX Foundry. Connect your device to your network and run the following commands:

sudo apt update

sudo apt upgrade -y

sudo apt install build-essential git wget libzmq3-dev pkg-config

Install Go & Glide

To get the exact same version of Go as used by the EdgeX, install it using the go snap (note that the project currently uses Go 1.11 for the upcoming Edinburgh release, but the Delhi release was originally built with go 1.10, however go being backwards compatible you should still be able to build the Delhi release of EdgeX with go 1.11) :

...

wget https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-arm64.tar.gz

tar -C $GOPATH/bin -xvf glide-v0.12.3-linux-arm64.tar.gz --strip 1 linux-arm64/glide

Get the EdgeX Foundry source code

Now that you have Go and Glide installed, you can tell them to fetch the EdgeX services and their dependencies:

...

cd ~/go/src/github.com/edgexfoundry/edgex-go

Building EdgeX Go microservices

There are two steps for building the EdgeX Go microservices, the first to prepare the build, and the second to compile it:

...

If you are going to build the Delhi release of EdgeX, install glide as above and then checkout that branch:

git checkout delhi

Install and setup MongoDB

EdgeX used MongoDB for local data storage. You can install it with:

...

wget https://github.com/edgexfoundry/docker-edgex-mongo/raw/master/init_mongo.js

sudo -u mongodb mongo < init_mongo.js

Test run EdgeX services

Now that you have the EdgeX go services built and all the dependencies installed and running, you can run the EdgeX services themselves. The sourcecode contains a convenient script for doing this, in the same directory as your can make build above, run:

...

This will start all of the EdgeX go services and leave them running until you terminate the process (with Ctrl-C). While it's running you can make EdgeX API calls to it using the IP address of your RaspberryPi.

Make EdgeX a system service

In order to keep the EdgeX services running when you're not logged in or connected to the RaspberryPi, and to have it start automatically when it boots, you can create a SystemD service to manage it. Create a new file at /etc/systemd/system/edgex.service with the the following content:

...