Skip to content

RPi Fog Node Install

Irmin Okic edited this page Jun 6, 2018 · 3 revisions

Raspberry Pi Fog Node Install Instructions

This page describes all the steps required to setup a fog node on a vanilla Raspberry Pi 3B.

1. Download Raspbian

Download the official lite image. At the time of writing the current Debian version is 9 (Stretch). If you need a desktop environment download the appropriate image.

2. Install Raspbian

Follow the instructions to install the OS on the SD Card. During development the image was installed under linux using dd.

To enable ssh before booting create a file named "ssh" in the boot partition.

The OS should be ready to go. If you are connecting the RPi using WiFi edit wpa_suplicant.conf before booting the image in order to have ssh access.

Login

Power up the RPi and connect the ethernet cable if required. Login with ssh and the default credentials:

$ ssh pi@raspberrypi
Password: raspberry

Set Custom Hostname

Start the RPi config application:

$ sudo raspi-config

Navigate the menu: Network Options > Hostname
Enter a hostname following the template: smart-parking-rpi-<id>, replacing <id> with the id of the fog node. Exit and reboot for the configuration to take effect.

3. Install Dependencies

Repository Dependencies

  • Git is required to pull in the environment configurations.
  • Pip is required for installing Docker Compose.
  • OpenJDK and Maven are required for building the arrowhead core services and any Java artifacts that may be used by the environments.

Execute:

$ sudo apt-get install git python3-pip openjdk-8-jdk maven

Install Docker and Docker Compose

At the time of writing the best way to install a recent version of docker and docker-compose is using the convenience script. Execute:

$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker pi
$ sudo pip3 install docker-compose
$ sudo reboot

Install Go

Git LFS requires at least Go version 1.10. If the package repository contains a lower version install from binaries:

$ wget https://dl.google.com/go/go1.10.2.linux-armv6l.tar.gz
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
$ . ~/.bashrc
$ rm go1.10.2.linux-armv6l.tar.gz

Install Git Large File Storage

Our repository uses Git LFS for storying binary files that aren't suited for Git. Add the repository:

$ go get github.com/github/git-lfs
$ sudo cp go/bin/git-lfs /usr/bin
$ git lfs install
$ rm -rf go

3. Clone and Build

Clone the arrowhead docker repository:

$ git clone --recurse-submodules https://github.com/hegeduscs/arrowheaddocker.git

Build the arrowhead core systems:

$ cd arrowheaddocker/submodules/arrowhead
$ mvn install

4. Start Docker Environment

Finally switch into the directory containing the desired environment (docker-compose.yml) and execute:

$ docker-compose up -d database # This step gives the database a head start (optional)
$ docker-compose up