|
| 1 | +--- |
| 2 | +description: In this tutorial, we will guide you through installing Grafana on a Raspberry Pi-powered reComputer R1000 . We will also show you how to connect Grafana to an existing InfluxDB database and create a detailed, illustrative dashboard |
| 3 | +title: reComputer R1000 with Grafana |
| 4 | +keywords: |
| 5 | + - reComputer R1000 |
| 6 | + - IIoT |
| 7 | + - Grafana |
| 8 | + - Dash board |
| 9 | + - SCADA |
| 10 | +image: https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/grafana2.gif |
| 11 | +slug: /recomputer_r1000_grafana |
| 12 | +last_update: |
| 13 | + date: 6/24/2024 |
| 14 | + author: Kasun Thushara |
| 15 | +--- |
| 16 | +## Introduction |
| 17 | + |
| 18 | +[Grafana](https://grafana.com/oss/grafana/) is an open-source visualization and analytics software that enables you to query, visualize, alert on, and explore your metrics, logs, and traces from any storage location. It offers tools to transform your time-series database (TSDB) data into insightful graphs and visualizations. As a powerful monitoring solution, Grafana helps in making informed decisions, enhancing system performance, and streamlining troubleshooting. In this wiki, we will guide you through the installation of Grafana on a Raspberry Pi-powered reComputer R1000 , connect it to an existing InfluxDB database, and create an illustrative dashboard. |
| 19 | + |
| 20 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/grafana2.gif" /></center> |
| 21 | + |
| 22 | +### Hardware Preparation |
| 23 | + |
| 24 | +<div class="table-center"> |
| 25 | + <table class="table-nobg"> |
| 26 | + <tr class="table-trnobg"> |
| 27 | + <th class="table-trnobg">reComputer R1000</th> |
| 28 | + </tr> |
| 29 | + <tr class="table-trnobg"></tr> |
| 30 | + <tr class="table-trnobg"> |
| 31 | + <td class="table-trnobg"><div style={{textAlign:'center'}}><img src="https://files.seeedstudio.com/wiki/reComputer-R1000/recomputer_r_images/01.png" style={{width:300, height:'auto'}}/></div></td> |
| 32 | + </tr> |
| 33 | + <tr class="table-trnobg"></tr> |
| 34 | + <tr class="table-trnobg"> |
| 35 | + <td class="table-trnobg"><div class="get_one_now_container" style={{textAlign: 'center'}}><a class="get_one_now_item" href="https://www.seeedstudio.com/reComputer-R1025-10-p-5895.html"> |
| 36 | + <strong><span><font color={'FFFFFF'} size={"4"}> Get One Now 🖱️</font></span></strong> |
| 37 | + </a></div></td> |
| 38 | + </tr> |
| 39 | + </table> |
| 40 | + </div> |
| 41 | + |
| 42 | +### Software Preparation |
| 43 | + |
| 44 | +It is recommended to refer to a previous tutorial on [How to create the InfluxDB database](https://wiki.seeedstudio.com/recomputer_r1000_node_red_influxdb/). In this tutorial, we will use an existing InfluxDB connection for the setup. |
| 45 | + |
| 46 | +## Adding Grafana Repository |
| 47 | + |
| 48 | + |
| 49 | +**Ensure all currently installed packages on your Raspberry Pi OS are up to date**: |
| 50 | + |
| 51 | +```bash |
| 52 | +sudo apt update |
| 53 | +``` |
| 54 | + |
| 55 | +**Add the Grafana APT Key:** |
| 56 | + |
| 57 | +To add the Grafana APT key to your Raspberry Pi’s keychain, run the following command: |
| 58 | + |
| 59 | +```bash |
| 60 | +curl https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/grafana-archive-keyrings.gpg >/dev/null |
| 61 | +``` |
| 62 | + |
| 63 | +**Add the Grafana Repository:** |
| 64 | + |
| 65 | +Use the following command on your Raspberry Pi to add the Grafana repository to the list: |
| 66 | + |
| 67 | +```bash |
| 68 | +echo "deb [signed-by=/usr/share/keyrings/grafana-archive-keyrings.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list |
| 69 | +``` |
| 70 | + |
| 71 | +**Update Package List:** |
| 72 | + |
| 73 | +As we have made changes to our package list, we need to run an update: |
| 74 | + |
| 75 | +```bash |
| 76 | +sudo apt update |
| 77 | +``` |
| 78 | + |
| 79 | +## Installing Grafana on reComputer R1000 |
| 80 | + |
| 81 | +Install the latest version of Grafana by running the following command: |
| 82 | + |
| 83 | +```bash |
| 84 | +sudo apt install grafana |
| 85 | +``` |
| 86 | + |
| 87 | +**Configuring Grafana to Start at Boot** |
| 88 | + |
| 89 | +Enable Grafana to start at boot: |
| 90 | + |
| 91 | +```bash |
| 92 | +sudo systemctl enable grafana-server |
| 93 | +``` |
| 94 | + |
| 95 | +**Starting Grafana** |
| 96 | + |
| 97 | +Start the Grafana server software by running the command below: |
| 98 | + |
| 99 | +```bash |
| 100 | +sudo systemctl start grafana-server |
| 101 | +``` |
| 102 | + |
| 103 | +**Accessing Grafana** |
| 104 | + |
| 105 | +To access the Grafana web interface, open a web browser and navigate to: |
| 106 | + |
| 107 | +``` |
| 108 | +http://<IPADDRESS>:3000 |
| 109 | +``` |
| 110 | + |
| 111 | +Replace `<IPADDRESS>` with the IP address of your reComputer R1000 RPi 200. |
| 112 | + |
| 113 | +**Logging In** |
| 114 | + |
| 115 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/login.PNG" /></center> |
| 116 | + |
| 117 | +The default username and password are: |
| 118 | + |
| 119 | +- **Username:** `admin` |
| 120 | +- **Password:** `admin` |
| 121 | + |
| 122 | +Once you have logged in, you will be prompted to change the default password. |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/updatepsw.PNG" /></center> |
| 127 | + |
| 128 | +## Create Your First Dashboard |
| 129 | + |
| 130 | +**Navigate to Dashboards:** |
| 131 | + |
| 132 | +Click on **Dashboards** in the left-side menu. |
| 133 | + |
| 134 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/dashboard1.PNG" /></center> |
| 135 | + |
| 136 | +**Create a New Dashboard:** |
| 137 | + |
| 138 | +On the Dashboards page, click **New** and select **New Dashboard**. |
| 139 | + |
| 140 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/dashboard2.PNG" /></center> |
| 141 | + |
| 142 | +**Add a Visualization:** |
| 143 | + |
| 144 | +On the dashboard, click **+ Add visualization**. |
| 145 | + |
| 146 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/dashboard3.PNG" /></center> |
| 147 | + |
| 148 | +**Select Data Source:** |
| 149 | + |
| 150 | +You will be redirected to select a data source. In the last tutorial, we created an InfluxDB database. Click on **Configure a new data source**. |
| 151 | + |
| 152 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/configuresource.PNG" /></center> |
| 153 | + |
| 154 | +**Configure InfluxDB:** |
| 155 | + |
| 156 | + - Select **InfluxDB** under time series databases. |
| 157 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/addsource.PNG" /></center> |
| 158 | + |
| 159 | + - Provide the **URL**, **database name**, and **user privileges**. |
| 160 | + |
| 161 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/configuresource2.PNG" /></center> |
| 162 | + |
| 163 | + - Click **Save & Test**. If there are no warnings, you are good to go. |
| 164 | + |
| 165 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/saveandtest.PNG" /></center> |
| 166 | + |
| 167 | + |
| 168 | +**Build Your Dashboard:** |
| 169 | + |
| 170 | +You will see a message confirming the data source configuration. Click on **Building a dashboard**. |
| 171 | + |
| 172 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/saveandtest2.png" /></center> |
| 173 | + |
| 174 | +**Add Visualization:** |
| 175 | + |
| 176 | +You will be redirected to the new dashboard page. Click on **Add visualization**. |
| 177 | + |
| 178 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/dashboard3.PNG" /></center> |
| 179 | + |
| 180 | +**Select Data Source:** |
| 181 | + |
| 182 | +You will be redirected to select a data source. we created an InfluxDB database connection. Click on **InfluxDB**. |
| 183 | + |
| 184 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/datasource.PNG" /></center> |
| 185 | + |
| 186 | +**Configure Visualization** |
| 187 | + |
| 188 | +Grafana provides a user-friendly interface to select measurements, fields, and other relevant data points. We will create a time series visualization. On the left-hand side, you will see options to enter the Panel title, Legends, Axis settings, and Graph settings. |
| 189 | +Pay attention to the following visual elements to add a simple graph to your first dashboard. |
| 190 | +For more detailed settings and customization, refer to the [Grafana documentation](https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/). |
| 191 | + |
| 192 | +<center><img width={600} src="https://files.seeedstudio.com/wiki/reComputer-R1000/grafana/grafana.gif" /></center> |
| 193 | + |
| 194 | +## Tech Support & Product Discussion |
| 195 | + |
| 196 | +Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs. |
| 197 | + |
| 198 | +<div class="button_tech_support_container"> |
| 199 | +<a href="https://forum.seeedstudio.com/" class="button_forum"></a> |
| 200 | +<a href="https://www.seeedstudio.com/contacts" class="button_email"></a> |
| 201 | +</div> |
| 202 | + |
| 203 | +<div class="button_tech_support_container"> |
| 204 | +<a href="https://discord.gg/eWkprNDMU7" class="button_discord"></a> |
| 205 | +<a href="https://github.com/Seeed-Studio/wiki-documents/discussions/69" class="button_discussion"></a> |
| 206 | +</div> |
0 commit comments