Installing the LIPI CLI Tool

Download the CLI tool Tool

Code Block
wget https://storage.mazemap.com/lipi/latest/lipi

...

Code Block
lipi --setup
Initiating setup
Setup already complete. Reconfigure (y/n): y
Mazemap API key: <input your API key from Map Editor here>

Putting in your API key:

a. Go to Map Editor and navigate the Indoor Positioning menu

...

b. Click the LIPI Configuration

...

c. Expand the LIPI configuration and click on “Generate”. You can copy this key and paste it on your SSH

...

When you have already pasted the API key as shown above, you will get a new question regarding the name of your new folder in the field as shown below. (E.g, “lipi-install” or any intuitive name).

...

Code Block
Saving config: OK
Installing cron: OK
Setup complete

...

USAGE

Download and install latest

...

LIPI

(requires MazeMap api API key and internet access)

Code Block
languagebash
lipi --install latest

Note: If this is the first installation, the tool will also download the configuration
file from MazeMap.

Run status check

Code Block
languagebash
lipi --status

Run status check, and report to MazeMap

(requires MazeMap api API key and internet access)

Code Block
languagebash
lipi --status report

List available

...

LIPI versions

(requires MazeMap api API key and internet access)

Code Block
languagebash
lipi --list-available

Download and install specific version of

...

LIPI

(requires MazeMap api API key and internet access)

Code Block
languagebash
lipi --install 1.0.1

Install from local source

Code Block
languagebash
lipi \
    --install 1.0.1 \
    --lipi-path /path/to/lipi.zip \
    --config-path /path/to/config.json

Install from MazeMap, using custom configuration file

Code Block
languagebash
lipi \
    --install latest \
    --config-path /path/to/config.json

Update config of running

...

LIPI

(requires MazeMap api API key and internet access)

Code Block
languagebash
lipi --update-config

Update config of running

...

LIPI, using custom configuration file

(requires mazemap api API key and internet access)

Code Block
languagebash
lipi --update-config \
    --config-path /path/to/config.json

List installed

...

LIPI versions and see which one is active

Code Block
languagebash
lipi --list

Activate a previous installation

Code Block
languagebash
lipi --activate [copy and paste a value from the list of installed versions]

Reconfigure running LIPI

Reinitialize the current configuration with new variables.

Code Block
languagebash
lipi --reconfigure

What happens during install and updating

  • If the MazeMap api API key is set, the tool can download new versions of lipi and
    the configuration file from MazeMap servers.

  • After running initial --setup, the tool will install a cron task which regularly
    runs the command lipi --status report. This will send lipi health data to MazeMap
    on a regular basis so that we can provide a better level of service to you. This is
    only installed if the MazeMap API Key is set during setup. If this is not installed
    we can not help debugging an installation, and we will not be able to help users
    if they have trouble accessing the LIPI service. See Run status check, and report to MazeMap
    to see what is reported to MazeMap.

  • When installing a new version of LIPI, the update tool will prefer to use the
    configuration files of the currently running LIPI version. This can be overridden
    using the --config-path flag or by running --update-config before running
    --install.

  • Every --install and --update-config creates a new installation version. This
    is done to allow switching between new and previous installations or configurations
    at will. If something goes wrong, a previous version can be activated using
    --activate. The installation or update process will activate the previous version
    if the new version can't be started or seem unresponsive (if --status does not
    show a fully healthy installation).

Manual fixing:

  • --setup stored values in a file params.txt. Running --setup again will overwrite it.

  • A LIPI service has a config.json in its installation folder, which can be copied,
    edited and used using --config-path, if needed.

  • The folders under lipi LIPI installation path are self contained and can be deleted at will.
    Just make sure to not delete the running version. Use --list or --status to see which
    version is running.

  • LIPI is started using systemctl. Status and control of that service is available.
    systemctl [status|start|stop|restart] lipi.service.

Internal README

Local development

Build and start test docker container:

Code Block
./test.sh

Docker container contains following folders:

/updatetool - mazemap-gerrit/positioning/updatetool/

/lipi-sources - contains set of lipi test installations and an empty config.json

/mockservice - contains files needed to start the mock service

Packaging

Start test docker container and run:

Code Block
languagebash
./package.sh

...

  • lipi

...

Testing with mock lipi installation

Following commands are run from inside test docker container.

...

languagebash

...

  • .

...

  • service

...

  • .

...

SUMMARY

This summary contains commands that are useful when setting up the LIPI server.

...

Action

Command

Comment

Start LIPI server

sudo systemctl start lipi


Stop LIPI server

sudo systemctl stop lipi


Restart LIPI server

sudo systemctl restart lipi


Status of LIPI server

sudo systemctl status lipi


Check the lipi log

journalctl -u lipi -n 200 -f


Create a new command line user in CMX

cmxos apiserver user add [the_username] [the_password]


Update lipi

Download the new lipi 

Make sure that the file is executable by typing:
chmod +x upgrade.sh
Then run the command:
sudo ./upgrade.sh


open and update the config file

sudo nano config.json


view the config file

cat config.json


Move a file from one location to another

mv <start location> <end location> 
e.g. mv /home/cygate/config.json /srv/

In the example the config file is located in /home/cygate and we are moving it to /srv/. We are replacing the old file with the new file.

NB: PREREQUISITES FOR LIPI INSTALLATION

Requirements for the LIPI server

  • Can be virtual or physical, does not matter.

    • No OVA currently available, one of the supported OSes needs to be installed.

    • Supported Operating systems: Newest stable Ubuntu or Debian.

    • Server/Virtual Machine(VM) specs: Tested to work with single Core VM with 3.5 GB Ram and 7 GB HDD.

Requirements for the network

  • Open port 443 from LIPI server to CMX (https for API).

    • Open port 443 from all wireless clients to LIPI (https for position requests).

    • Traffic from Wireless Clients to LIPI must not pass through NAT.

Requirements for the CMX 

  • CMX set up with Location services activated and sufficient licenses.

    • Building maps, with correct map scaling and a minimum of 3 GPS markers per floor need to be set up on Cisco Prime, exported and imported into CMX.

      • GPS markers should use coordinates created using MazeMaps own map. MazeMap provides a tool for generating these. You can find the POI inspector-tool here: https://debug.mazemap.com/

    • Access points must be placed correctly (within a meter of actual location) in the maps in Cisco Prime.

    • CMX GUI user for MazeMap with Full Read Only privileges set up on MSE/CMX.

    • CMX CLI API user with full Read and API access. Both CMX GUI and CLI users should have the same username/password
      To create a CMX CLI user ssh into your CMX and run the following command: cmxos apiserver user add
      You will be asked to type in a username and password for the user - use the same username and password as you used for the GUI user.

Image Added


Dependencies

In order to upgrade the LIPI you will need the following:

  • SSH access to the LIPI server.

  • Access to CMX GUI (browser) and CLI (terminal).

  • A device that is connected to the WiFi network that is used for positioning purposes. This requires you being on site at the campus and using public wifi network

  • Pre-installed java in the server openjdk-8-jre-headless

  • Access to Map Editor in MazeMap https://admin.mazemap.com/

  • LIPI 4.0.2 software update tool that can be downloaded from here: https://storage.mazemap.com/lipi/latest/lipi