Kotori Handbook

Table of Contents


Todo

  • Swap content from here with “setup/kotori.rst”
  • Add content from “Getting started” section of Hiveeyes Handbook

Intro

Kotori can be run in different ways.

Configuration

The configuration file is either /etc/kotori/kotori.ini or at any other location you want to put the configuration at. A blueprint is:

; ##########################################
;           Kotori configuration
; ##########################################
[main]
include     = /etc/kotori/conf.d/*.ini, /etc/kotori/conf.d/*/*.ini,
              /etc/kotori/apps-enabled/*.ini, /etc/kotori/apps-enabled/*/*.ini



; ==========================================
;             General settings
; ==========================================

; http server
[kotori]
http_listen = localhost
http_port   = 24642

; mqtt bus adapter
[mqtt]
host        = localhost
#port        = 1883
username    = kotori
password    = kotori

; wamp bus adapter
[wamp]
uri         = ws://0.0.0.0:9000/ws

; storage adapters
[influxdb]
host        = localhost
#port        = 8086
username    = root
password    = root

; user interfaces
[grafana]
host        = localhost
#port        = 3000
username    = admin
password    = admin

#[config-web]
#; web configuration gui
#http_port  = 36000


; ==========================================
;       Application and vendor settings
; ==========================================
; Please activate the appropriate application- and vendor configurations
; by symlinking .ini files from etc/apps-available to etc/apps-enabled.

Todo

Add blueprint for application MQTTKit.

A blueprint for vendor LST is:

[lst]
; ------------------------------------------
; Name:     LST
; Date:     November 2015
; About:    Universal data sink for laboratory experiments and test benches.
; Channel:  Transport: UDP; Format: Binary
; Storage:  InfluxDB
; See also: https://getkotori.org/docs/applications/lst.html
; ------------------------------------------
enable       = false
type         = vendor
channels     = lst-h2m, lst-sattracker, lst-proptest

[lst-h2m]
udp_port     = 8888
wamp_topic   = edu.hm.lst.h2m
include_path = etc/headers
header_files = h2m_structs.h
graphing_legend_right_side = true

[lst-sattracker]
udp_port     = 8889
wamp_topic   = edu.hm.lst.sattracker
include_path = etc/headers/sattracker
header_files = components.h
graphing_legend_right_side = true

[lst-proptest]
udp_port     = 8887
wamp_topic   = edu.hm.lst.proptest
include_path = etc/headers/proptest
header_files = components.h
graphing_legend_right_side = true

Running

Run from virtualenv

cd develop/kotori
source .venv2/bin/activate
kotori --config etc/development.ini --debug

Tip

Sourcing into the virtualenv is not a must, Kotori also can be called directly:

~/develop/kotori/.venv2/bin/kotori --config ~/develop/kotori/etc/development.ini --debug

Specify the configuration file

There’s an alternative way to specify the configuration file:

# config file path environment variable
export KOTORI_CONFIG=/etc/kotori/kotori.ini

# start service
kotori

Run inside tmux

tmux can keep your terminal sessions open. You can detach and log out of the server. Wenn getting back to the keyboard, just log in and reattach to the named terminal:

aptitude install tmux

Run Kotori in tmux session:

ssh kotori@elbanco.hiveeyes.org
tmux new -s kotori
source ~/develop/kotori/.venv2/bin/activate
kotori --config ~/develop/kotori/etc/hiveeyes.ini --debug

Attach later:

ssh kotori@elbanco.hiveeyes.org
tmux att -t kotori