Installing FogLAMP¶
FogLAMP is extremely lightweight and can run on inexpensive edge devices, sensors and actuator boards. For the purposes of this manual, we assume that all services are running on a Raspberry Pi running the Raspbian operating system. Be sure your system has plenty of storage available for data readings.
If your system does not have Raspbian pre-installed, you can find instructions on downloading and installing it at https://www.raspberrypi.org/downloads/raspbian/. After installing Raspbian, ensure you have the latest updates by executing the following commands on your FogLAMP server:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update
You can obtain FogLAMP in two ways:
Dianomic Systems hosts a package repository that allows the FogLAMP packages to be loaded using the system package manage. This is the recommended method for long term use of FogLAMP as it gives access to all the FogLAMP plugins and provides a route for easy upgrade of the FogLAMP packages. This also has the advantages that once the repository is configured you are able to install new plugins directly from the FogLAMP user interface without the need to resort to the Linux command line.
Dianomic Systems offers pre-built, certified binaries of FogLAMP for Debian using either Intel or ARM architectures. This is perhaps the simplest method for users not used to Linux. You can download the complete set of packages from http://dianomic.com/download-foglamp/.
In general, FogLAMP installation will require the following packages:
FogLAMP core
FogLAMP user interface
One or more FogLAMP South services
One or more FogLAMP North service (OSI PI and OCS north services are included in FogLAMP core)
Using the package repository to install FogLAMP¶
If you choose to use the Dianomic Systems package repository to install the packages you will need to follow the steps outlined below for the particular platform you are using.
Ubuntu or Debian¶
On a Ubuntu or Debian system, including the Raspberry Pi, the package manager that is supported is apt. You will need to add the Dianomic Systems archive server into the configuration of apt on your system. The first thing that most be done is to add the key that is used to verify the package repository. To do this run the command
wget -q -O - http://archives.dianomic.com/KEY.gpg | sudo apt-key add -
Once complete you can add the repository itself into the apt configuration file /etc/apt/sources.list. The simplest way to do this is the use the add-apt-repository command. The exact command will vary between systems;
Raspberry Pi does not have an apt-add-repository command, the user must edit the apt sources file manually
sudo vi /etc/apt/sources.list
and add the line
deb http://archives.dianomic.com/foglamp/latest/buster/armv7l/ /
to the end of the file.
Note
Replace buster with stretch or bullseye based on the OS image used.
Users with an Intel or AMD system with Ubuntu 18.04 should run
sudo add-apt-repository "deb http://archives.dianomic.com/foglamp/latest/ubuntu1804/x86_64/ / "
Users with an Intel or AMD system with Ubuntu 20.04 should run
sudo add-apt-repository "deb http://archives.dianomic.com/foglamp/latest/ubuntu2004/x86_64/ / "
Note
We do not support the aarch64 architecture with Ubuntu 20.04 yet.
Users with an Arm system with Ubuntu 18.04, such as the Odroid board, should run
sudo add-apt-repository "deb http://archives.dianomic.com/foglamp/latest/ubuntu1804/aarch64/ / "
Users of the Mendel operating system on a Google Coral create the file /etc/apt/sources.list.d/foglamp.list and insert the following content
deb http://archives.dianomic.com/foglamp/latest/mendel/aarch64/ /
Once the repository has been added you must inform the package manager to go and fetch a list of the packages it supports. To do this run the command
sudo apt -y update
You are now ready to install the FogLAMP packages. You do this by running the command
sudo apt -y install *package*
You may also install multiple packages in a single command. To install the base foglamp package, the foglamp user interface and the sinusoid south plugin run the command
sudo DEBIAN_FRONTEND=noninteractive apt -y install foglamp foglamp-gui foglamp-south-sinusoid
Installing FogLAMP downloaded packages¶
Assuming you have downloaded the packages from the download link given above. Use SSH to login to the system that will host FogLAMP services. For each FogLAMP package that you choose to install, type the following command:
sudo apt -y install PackageName
The key packages to install are the FogLAMP core and the FogLAMP User Interface:
sudo DEBIAN_FRONTEND=noninteractive apt -y install ./foglamp-1.8.0-armv7l.deb
sudo apt -y install ./foglamp-gui-1.8.0.deb
You will need to install one of more South plugins to acquire data. You can either do this now or when you are adding the data source. For example, to install the plugin for the Sense HAT sensor board, type:
sudo apt -y install ./foglamp-south-sensehat-1.8.0-armv7l.deb
You may also need to install one or more North plugins to transmit data. Support for OSIsoft PI and OCS are included with the FogLAMP core package, so you don’t need to install anything more if you are sending data to only these systems.
Checking package installation¶
To check what packages have been installed, ssh into your host system and use the dpkg command:
dpkg -l | grep 'foglamp'
Run with PostgreSQL¶
To start FogLAMP with PostgreSQL, first you need to install the PostgreSQL package explicitly. See the below links for setup
Also you need to change the value of Storage plugin. See Configure Storage Plugin from GUI or with below curl command
$ curl -sX PUT localhost:8081/foglamp/category/Storage/plugin -d '{"value": "postgres"}'
{
"description": "The main storage plugin to load",
"type": "string",
"order": "1",
"displayName": "Storage Plugin",
"default": "sqlite",
"value": "postgres"
}
Now, it’s time to restart FogLAMP. Thereafter you will see FogLAMP is running with PostgreSQL.