Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve standalone install documentation #416

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions docs/installation/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ This document provides the necessary steps for installation of TeslaMate on a va
sudo apt-get install -y git postgresql-11 screen wget
```

In case postgresql-11 is not available on your system, add the PPA:
```bash
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/$(lsb_release -cs)"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get install -y postgresql-11
```

### Add Erlang repository and install

```bash
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y elixir esl-erlang
```

Expand All @@ -23,9 +32,17 @@ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y grafana
sudo systemctl start grafana-server
sudo systemctl enable grafana-server.service # to start Grafana at boot time
```

_TBA_: how to install the following plugins: `pr0ps-trackmap-panel`, `natel-discrete-panel` and `grafana-piechart-panel`
Install the required Grafana plugins as well:
```bash
sudo grafana-cli plugins install pr0ps-trackmap-panel
sudo grafana-cli plugins install natel-discrete-panel
sudo grafana-cli plugins install grafana-piechart-panel
sudo systemctl restart grafana-server
```

### Install mosquitto MQTT Broker

Expand All @@ -46,6 +63,7 @@ The following command will clone the source files for the TeslaMate project. Thi
cd /usr/src

git clone https://github.com/adriankumpf/teslamate.git
cd teslamate

# Checkout the latest stable version
git checkout $(git describe --tags)
Expand All @@ -57,7 +75,8 @@ The following commands will create a database called `teslamate` on the PostgreS

```bash
su -c "createdb teslamate" postgres
su -c "createuser teslamate -W" postgres
su -c "createuser teslamate -W" postgres # use as password: secret
su -c "ALTER USER teslamate WITH SUPERUSER;" postgres psql
```

### Compile Elixir Project
Expand All @@ -77,6 +96,10 @@ MIX_ENV=prod mix release
The following command needs to be run once during the installation process in order to create the database schema for the TeslaMate installation:

```bash
export DATABASE_USER="teslamate"
export DATABASE_PASS="secret"
export DATABASE_HOST="127.0.0.1"
export DATABASE_NAME="teslamate"
_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
```

Expand Down Expand Up @@ -109,7 +132,7 @@ You should at least substitute the following details:

```
export DATABASE_USER="teslamate"
export DATABASE_PASS="teslamate"
export DATABASE_PASS="secret"
export DATABASE_HOST="127.0.0.1"
export DATABASE_NAME="teslamate"
export MQTT_HOST="192.168.1.1"
Expand All @@ -132,7 +155,7 @@ screen -S teslamate -L -dm bash -c "cd /usr/src/teslamate; ./start.sh; exec sh"

## Import Grafana Dashboards

1. Visit [localhost:3000](http://localhost:3000) and log in.
1. Visit [localhost:3000](http://localhost:3000) and log in. The default credentials are: admin:admin.

2. Create a data source with the name "TeslaMate":

Expand All @@ -153,7 +176,7 @@ screen -S teslamate -L -dm bash -c "cd /usr/src/teslamate; ./start.sh; exec sh"
$ ./grafana/dashboards.sh restore

URL: http://localhost:3000
LOGIN: admin:admin
LOGIN: admin:admin # Change this to your actual credentials
DASHBOARDS_DIRECTORY: ./grafana/dashboards

RESTORED locations.json
Expand Down