Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fan9704/influx-iot-playground
Stimulate IoT Data Save in InfluxDB use Grafana observe
https://github.com/fan9704/influx-iot-playground
emqx grafana influxdb telegraf
Last synced: 6 days ago
JSON representation
Stimulate IoT Data Save in InfluxDB use Grafana observe
- Host: GitHub
- URL: https://github.com/fan9704/influx-iot-playground
- Owner: fan9704
- Created: 2025-01-03T06:45:26.000Z (23 days ago)
- Default Branch: master
- Last Pushed: 2025-01-20T09:15:38.000Z (6 days ago)
- Last Synced: 2025-01-20T09:29:21.828Z (6 days ago)
- Topics: emqx, grafana, influxdb, telegraf
- Language: Python
- Homepage:
- Size: 2.41 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InfluxDB-IoT-Playground
> Data Analyze for IoT Device
> Author : FKT
---
![Grafana-Dashboard](images/grafana-dashboard.png)
![Influx-Dashboard](images/preview.png)## System Architecture
![](images/system-architecture.svg)
---
## Prerequisite
- Docker/Docker-Compose
- Python
- Poetry---
## Getting Start
### Step.1 setup InfluxDB/Telegraf/Grafana
```shell
docker-compose up -d
```### Step.2 Get InfluxDB Token
進到 InfluxDB 網頁介面,取得 Token
### Step.3 Create telegraf.conf
創建 telegraf.conf,內容複製來自 *telegraf.conf.example* 的內容,並且把剛剛的 Token 替換掉
### Step.4 Grafana connect to InfluxDB(V2)
開啟 Grafana 介面 > Connections > Add new connection > InfluxDB
![Grafana-Datasource](images/grafana-datasource.png)
記得選擇 InfluxDB 2.0 以上的 **Flux** Source
![Grafana-Influx](images/grafana-influx.png)
填入
1. user
2. password
3. bucket
4. organization
5. token![Grafana-Influx-Info](images/grafana-Influx-info.png)
確認與驗證
### Step.5 Setup MQTT Client(Python)
```shell
poetry install
poetry shell
python3 main.py
```### Step.6 Grafana Query
填寫至 Dashboard 下方的 Query
```txt
from(bucket: "gdsc")
|> range(start: -1m)
```
![Grafana-Query](images/grafana-query.png)---
## Note
### Export poetry dependencies to requirements.txt
```shell
poetry export --without-hashes --format=requirements.txt > requirements.txt
```