ChirpStack + Grafana Data Visualization
ChirpStack + Grafana Data Visualization
Background
| Item | Detail |
|---|---|
| Products Used | LHT65N × 10, DLOS8 × 1 |
| Network Server | ChirpStack v4 (self-hosted) |
| Application | Grafana + PostgreSQL |
| Customer Scenario | Customer wants to monitor temperature & humidity in 10 office rooms with a Grafana dashboard, all on a private local network (no cloud dependency) |
Solution Architecture
LHT65N (×10) → DLOS8 Gateway → ChirpStack v4 → PostgreSQL → Grafana
(local LAN) (Docker) (TimescaleDB)
All components run on a single Ubuntu server within the customer's LAN.
Step-by-Step
1. DLOS8 Gateway Configuration
- Access DLOS8 web UI at
10.130.1.1 - Set LoRaWAN → Service Provider to Custom / Private LoRaWAN
- Configure ChirpStack Gateway Bridge address:
10.130.1.100:1700
2. ChirpStack v4 Setup (Docker)
git clone https://github.com/chirpstack/chirpstack-docker.git
cd chirpstack-docker
docker compose up -d
- Add Gateway in ChirpStack UI
- Create Device Profile with Dragino LHT65N codec
- Register 10 devices
3. Data Pipeline to PostgreSQL
Use ChirpStack Integration → PostgreSQL to automatically store decoded data.
Alternatively, use MQTT subscriber to write to TimescaleDB:
import paho.mqtt.client as mqtt
import psycopg2, json
def on_message(client, userdata, msg):
data = json.loads(msg.payload)
obj = data.get("object", {})
# Insert into TimescaleDB
cur.execute(
"INSERT INTO sensor_data (device, temperature, humidity, ts) VALUES (%s,%s,%s,NOW())",
(data["deviceInfo"]["deviceName"], obj.get("TempC_SHT"), obj.get("Hum_SHT"))
)
conn.commit()
4. Grafana Dashboard
- Add PostgreSQL/TimescaleDB as data source
- Create panels: temperature heatmap, humidity trend, per-room cards
- Set alert rules for temperature > 28°C or humidity > 70%
Result
- Fully private deployment, zero cloud dependency
- 10 rooms monitored with 10-minute intervals
- Grafana dashboard accessible to facility management team via LAN
Notes
- TimescaleDB is recommended over plain PostgreSQL for time-series queries
- ChirpStack v4 Docker deployment requires at least 2GB RAM