-
Notifications
You must be signed in to change notification settings - Fork 0
Time Stack Notes
Dayne Broderson edited this page Oct 14, 2021
·
10 revisions
General steps
- install dependencies:
- setup a time-series database
- setup grafana with the database
- add the database to node-red
- stream data to the database
- create dashboard
Always good to start with an up-to-date system:
sudo apt update && sudo apt upgrade -y
sudo apt install mosquitto mosquitto-clients -y
sudo systemctl enable mosquitto
sudo system start mosquitto
One that is complete you've got a mosquitto MQTT server running on localhost.
sudo apt install influxdb
sudo systemctl enable influxdb
sudo systemctl start influxdb
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server.service
sudo systemctl status grafana-server
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
DISTRIB_ID=$(lsb_release -c -s)
echo "deb https://repos.influxdata.com/debian ${DISTRIB_ID} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt-get install telegraf
sudo systemctl enable telegraf
sudo systemctl start telegraf
The configuration file /etc/influxdb/influxdb.conf can be used to enable/disable lots of features.
- ensure HTTP enabled
- bind to standard port
- create users (optional for playgrounds)
- create an admin user
- create a data provider user (writer)
- create a data consumer user (reader)
You can connect to the influx server command line console by typing influx whereupon you can do a few key comments;
show databasesuse <a database>create <a database>
See the query language spec for more details.
influx
> show databases
# If you don't have a database named `testing` create one:
> create database testing
> use database testing
sudo nano /etc/telegraph/telegraph.conf
add the following at the bottom of the file
[[inputs.mqtt_consumer]]
servers = ["tcp://127.0.0.1:1883"]
connection_timeout = "30s"
qos = 0
topics = [ "rtl_433/#" ]
client_id = "telegraf"
persistent_session = false
data_format = "json"
[[outputs.influxdb]]
urls = ["http://127.0.0.1:8086"]
database = "testing"
user_agent = "telegraf"
sudo systemctl restart telegraf
Login to grafana on port 3000. The first time you login as admin and password admin. Change the password!
Configuration menu (sidebar) -> Data Sources -> Add data source -> InfluxDB URL: HTTP://localhost:8086 Database: testing
mqtt-in node with Topic: rtl_433/# outputting to a JSON node.