{"id":3697,"date":"2023-01-30T17:56:11","date_gmt":"2023-01-30T17:56:11","guid":{"rendered":"https:\/\/lora.vsb.cz\/?page_id=3697"},"modified":"2025-08-14T09:31:16","modified_gmt":"2025-08-14T09:31:16","slug":"telegraf-influxdb-grafana","status":"publish","type":"page","link":"https:\/\/lora.vsb.cz\/index.php\/telegraf-influxdb-grafana\/","title":{"rendered":"Telegraf &#038; InfluxDB &#038; Grafana"},"content":{"rendered":"<table style=\"height: 66px;\" width=\"356\">\n<tbody>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>TTN version:<\/strong><\/td>\n<td><strong><span style=\"color: #008000;\">TTNv3<\/span><\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>System:<\/strong><\/td>\n<td><strong>64-bit<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>Last updated:<\/strong><\/td>\n<td>January 5, 2024<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For data storage and visualization, we use an open-source time series database <a href=\"https:\/\/www.influxdata.com\/\" target=\"_blank\" rel=\"noopener\"><strong>InfluxDB<\/strong><\/a> and an open-source analytical and interactive visualization web application <a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noopener\"><strong>Grafana<\/strong><\/a>. Data from The Things Stack is sent via MQTT to the MQTT consumer <strong><a href=\"https:\/\/www.influxdata.com\/time-series-platform\/telegraf\/\" target=\"_blank\" rel=\"noopener\">Telegraf<\/a><\/strong>, which then stores the data in the InfluxDB database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3878 size-full\" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard.png\" alt=\"Dashboard\" width=\"1901\" height=\"772\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard.png 1901w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard-300x122.png 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard-1024x416.png 1024w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard-768x312.png 768w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard-1536x624.png 1536w\" sizes=\"auto, (max-width: 1901px) 100vw, 1901px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #189bd6;\"><strong>Prepare<\/strong><\/span><\/h2>\n<ul>\n<li>Raspberry Pi 3\/4 or Linux server<\/li>\n<li>The Things Stack with active sensor (for example <a href=\"https:\/\/lora.vsb.cz\/index.php\/temperature-humidity-and-pressure-sensor-bme280\/\" target=\"_blank\" rel=\"noopener\">BME280<\/a>)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">OS\/Server and Docker installation<\/span><\/strong><\/h2>\n<p>This section describes two installation processes based on the operating system &#8211; <strong>Raspberry Pi OS<\/strong> and <strong>Ubuntu Server<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong><u>Raspberry Pi OS<\/u><\/strong><\/h3>\n<h6><strong>Raspberry Pi OS setup<\/strong><\/h6>\n<ol>\n<li>From\u00a0<strong><a href=\"https:\/\/www.raspberrypi.com\/software\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.raspberrypi.com\/software\/<\/a><\/strong>\u00a0download\u00a0<strong>Raspberry Pi Imager<\/strong>\u00a0and install it.<\/li>\n<li>Insert the microSD card into the computer.<\/li>\n<li>Run\u00a0<strong>Raspberry Pi Imager<\/strong>.<\/li>\n<li>Click on\u00a0<strong>CHOOSE OS<\/strong>.<\/li>\n<li>Click on\u00a0<strong>Raspberry Pi OS (other)<\/strong>.<\/li>\n<li>Click on\u00a0<strong>Raspberry Pi OS Lite (64-bit)<\/strong>.<\/li>\n<li>Click on\u00a0<strong>CHOOSE STORAGE<\/strong>.<\/li>\n<li>Select the inserted microSD card on which you want to install Raspberry Pi OS.<\/li>\n<li>Click on <strong>Next<\/strong>.<\/li>\n<li>Would you like to apply OS customisation settings? &#8211; <strong>EDIT SETTINGS<\/strong>.<\/li>\n<li><strong>Set hostname<\/strong>.<\/li>\n<li><strong>Set username and password<\/strong>. (<span style=\"color: #ff6600;\">we recommend a 17-digit password containing lower and upper case letters, numbers and symbols<\/span>)<\/li>\n<li>If you will use WiFi \u2013\u00a0<strong>Configure wireless LAN<\/strong>. (<span style=\"color: #ff6600;\">optional<\/span>)<\/li>\n<li><strong>Set locale settings<\/strong>.<\/li>\n<li>Click on tab <strong>SERVICES<\/strong>.<\/li>\n<li>If you will be connecting remotely via SSH \u2013<strong>\u00a0Enable SSH<\/strong>\u00a0\u2013\u00a0<strong>Use password authentication<\/strong>. (<span style=\"color: #ff6600;\">optional<\/span>)<\/li>\n<li>Click on\u00a0<strong>SAVE<\/strong>.<\/li>\n<li>Click on <strong>YES<\/strong>.<\/li>\n<li>Click on\u00a0<strong>YES<\/strong>.<\/li>\n<li>Click on\u00a0<strong>CONTINUE<\/strong>.<\/li>\n<li>Insert the microSD card into the Raspberry Pi.<\/li>\n<li>Turn on the Raspberry Pi.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Remote connection via SSH (optional)<\/strong><\/h6>\n<ol>\n<li>Connect to your router and find the IP address of your Raspberry Pi.<\/li>\n<li>From a Windows PC, you can connect using <strong>Command Prompt<\/strong> (CMD) or <strong><a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\" target=\"_blank\" rel=\"noopener\">PuTTY<\/a><\/strong>.<\/li>\n<li>On Windows PC open <strong>Command Prompt<\/strong> (CMD).<\/li>\n<li>Type <code><strong>ssh -p <em>port <\/em><em>username<\/em>@<em>IP<\/em><\/strong><em>_<\/em><strong><em>Address<\/em><\/strong><\/code> (for example: ssh -p 22 loravsb@192.168.1.120).<\/li>\n<li>Type your password.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Post-installation steps<\/strong><\/h6>\n<ol>\n<li>Update, upgrade and reboot Raspberry Pi. This will ensure that any security vulnerabilities are patched:\n<pre>$ sudo apt update\r\n$ sudo apt full-upgrade\r\n$ sudo reboot<\/pre>\n<\/li>\n<li>Connect again via SSH.<\/li>\n<li>Use a different port for SSH and disable root login.\u00a0First, open the SSH configuration file with a text editor:\n<pre>$ sudo nano \/etc\/ssh\/sshd_config\r\n<\/pre>\n<\/li>\n<li>Locate the line with <code>Port 22<\/code> and change it to the desired port number (for example, change the port to 2222). Locate the line with <code>PermitRootLogin<\/code> and change its value to <code>no<\/code> (this will disable root login via SSH):\n<pre><span class=\"hljs-keyword\">Port 2222\r\nPermitRootLogin no<\/span>\r\n\r\n<\/pre>\n<\/li>\n<li>Save the changes and exit the text editor.<\/li>\n<li>Restart the SSH service to apply the changes:\n<pre>$ sudo systemctl restart ssh\r\n<\/pre>\n<\/li>\n<li>Log out and connect again via SSH on the new port.<\/li>\n<li>Install and configure the built-in firewall, ufw, to limit incoming and outgoing network connections. In the <code>sudo ufw limit 2222\/tcp<\/code> rule, change port 2222 to port you have chose for SSH above.\n<pre>$ sudo apt install ufw\r\n$ sudo ufw <span class=\"hljs-keyword\">default<\/span> deny incoming\r\n$ sudo ufw <span class=\"hljs-keyword\">default<\/span> deny outgoing\r\n$ sudo ufw limit 2222\/tcp\r\n$ sudo ufw allow out 123\/udp\r\n$ sudo ufw allow <span class=\"hljs-keyword\">out<\/span> <span class=\"hljs-keyword\">to<\/span> <span class=\"hljs-keyword\">any<\/span> port 53\r\n$ sudo ufw allow <span class=\"hljs-keyword\">out<\/span> <span class=\"hljs-keyword\">to<\/span> <span class=\"hljs-keyword\">any<\/span> port <span class=\"hljs-number\">80\r\n$ sudo ufw allow <span class=\"hljs-keyword\">out<\/span> <span class=\"hljs-keyword\">to<\/span> <span class=\"hljs-keyword\">any<\/span> port 443\r\n$ sudo ufw enable<\/span>\r\n<\/pre>\n<p><span style=\"color: #ff6600;\">Note: Firewall rules will have no effect on ports opened by Docker.<\/span><\/li>\n<li>Reboot Raspberry Pi:\n<pre>$ sudo reboot<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Docker<\/strong><\/h6>\n<ol>\n<li>Connect again via SSH.<\/li>\n<li>Install additional packages:\n<pre>$ sudo apt install ca-certificates curl gnupg lsb-release<\/pre>\n<\/li>\n<li>Add Docker\u2019s official GPG key:\n<pre>$ sudo mkdir -p \/etc\/apt\/keyrings\r\n$ curl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg | sudo gpg --dearmor -o \/etc\/apt\/keyrings\/docker.gpg<\/pre>\n<\/li>\n<li>Use the following command to set up the repository:\n<pre>$ echo \"deb [arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.gpg] https:\/\/download.docker.com\/linux\/debian $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/pre>\n<\/li>\n<li>Update the apt package index:\n<pre>$ sudo apt update<\/pre>\n<\/li>\n<li>Install the latest Docker version:\n<pre>$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin<\/pre>\n<\/li>\n<li>Verify that the Docker Engine installation is successful by running the hello-world image:\n<pre>$ sudo docker run hello-world<\/pre>\n<\/li>\n<li>Continue to the <strong>InfluxDB setup<\/strong> section below.<\/li>\n<\/ol>\n<p>For more information on Docker installation, see <a href=\"https:\/\/docs.docker.com\/engine\/install\/debian\/\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.docker.com\/engine\/install\/debian\/<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h3><strong><u>Ubuntu Server<\/u><\/strong><\/h3>\n<ol>\n<li>From <a href=\"https:\/\/ubuntu.com\/download\/server\" target=\"_blank\" rel=\"noopener\">https:\/\/ubuntu.com\/download\/server<\/a> download ISO image.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>If the server&#8217;s operating system will run directly on the hardware, proceed as follows, otherwise skip these steps:<\/strong><\/h6>\n<ol>\n<li>Download <strong>Balena Etcher Portable<\/strong> from <a href=\"https:\/\/www.balena.io\/etcher#download-etcher\" target=\"_blank\" rel=\"noopener\">https:\/\/www.balena.io\/etcher#download-etcher<\/a>\u00a0and run it.<\/li>\n<li>Click on <strong>Flash from file<\/strong>.<\/li>\n<li>Select the downloaded ISO Image.<\/li>\n<li>Insert the USB flash drive into the computer.<\/li>\n<li>Click on <strong>Select target<\/strong>.<\/li>\n<li>Select the USB flash drive.<\/li>\n<li>Click on <strong>Flash!<\/strong><\/li>\n<li>Insert the USB flash drive into the server.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Ubuntu Server and Docker setup<\/strong><\/h6>\n<ol>\n<li>Boot from the USB flash drive \/ ISO image.<\/li>\n<li>Select <strong>Try or Install Ubuntu Server<\/strong>.<\/li>\n<li>Select Language.<\/li>\n<li>Choose <strong>Update to the new installer<\/strong>.<\/li>\n<li>Select keyboard layout.<\/li>\n<li>Choose the base for the installation &#8211; <strong>Ubuntu Server<\/strong>.<\/li>\n<li>Configure Network connections.<\/li>\n<li>Configure the proxy address or leave it blank.<\/li>\n<li>Configure Ubuntu archive mirror &#8211; default.<\/li>\n<li>Storage configuration &#8211; default.<\/li>\n<li>Profile setup &#8211; Enter username, password, &#8230;<\/li>\n<li>SSH Setup &#8211; Select Install OpenSSH server if you want to connect remotely. <span style=\"color: #ff6600;\">(optional)<\/span><\/li>\n<li>Features Server Snaps &#8211; Select a <strong>docker<\/strong>.<\/li>\n<li>Click on <strong>Reboot<\/strong>.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Remote connection via SSH (optional)<\/strong><\/h6>\n<ol>\n<li>Log in to the server.<\/li>\n<li>Type to the server&#8217;s terminal <code>ip a<\/code>.<\/li>\n<li>From a Windows PC, you can connect using <strong>Command Prompt<\/strong> (CMD) or <strong><a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\" target=\"_blank\" rel=\"noopener\">PuTTY<\/a><\/strong>.<\/li>\n<li>On Windows PC open <strong>Command Prompt<\/strong> (CMD).<\/li>\n<li>Type <code><strong>ssh -p <em>port<\/em> <em>username<\/em>@<em>IP_Address<\/em><\/strong><\/code> (for example: ssh -p 22 loravsb@192.168.1.120).<\/li>\n<li>Type your password.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Post-installation steps<\/strong><\/h6>\n<ol>\n<li>Update, upgrade and reboot server. This will ensure that any security vulnerabilities are patched:\n<pre>$ sudo apt update\r\n$ sudo apt full-upgrade\r\n$ sudo reboot<\/pre>\n<\/li>\n<li>Connect again via SSH.<\/li>\n<li>Use a different port for SSH and disable root login.\u00a0First, open the SSH configuration file with a text editor:\n<pre>$ sudo nano \/etc\/ssh\/sshd_config\r\n<\/pre>\n<\/li>\n<li>Locate the line with <code>Port 22<\/code> and change it to the desired port number (for example, change the port to 2222). Locate the line with <code>PermitRootLogin<\/code> and change its value to <code>no<\/code> (this will disable root login via SSH):\n<pre><span class=\"hljs-keyword\">Port 2222\r\nPermitRootLogin no<\/span>\r\n\r\n<\/pre>\n<\/li>\n<li>Save the changes and exit the text editor.<\/li>\n<li>Restart the SSH service to apply the changes:\n<pre>$ sudo systemctl restart ssh\r\n<\/pre>\n<\/li>\n<li>Log out and connect again via SSH on the new port.<\/li>\n<li><span style=\"color: #ff6600;\">Install and configure the built-in firewall, ufw, to limit incoming and outgoing network connections.<\/span><\/li>\n<li>Reboot server:\n<pre>$ sudo reboot<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h6><strong>Docker test<\/strong><\/h6>\n<ol>\n<li>Verify that the Docker Engine installation is successful by running the hello-world image:\n<pre>$ sudo docker run hello-world<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<hr \/>\n<h2><strong><span style=\"color: #800000;\">InfluxDB setup\u00a0<\/span><\/strong><\/h2>\n<ol>\n<li>Create internal Docker networks:\n<pre>$ sudo docker network create myNetworkIandG\r\n$ sudo docker network create myNetworkIandT<\/pre>\n<\/li>\n<li>Run this commands to run InfluxDB 1.8.10 and connect the container to second network:\n<pre>$ sudo docker run -d --restart always --name=influxdb --network myNetworkIandG -v influxdb:\/var\/lib\/influxdb influxdb:1.8.10\r\n$ sudo docker network connect myNetworkIandT influxdb<\/pre>\n<\/li>\n<li>Connect to InfluxDB container:\n<pre>$ sudo docker container exec -it influxdb \/bin\/sh\r\n<\/pre>\n<\/li>\n<li>Connect to InfluxDB using influx CLI, create an admin and two users, create a database and give the first user read permission (for Grafana) and the second user write permission (for Telegraf) to the created database:\n<pre># influx\r\n&gt; CREATE USER <em><span style=\"color: #ff6600;\">myNewAdmin<\/span><\/em> WITH PASSWORD '<em><span style=\"color: #ff6600;\">myAdminPassword<\/span><\/em>' WITH ALL PRIVILEGES\r\n&gt; CREATE USER <em><span style=\"color: #ff6600;\">myNewUser <\/span><\/em>WITH PASSWORD '<span style=\"color: #ff6600;\"><em>myUserPassword<\/em><\/span>'\r\n&gt; CREATE USER <em><span style=\"color: #ff6600;\">myNewTelegrafUser <\/span><\/em>WITH PASSWORD '<span style=\"color: #ff6600;\"><em>myUserTelegrafPassword<\/em><\/span>'\r\n&gt; CREATE DATABASE <em>ttsDatabase<\/em>\r\n&gt; GRANT READ ON \"<em>ttsDatabase<\/em>\" TO \"<em><span style=\"color: #ff6600;\">myNewUser<\/span><\/em>\"\r\n&gt; GRANT WRITE ON \"<em>ttsDatabase<\/em>\" TO \"<em><span style=\"color: #ff6600;\">myNewTelegrafUser<\/span><\/em>\"\r\n&gt; exit\r\n<\/pre>\n<\/li>\n<li>Enable authentication by adding the following [http] section to the influxdb.conf file:\n<pre># cd etc\/influxdb\r\n# cat &lt;&lt;EOT &gt;&gt; influxdb.conf\r\n&gt;\r\n&gt;[http]\r\n&gt;  enabled = true\r\n&gt;  auth-enabled = true\r\n&gt;EOT\r\n# exit\r\n<\/pre>\n<\/li>\n<li>Restart the influxdb container:\n<pre>$ sudo docker restart influxdb<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">TTS MQTT Integration<\/span><\/strong><\/h2>\n<ol>\n<li>In\u00a0<strong>TTS -&gt; Applications -&gt; YourAppName -&gt; Integrations -&gt; MQTT<\/strong> click on <strong>Generate new API key<\/strong>.<\/li>\n<li>In the <strong>Telegram section<\/strong> below, you will use the <strong>Connection credentials<\/strong> to connect to the TTS MQTT server.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3890 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/TTS-MQTT.png\" alt=\"MQTT Integration\" width=\"649\" height=\"421\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/TTS-MQTT.png 1380w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/TTS-MQTT-300x195.png 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/TTS-MQTT-1024x664.png 1024w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/TTS-MQTT-768x498.png 768w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">Telegraf<\/span><\/strong><\/h2>\n<ol>\n<li>Run this command to create and edit the telegraf.conf file:\n<pre>$ nano telegraf.conf<\/pre>\n<\/li>\n<li>Copy and paste the configuration below into your <strong>telegraf.conf<\/strong> file. Then in the <strong>[[inputs.mqtt_consumer]]<\/strong> section, enter the <strong>username<\/strong> and the <strong>generated API key<\/strong>. Next, in the <strong>[[outputs.influxdb]]<\/strong> section, edit the <strong>database<\/strong>, <strong>username<\/strong> and <strong>password<\/strong> that you created in the <strong>InfluxDB setup<\/strong> section above.\n<pre>[agent]\r\n    interval = \"5s\"\r\n    round_interval = true\r\n    metric_batch_size = 1000\r\n    metric_buffer_limit = 10000\r\n    collection_jitter = \"5s\"\r\n    flush_interval = \"10s\"\r\n    flush_jitter = \"5s\"\r\n\r\n[[inputs.mqtt_consumer]]\r\n    name_override = \"tts\"\r\n    servers = [\"tcp:\/\/eu1.cloud.thethings.network:1883\"]\r\n    connection_timeout = \"30s\"\r\n    topics = [\"v3\/+\/devices\/#\"]\r\n    username = \"<em><span style=\"color: #ff6600;\">THING_USERNAME<\/span><\/em>\"\r\n    password = \"<em><span style=\"color: #ff6600;\">THING_API_KEY<\/span><\/em>\"\r\n    data_format = \"json\"\r\n\r\n[[outputs.influxdb]]\r\n    database = \"<span style=\"color: #ff6600;\"><em>ttsDatabase<\/em><\/span>\"\r\n    urls = [\"http:\/\/influxdb:8086\"]\r\n    username = \"<em><span style=\"color: #ff6600;\">myNewTelegrafUser<\/span><\/em>\"\r\n    password = \"<span style=\"color: #ff6600;\"><em>myUserTelegrafPassword<\/em><\/span>\"\r\n<\/pre>\n<\/li>\n<li>Run this commands to run Telegraf:\n<pre>$ sudo docker run -d --restart always --name=telegraf --network myNetworkIandT -v $PWD\/telegraf.conf:\/etc\/telegraf\/telegraf.conf:ro telegraf<\/pre>\n<\/li>\n<\/ol>\n<p>For more information on Telegraf installation, see <a href=\"https:\/\/hub.docker.com\/_\/telegraf\" target=\"_blank\" rel=\"noopener\">https:\/\/hub.docker.com\/_\/telegraf<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">Grafana<\/span><\/strong><\/h2>\n<h3><strong>Grafana setup<\/strong><\/h3>\n<ol>\n<li>Navigate to the \/<strong>home\/username<\/strong>\u00a0directory.<\/li>\n<li>Create a <strong>my-grafana-plugins<\/strong> folder:\n<pre>$ mkdir my-grafana-plugins<\/pre>\n<\/li>\n<li>Run this command to run Grafana:\n<pre>$ sudo docker run -d --restart always --name=grafana --network myNetworkIandG -p 3000:3000 -v \"$(pwd)\"\/my-grafana-plugins:\/var\/lib\/grafana\/plugins grafana\/grafana\r\n<\/pre>\n<\/li>\n<li>Now you can visit your Grafana web application from a browser in your internal network at <code><strong><em>http:\/\/IP<\/em><\/strong><em>_<\/em><strong><em>AddressOfServer:3000<\/em><\/strong><\/code> (for example 192.168.1.120:3000).<\/li>\n<li>Log in with username <strong>admin<\/strong> and password <strong>admin<\/strong>.<\/li>\n<li>Change your Grafana account password.<\/li>\n<li>Click on <strong>Configuration -&gt; Data sources -&gt; Add data source<\/strong>.<\/li>\n<li>Choose <strong>InfluxDB<\/strong>.<\/li>\n<li>Query Language = <strong>InfluxQL<\/strong><\/li>\n<li>URL = <code><strong>http:\/\/influxdb<\/strong><strong>:8086<\/strong><\/code><\/li>\n<li>Database = <span style=\"color: #ff6600;\"><em>ttsDatabase<\/em><\/span><\/li>\n<li>User = <span style=\"color: #ff6600;\"><em>myNewUser<\/em><em>FromInfluxDB<\/em><\/span><\/li>\n<li>Password = <span style=\"color: #ff6600;\"><em>myUserPassword<\/em><em>FromInfluxDB<\/em><\/span><\/li>\n<li>HTTP Method = <strong>GET<\/strong><\/li>\n<li>Click on <strong>Save &amp; test<\/strong><\/li>\n<\/ol>\n<p>For more information on Grafana installation, see\u00a0<a href=\"https:\/\/hub.docker.com\/r\/grafana\/grafana\" target=\"_blank\" rel=\"noopener\">https:\/\/hub.docker.com\/r\/grafana\/grafana<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Grafana dashboard setup<\/strong><\/h3>\n<ol>\n<li>Click on <strong>Dashboards -&gt; Browse -&gt; New -&gt; New Dashboard<\/strong>.<\/li>\n<li>Choose <strong>Add a new panel<\/strong>.<\/li>\n<li>In the <strong>FROM<\/strong> line click on <strong>select measurement<\/strong> and select <strong>tts.<\/strong><\/li>\n<li>Click on <strong>+<\/strong> and select <strong>topic<\/strong>.<\/li>\n<li>Click on <strong>select tag value<\/strong> and select your TTS device.<\/li>\n<li>In the <strong>SELECT <\/strong>line click on <strong>value<\/strong> and select for example <strong>uplink_message_decoded_payload_temperature_1<\/strong>.<\/li>\n<li>Then change <strong>mean()<\/strong> to <strong>last()<\/strong>.<\/li>\n<li>In the <strong>GROUP BY<\/strong> line change <strong>fill(null)<\/strong> to <strong>fill(none)<\/strong>.<\/li>\n<li>You can change the Type, Title, Unit, Display name, Color scheme and many more in the menu on the right.<\/li>\n<li>Next, click on <strong>Save<\/strong>.<\/li>\n<li>Continue like this for the other panels.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3896 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup.png\" alt=\"Grafana Dashboard Setup\" width=\"800\" height=\"376\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup.png 1910w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup-300x141.png 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup-1024x481.png 1024w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup-768x361.png 768w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/Grafana_Dashboard_Setup-1536x722.png 1536w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Grafana panel plugins<\/strong><\/h3>\n<p>If you are interested in how to create your own Grafana panel plugin or import an existing one, follow this tutorial: <strong><a href=\"https:\/\/lora.vsb.cz\/index.php\/grafana-panel-plugin-for-sending-downlinks\/\" target=\"_blank\" rel=\"noopener\">Grafana panel plugin (for sending downlinks)<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TTN version: TTNv3 System: 64-bit Last updated: January 5, 2024 For data storage and visualization, we use an open-source time series database InfluxDB and an open-source analytical and interactive visualization web application Grafana. Data from The Things Stack is sent via MQTT to the MQTT consumer Telegraf, which then stores the data in the InfluxDB [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3697","page","type-page","status-publish","hentry","post"],"_links":{"self":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/3697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/comments?post=3697"}],"version-history":[{"count":203,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/3697\/revisions"}],"predecessor-version":[{"id":8918,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/3697\/revisions\/8918"}],"wp:attachment":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/media?parent=3697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}