Skip to content

Installing t6

mathcoll edited this page Oct 11, 2021 · 27 revisions

Install dependencies

t6 require the following packages running:

  • Influxdb - v1.8.x are known to be working fine.
  • Telegraf optional - v1.[18-19] are known to be working fine.
  • nodejs - the latest available version should be great
  • npm - the latest available version should be great

Note that t6 is able to store Datapoints also to InfluxData Cloud Storage - so influxDb become optional in that context, but still strongly recommanded.

Install t6

Do not use sudo/root to install t6, this is not necessary, and so, not recommended.

$ git clone https://github.com/mathcoll/t6.git & cd ./t6
$ npm install
Then, on the `./data/` folder : 
rename "settings-hostname.js" according to your server _hostname_ and edit the file.
rename "rules-hostname.js" according to your server _hostname_.
rename "sensors-hostname.js" according to your server _hostname_.
rename "db-hostname.json" according to your server _hostname_.

✨ On linux, to identify your hostname, you can run the following command:

$ hostname

t6 configuration

Please have a look at the options in settings-hostname.js

Mqtt settings

These settings refers to Mqtt configuration.

Session settings

Please make sure secret is a random text you define - hopefully it does not have any litteral sense.

JWT

Please make sure secret is a random text you define - hopefully it does not have any litteral sense.

Http settings

Logs settings

Email settings

Database settings - Storage

Quota settings

Localization settings

pushSubscription

Trackings

IFTTT settings

OTA settings

Image processing

t6queue

custom units

Data Fusion

Once t6 is installed and running, please let us know you are using t6 on your server - Repository author email can be found on pakage file. :-)

t6 as a startup service (Linux)

There are probably better way and more modern service implementation. Please share any alternative options.

Note: ✨ Any more elegant way to manage server enviroment is welcome. :-)

You can add the server running as a service, tested with Ubuntu and Debian:

  • First: install the server as service:
$ sudo ln -s /home/mathieu/Projets/current/internetcollaboratif.info/t6/etc/systemd/system/t6.service /etc/systemd/system/
$ systemctl enable t6
  • And then, start t6 using:
$ systemctl start t6

t6 timeseries settings

Once the setting are done, you can initialize the influxDb databases:

CREATE DATABASE "t6"
Then opt 1:
CREATE RETENTION POLICY "quota7d" on "t6" DURATION 7d REPLICATION 1 SHARD DURATION 1d

or opt 2:
CREATE RETENTION POLICY "quota4w" on "t6" DURATION 4w REPLICATION 1 SHARD DURATION 1d

You can also add some other usefull Retention Policies
CREATE RETENTION POLICY "retention1d" on "t6" DURATION 1d REPLICATION 1 SHARD DURATION 1h
CREATE RETENTION POLICY "retention1w" on "t6" DURATION 1w REPLICATION 1 SHARD DURATION 1d
CREATE RETENTION POLICY "retention4w" on "t6" DURATION 4w REPLICATION 1 SHARD DURATION 1d
CREATE RETENTION POLICY "retention1y" on "t6" DURATION 365d REPLICATION 1 SHARD DURATION 7d

Database will contains the following measurements:

  • data: All timeseries for measures;
  • events: events happening in t6 Api; not really used, except for few logs;
  • requests: Allows to manage quotas and limits; this is the one using the quota7d or quota4w retention policy. The appropriate setting must be set on the influxSettings.retentionPolicies enviroment variable.

t6 Troobleshooting after installation

Q: sudo /etc/init.d/t6 start does not return any output, what should I do?

A: Try to set chmod +x to file /var/www/t6/bin/www and then, have a look at log files. Please note "logLevel" should be "LOG|DEBUG|INFO|WARNING|ERROR" to turn on ALL debug mode.

Q: Do I need to install sqlite3?

A: Well, NO. Sqlite3 is deprecated. You can't use it anymore since b93fb1a449f19427dc82ba815368cb39ab43a429.

Clone this wiki locally