Project

General

Profile

Installing Tigase IoT Software

Installation of IoT-hub

The latest version of IoT hub is available by using wget:

wget http://build.xmpp-test.net/nightlies/dists/latest/tigase-iot-hub-dist.tar.gz

Once downloaded, extract the files. It will automatically extract to a subfolder.

tar -xzf tigase-iot-hub-dist.tar.gz

The folder with the version of the hub will be named in the following format: tigase-iot-hub-x.x-SNAPSHOT-byy
where x.x is the version, and yy is the build number. These may be important for bugs and troubleshooting.

To make things simple, and to avoid typing the version we can rename the folder using the mv command.

mv tigase-iot-hub-x.x-SNAPSHOT-byy iot-hub

Navigating inside, you will see the following file list:

certs      database  jars          logs          README   tigase
ChangeLog  etc       License.html  package.html  scripts  win-stuff

Selecting Java

Since there are many builds of Java available, we have to set the path to java manually. To do this, type the following into the command line:

sudo nano etc/tigase.conf

When you press enter, you will need to edit the following line

#JAVA_HOME="$(JDKPath)"

And replace it with the location of java, also remove the preceding hash so it is not ignored.

JAVA_HOME="/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt"

Press Ctrl+X, Answer Yes, and press enter to overwrite the old name.

Starting up

Go back up one level to the main directory

cd ..

From the main directory use the following command:

./scripts/tigase.sh upgrade-schema etc/tigase.conf

This is required to setup the associated database and if not run will result in the program being unable to run.

You should see a status report once everything is done:

=============================================================================
      Schema upgrade finished

Configuration file etc/config.tdsl was updated to match current format.
Previous version of configuration file was saved as etc/config.tdsl.old

Data source: default with uri jdbc:derby:tigase_iot;create=true
      Checking connection to database ok
      Checking if database exists     ok
      Loading Common Schema Files     ok
      Loading schema: Tigase XMPP Server (Core), version: 8.0.0-SNAPSHOT-b5214/ff351c8a (database version: none)      ok
      Loading schema: Tigase PubSub Component, version: 4.0.0-SNAPSHOT-b652/eb442404 (database version: none) ok
      Adding XMPP admin accounts      warning
              Message: Error: No admin users entered
      Post installation action        ok
=============================================================================

Once this process is complete, you can run the hub itself with the following command:

./scripts/tigase.sh start etc/tigase.conf

The hub is now active and running.

Now it's time to install and start the IoT Framework.

Installing IoT Framework

Tigase IoT Framework distribution package comes with startup scripts for systemd.
To use them please follow this steps to install Tigase IoT Framework and systemd startup scripts.

Create user and adjust permissions

As the first step we need to create user with which permissions IoT framework will be running

sudo useradd --home-dir /home/tigase --create-home --system tigase

If you are installing Tigase IoT Framework on Raspberry PI and want to use GPIO, SPI or I2C connected devices then we need to add newly created user to proper groups

sudo usermod -a -G spi,i2c,gpio tigase

Switching working directory

For next steps we need to switch working directory to home directory of user tigase

cd /home/tigase

Download distribution package

NOTE: We assume that you have wget utility installed.

We are going to change working directory to tigase user home path and download newest version of Tigase IoT Framework:

sudo -u tigase wget http://build.tigase.org/nightlies/dists/latest/tigase-iot-framework.zip

Unpacking distribution package

To unpack distribution package and create symlink for easier access we are executing following commands:

sudo -u tigase unzip tigase-iot-framework.zip
sudo -u tigase ln -s tigase-iot-framework-2.0.0-SNAPSHOT-b62 tigase-iot-framework

WARNING: We assumed that tigase-iot-framework-2.0.0-SNAPSHOT-b62 is name of the directory unpacked from tigase-iot-framework.zip.

Installation of startup scripts

sudo cp -r tigase-iot-framework/etc/default/* /etc/default/
sudo cp -r tigase-iot-framework/etc/systemd/* /etc/systemd/

sudo systemctl daemon-reload

Enabling Tigase IoT Framework

sudo systemctl enable tigase-iot-framework

Summary

At this point we have Tigase IoT Framework installed and configured to start after restart. From now on we can:

Start framework

sudo systemctl start tigase-iot-framework

Stop framework

sudo systemctl stop tigase-iot-framework

Check status of the framework

sudo systemctl status tigase-iot-framework